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
ChallengeGetChallengeByIdAsyncGet an challenge assignment by id.
ChallengeGetChallengeDefinitionByIdAsyncGet a challenge definition by id.
ChallengeGetChallengeDefinitionsAsyncGet a list of all the challenge definitions.
ChallengeGetChallengesAsyncSearch for challenges for a contact.
ChallengeAddChallengeCheckPointsAsyncSend 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
ChallengeConsentAsyncWill assign the challenge for the contact and return true. If the contact already has been assigned for the challenge it will also return true.

ChallengeGetChallengeByIdAsync

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

using VoyadoEngage;

var client = new VoyadoEngageClient();

var response = await client.Challenges.ChallengeGetChallengeByIdAsync("id");

Console.WriteLine(response);

ChallengeGetChallengeDefinitionByIdAsync

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

using VoyadoEngage;

var client = new VoyadoEngageClient();

var response = await client.Challenges.ChallengeGetChallengeDefinitionByIdAsync("id");

Console.WriteLine(response);

ChallengeGetChallengeDefinitionsAsync

Get a list of all the challenge definitions.

  • HTTP Method: GET
  • Endpoint: /api/v2/challenges/definitions

Parameters

NameTypeRequiredDescription
offsetlongDefaults to 0
countlongDefaults to 100
statusChallengeGetChallengeDefinitionsStatusAll, Active, Draft or Ended. If not specified it will default to All

Return Type

ChallengeDefinitionModelsResult

Example Usage Code Snippet

using VoyadoEngage;
using VoyadoEngage.Models;

var client = new VoyadoEngageClient();

var response = await client.Challenges.ChallengeGetChallengeDefinitionsAsync(2, 1, ChallengeGetChallengeDefinitionsStatus.All);

Console.WriteLine(response);

ChallengeGetChallengesAsync

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
offsetlongDefaults to 0
countlongDefaults to 100
filterChallengeGetChallengesFilterAll, Active, Completed or NotCompleted. If not specified it will default to All

Return Type

ChallengeAssignmentModelsResult

Example Usage Code Snippet

using VoyadoEngage;
using VoyadoEngage.Models;

var client = new VoyadoEngageClient();

var response = await client.Challenges.ChallengeGetChallengesAsync("contactId", "definitionId", 3, 1, ChallengeGetChallengesFilter.All);

Console.WriteLine(response);

ChallengeAddChallengeCheckPointsAsync

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
inputList<ChallengeCheckPointDto>The request body.

Return Type

AddCheckpointToChallengeAssignmentResult

Example Usage Code Snippet

using VoyadoEngage;
using VoyadoEngage.Models;

var client = new VoyadoEngageClient();

var inputItem = new ChallengeCheckPointDto();
var input = new List<ChallengeCheckPointDto>() { inputItem };

var response = await client.Challenges.ChallengeAddChallengeCheckPointsAsync(input);

Console.WriteLine(response);

ChallengeConsentAsync

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

bool

Example Usage Code Snippet

using VoyadoEngage;

var client = new VoyadoEngageClient();

var response = await client.Challenges.ChallengeConsentAsync("id", "contactId");

Console.WriteLine(response);

Build Your Own SDKs with  liblab

Build developer friendly SDKs in minutes from your APIs

Start for Free →