Views:

Invitations objects are associated with a specific Brillium assessment. An invitation email will contain a code that is unique to the respondent retrieves the pre-registered respondent data when the invitation link is selected.

Invitation Object

Object Properties

Property        TypeDescription
Keys
IdIntegerThe unique Invitation Id
AssessIdStringThe Assessment unique Id associated with the Assessment
Scalar Properties
CodeStringThe unique invitation code generated for the designated respondent.
Custom[1-20]StringThe Respondent field values of the invitee (formerly Custom fields)
DateCreatedDateThe created date
DateModifiedDateThe last modified date
EmailStringThe email address of the invitee
FirstNameStringThe first name of the invitee
LastNameStringThe last name of the invitee
SourceIdStringThe import data source unique identifier. For example, this could be the Salesforce ID for the contact this invitation corresponds to.
SourceNameStringThe system import source, if any
StatusStringThe Invitation status; New, Invited, Reminded, Launched, Incomplete, Completed, Passed, Failed.
Navigation Properties
UriStringThe fully qualified URI for this resource.
RelatedUrisString/String DictionaryThe list (dictionary) of related URI’s for this resource.

Invitation API Calls

Retrieving a Single Invitation

The following API call will retrieve a single Invitation by Id.

{brillium_base_uri}/api/Invitations/{invitation_id}

Retrieving a Single Invitation by Code

The following API call will retrieve a single Invitation by Invitation Code.

{brillium_base_uri}/api/Invitations/{invitation_code}/Code

Example – HTTP GET

GET https://supersuds.brillium.com/api/Invitations/11

Example – JSON Response


		{
		  "Invitations": [
			{
			  "Id": 11,
			  "AssessId": "000TEST",
			  "Code": "JFAF22eP",
			  "SourceId": "20110126_Q7FDLW6X~2",
			  "SourceName": "Spreadsheet Import",
			  "Status": "New",
			  "FirstName": "Tom",
			  "LastName": "Jones",
			  "Email": "tjones@email.com",
			  "Custom": [
				"",
				"",
				"",
				"",
				"",
				"",
				"",
				"",
				"",
				"",
				"",
				"",
				"",
				"",
				"",
				"",
				"",
				"",
				"",
				""
			  ],
			  "DateCreated": "2011-01-26T17:15:43-05:00",
			  "DateModified": "2011-01-26T17:16:17-05:00",
			  "Uri": "http:\/\/supersuds.brillium.com\/api\/Invitations\/11",
			  "RelatedUris": null
			}
		  ],
		  "Page": 1,
		  "PageSize": 50,
		  "TotalCount": 1,
		  "HasMore": false
		}

Adding Invitations

The following API call will create one or more Invitations to an Assessment.

{brillium_base_uri}/api/Invitations

Additional Object Properties

Property        TypeDescription
Keys
SendEmailsBooleanA setting of “true” will trigger the sending of the populated invitation email template to all successfully added respondents immediately upon creation of an invitation. A setting of “false” indicates the system will not send emails to newly added respondents.

Example – HTTP POST


	POST https://supersuds.brillium.com/api/Invitations

Example – JSON Request Body

In the example below, two invitations are added to the assessment with an ID of “000TEST”. The data being included for each respondent’s invitation is: first name, last name, email address, and first three Respondent Field values. The Respondent Fields, in this example, represent the Respondent’s employee ID, gender, and tenure respectively.


		{
		  "Invitations": [
			{
			  "AssessId": "000TEST",
			  "FirstName": "Albert",
			  "LastName": "Smythe",
			  "Email": "asmythe@email.com",
			  "Custom": [
				"123456",
				"Male",
				"5-9 years"
			  ]
			},
			{
			  "AssessId": "000TEST",
			  "FirstName": "Janice",
			  "LastName": "Kingston",
			  "Email": "jkingston@email.com",
			  "Custom": [
				"246802",
				"Female",
				"1-4 years"
			  ]
			}
		  ],
		  "SendEmails": true
		}

Example – JSON Response

If the above request is successful, the following response will be returned.


		{
		  "Invitations": [
			{
			  "Id": 463,
			  "AssessId": "000TEST",
			  "Code": "ejJweHE6",
			  "SourceId": "",
			  "SourceName": "API",
			  "Status": "Invited",
			  "FirstName": "Albert",
			  "LastName": "Smythe",
			  "Email": "asmythe@email.com",
			  "Custom": [
				"123456",
				"Male",
				"5-9 years",
				"",
				"",
				"",
				"",
				"",
				"",
				"",
				"",
				"",
				"",
				"",
				"",
				"",
				"",
				"",
				"",
				""
			  ],
			  "DateCreated": "2015-04-09T14:50:43-05:00",
			  "DateModified": "2015-04-09T14:50:43-05:00",
			  "Uri": "http:\/\/supersuds.brillium.com\/api\/Invitations\/463",
			  "RelatedUris": null
			},
			{
			  "Id": 464,
			  "AssessId": "000TEST",
			  "Code": "98dhJEU8",
			  "SourceId": "",
			  "SourceName": "API",
			  "Status": "Invited",
			  "FirstName": "Janice",
			  "LastName": "Kingston",
			  "Email": "jkingston@email.com",
			  "Custom": [
				"246802",
				"Female",
				"1-4 years",
				"",
				"",
				"",
				"",
				"",
				"",
				"",
				"",
				"",
				"",
				"",
				"",
				"",
				"",
				"",
				"",
				""
			  ],
			  "DateCreated": "2015-04-09T14:50:43-05:00",
			  "DateModified": "2015-04-09T14:50:43-05:00",
			  "Uri": "http:\/\/supersuds.brillium.com\/api\/Invitations\/464",
			  "RelatedUris": null
			}
		
		  ],
		  "Page": 1,
		  "PageSize": 50,
		  "TotalCount": 2,
		  "HasMore": false
		}

Example – Accessing API via Javascript & jQuery

The following example API call will return the details of a particular Brillium Workspace (“SUPERSUDS”).


	$.ajax({
	  type: 'GET',
	  url: 'https://supersuds.brillium.com/api/Accounts/SUPERSUDS',
	  beforeSend: function(xhr) {
		xhr.setRequestHeader('Authorization', 'Basic ' +   
		  'U1VQRVJTVURTOnBhc3N3b3JkMTIzYjZlNjBiZmIwODk5NGJlNzllMTdlMzU2NTZlMzI0NmU=');
		xhr.setRequestHeader('Accept', 
		  'application/vnd.ingeniousgroup.testcraftapi-v1+json');
	  },
	  success: function (data) {
		console.log(JSON.stringify(data));
	  },
	  error: function (error) {
		console.log(error[“responseText”]);
	  } 
	});