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_get_challenge_by_idGet an challenge assignment by id.
challenge_get_challenge_definition_by_idGet a challenge definition by id.
challenge_get_challenge_definitionsGet a list of all the challenge definitions.
challenge_get_challengesSearch for challenges for a contact.
challenge_add_challenge_check_pointsSend 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_get_challenge_by_id

Get an challenge assignment by id.

  • HTTP Method: GET
  • Endpoint: /api/v2/challenges/{id}

Parameters

NameTypeRequiredDescription
id_strAssignment id

Return Type

ChallengeAssignmentModel

Example Usage Code Snippet

from voyado_engage import VoyadoEngage, Environment

sdk = VoyadoEngage(
access_token="YOUR_ACCESS_TOKEN",
base_url=Environment.DEFAULT.value
)

result = sdk.challenges.challenge_get_challenge_by_id(id_="id")

print(result)

challenge_get_challenge_definition_by_id

Get a challenge definition by id.

  • HTTP Method: GET
  • Endpoint: /api/v2/challenges/definitions/{id}

Parameters

NameTypeRequiredDescription
id_strDefinition id

Return Type

ChallengeDefinitionModel

Example Usage Code Snippet

from voyado_engage import VoyadoEngage, Environment

sdk = VoyadoEngage(
access_token="YOUR_ACCESS_TOKEN",
base_url=Environment.DEFAULT.value
)

result = sdk.challenges.challenge_get_challenge_definition_by_id(id_="id")

print(result)

challenge_get_challenge_definitions

Get a list of all the challenge definitions.

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

Parameters

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

Return Type

ChallengeDefinitionModelsResult

Example Usage Code Snippet

from voyado_engage import VoyadoEngage, Environment
from voyado_engage.models import ChallengeGetChallengeDefinitionsStatus

sdk = VoyadoEngage(
access_token="YOUR_ACCESS_TOKEN",
base_url=Environment.DEFAULT.value
)

result = sdk.challenges.challenge_get_challenge_definitions(
offset=2,
count=1,
status="All"
)

print(result)

challenge_get_challenges

Search for challenges for a contact.

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

Parameters

NameTypeRequiredDescription
contact_idstrContact id
definition_idstrDefinition id - Optional to limit to a certain challenge definition
offsetintDefaults to 0
countintDefaults to 100
filterChallengeGetChallengesFilterAll, Active, Completed or NotCompleted. If not specified it will default to All

Return Type

ChallengeAssignmentModelsResult

Example Usage Code Snippet

from voyado_engage import VoyadoEngage, Environment
from voyado_engage.models import ChallengeGetChallengesFilter

sdk = VoyadoEngage(
access_token="YOUR_ACCESS_TOKEN",
base_url=Environment.DEFAULT.value
)

result = sdk.challenges.challenge_get_challenges(
contact_id="contactId",
definition_id="definitionId",
offset=3,
count=1,
filter="All"
)

print(result)

challenge_add_challenge_check_points

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
request_bodyList[ChallengeCheckPointDto]The request body.

Return Type

AddCheckpointToChallengeAssignmentResult

Example Usage Code Snippet

from voyado_engage import VoyadoEngage, Environment

sdk = VoyadoEngage(
access_token="YOUR_ACCESS_TOKEN",
base_url=Environment.DEFAULT.value
)

request_body = [
{
"definition_id": "00000000-0000-0000-0000-000000000000",
"contact_id": "00000000-0000-0000-0000-000000000000",
"checkpoint_amount": 2
}
]

result = sdk.challenges.challenge_add_challenge_check_points(request_body=request_body)

print(result)

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
id_strDefinition id
contact_idstrContact id

Return Type

bool

Example Usage Code Snippet

from voyado_engage import VoyadoEngage, Environment

sdk = VoyadoEngage(
access_token="YOUR_ACCESS_TOKEN",
base_url=Environment.DEFAULT.value
)

result = sdk.challenges.challenge_consent(
id_="id",
contact_id="contactId"
)

print(result)

Build Your Own SDKs with  liblab

Build developer friendly SDKs in minutes from your APIs

Start for Free →