Skip to main content

ChallengesService

A list of all methods in the ChallengesService service. Click on the method name to view detailed information about that method.

MethodsDescription
Challenge_GetChallengeByIdGet an challenge assignment by id.
Challenge_GetChallengeDefinitionByIdGet a challenge definition by id.
Challenge_GetChallengeDefinitionsGet a list of all the challenge definitions.
Challenge_GetChallengesSearch for challenges for a contact.
Challenge_AddChallengeCheckPointsSend 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_ConsentWill 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

NameTypeRequiredDescription
idstringAssignment 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

NameTypeRequiredDescription
idstringDefinition 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

NameTypeRequiredDescription
offsetnumberDefaults to 0
countnumberDefaults to 100
statusChallengeGetChallengeDefinitionsStatusAll, 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

NameTypeRequiredDescription
contactIdstringContact id
definitionIdstringDefinition id - Optional to limit to a certain challenge definition
offsetnumberDefaults to 0
countnumberDefaults to 100
filterChallengeGetChallengesFilterAll, 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

NameTypeRequiredDescription
bodyChallengeCheckPointDto[]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);
})();

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

NameTypeRequiredDescription
idstringDefinition id
contactIdstringContact 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

Start for Free →