ChallengesService
A list of all methods in the ChallengesService
service. Click on the method name to view detailed information about that method.
Methods | Description |
---|---|
Challenge_GetChallengeById | Get an challenge assignment by id. |
Challenge_GetChallengeDefinitionById | Get a challenge definition by id. |
Challenge_GetChallengeDefinitions | Get a list of all the challenge definitions. |
Challenge_GetChallenges | Search for challenges for a contact. |
Challenge_AddChallengeCheckPoints | Send in a list of checkpoints to be assigned to a some challenge for a number of contacts, the endpoint will able to take max 1000 checkpoint rows. ### The following fields should be provided: - definitionId: Must be a Guid - contactId: Must be a Guid - checkPointAmount: Number of checkpoints to assign to the challenge ### Important info: If some rows are not correct it will still result in an accepted response code and be skipped. Please check the response for NotAccepted items |
Challenge_Consent | Will assign the challenge for the contact and return true. If the contact already has been assigned for the challenge it will also return true. |
Challenge_GetChallengeById
Get an challenge assignment by id.
- HTTP Method:
GET
- Endpoint:
/api/v2/challenges/{id}
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | string | ✅ | Assignment id |
Return Type
ChallengeAssignmentModel
Example Usage Code Snippet
import { VoyadoEngage } from 'voyado_engage';
(async () => {
const voyadoEngage = new VoyadoEngage({
token: 'YOUR_TOKEN',
});
const { data } = await voyadoEngage.challenges.challengeGetChallengeById('id');
console.log(data);
})();
Challenge_GetChallengeDefinitionById
Get a challenge definition by id.
- HTTP Method:
GET
- Endpoint:
/api/v2/challenges/definitions/{id}
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | string | ✅ | Definition id |
Return Type
ChallengeDefinitionModel
Example Usage Code Snippet
import { VoyadoEngage } from 'voyado_engage';
(async () => {
const voyadoEngage = new VoyadoEngage({
token: 'YOUR_TOKEN',
});
const { data } = await voyadoEngage.challenges.challengeGetChallengeDefinitionById('id');
console.log(data);
})();
Challenge_GetChallengeDefinitions
Get a list of all the challenge definitions.
- HTTP Method:
GET
- Endpoint:
/api/v2/challenges/definitions
Parameters
Name | Type | Required | Description |
---|---|---|---|
offset | number | ❌ | Defaults to 0 |
count | number | ❌ | Defaults to 100 |
status | ChallengeGetChallengeDefinitionsStatus | ❌ | All, Active, Draft or Ended. If not specified it will default to All |
Return Type
ChallengeDefinitionModelsResult
Example Usage Code Snippet
import { VoyadoEngage } from 'voyado_engage';
(async () => {
const voyadoEngage = new VoyadoEngage({
token: 'YOUR_TOKEN',
});
const status = ChallengeGetChallengeDefinitionsStatus.All;
const { data } = await voyadoEngage.challenges.challengeGetChallengeDefinitions({
offset: 1,
count: 6,
status: status,
});
console.log(data);
})();
Challenge_GetChallenges
Search for challenges for a contact.
- HTTP Method:
GET
- Endpoint:
/api/v2/challenges
Parameters
Name | Type | Required | Description |
---|---|---|---|
contactId | string | ✅ | Contact id |
definitionId | string | ❌ | Definition id - Optional to limit to a certain challenge definition |
offset | number | ❌ | Defaults to 0 |
count | number | ❌ | Defaults to 100 |
filter | ChallengeGetChallengesFilter | ❌ | All, Active, Completed or NotCompleted. If not specified it will default to All |
Return Type
ChallengeAssignmentModelsResult
Example Usage Code Snippet
import { VoyadoEngage } from 'voyado_engage';
(async () => {
const voyadoEngage = new VoyadoEngage({
token: 'YOUR_TOKEN',
});
const filter = ChallengeGetChallengesFilter.All;
const { data } = await voyadoEngage.challenges.challengeGetChallenges({
contactId: 'contactId',
definitionId: 'definitionId',
offset: 7,
count: 4,
filter: filter,
});
console.log(data);
})();
Challenge_AddChallengeCheckPoints
Send in a list of checkpoints to be assigned to a some challenge for a number of contacts, the endpoint will able to take max 1000 checkpoint rows. ### The following fields should be provided: - definitionId: Must be a Guid - contactId: Must be a Guid - checkPointAmount: Number of checkpoints to assign to the challenge ### Important info: If some rows are not correct it will still result in an accepted response code and be skipped. Please check the response for NotAccepted items
- HTTP Method:
POST
- Endpoint:
/api/v2/challenges/checkpoints
Parameters
Name | Type | Required | Description |
---|---|---|---|
body | ChallengeCheckPointDto[] | ✅ | The request body. |
Return Type
AddCheckpointToChallengeAssignmentResult
Example Usage Code Snippet
import { VoyadoEngage } from 'voyado_engage';
(async () => {
const voyadoEngage = new VoyadoEngage({
token: 'YOUR_TOKEN',
});
const { data } = await voyadoEngage.challenges.challengeAddChallengeCheckPoints(input);
console.log(data);
})();
Challenge_Consent
Will assign the challenge for the contact and return true. If the contact already has been assigned for the challenge it will also return true.
- HTTP Method:
POST
- Endpoint:
/api/v2/challenges/definitions/{id}/assign
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | string | ✅ | Definition id |
contactId | string | ✅ | Contact id |
Return Type
boolean
Example Usage Code Snippet
import { VoyadoEngage } from 'voyado_engage';
(async () => {
const voyadoEngage = new VoyadoEngage({
token: 'YOUR_TOKEN',
});
const { data } = await voyadoEngage.challenges.challengeConsent('id', {
contactId: 'contactId',
});
console.log(data);
})();
Build Your Own SDKs with liblab
Build developer friendly SDKs in minutes from your APIs