Referral
This function is used to manage referral actions. It can handle activation of referral codes and validate sessions.
URL:
https://api.idosgames.com/api/[titleTemplateId]/[titleId]/Client/Referral/[action]
Method:
GET
or POST
Request Parameters:
titleId
(string): Title ID of the application.titleTemplateId
(string): Template ID of the title.action
(string): The specific referral action to perform.HttpRequest req
: HTTP request object containing the body with the following JSON structure:
{
"WebAppLink": "string",
"UsageTime": "int",
"FunctionParameter": {
"ReferralCode": "string"
},
"UserID": "string",
"ClientSessionTicket": "string",
"EntityToken": "string"
}
ActivateReferralCode
Activates a referral code provided by another user.
URL:
https://api.idosgames.com/api/[titleTemplateId]/[titleId]/Client/Referral/ActivateReferralCode
Method:
POST
Request Parameters (JSON body):
FunctionParameters
:ReferralCode
(string): The referral code to be activated.
Responses:
200 OK: Referral code successfully activated. Returns a success message:
REFERRAL_MESSAGE_CODE_SUCCESS_ACTIVATED
400 Bad Request: Incorrect referral code, or activation issues. Possible messages:
args or refferalCode is null
INCORRECT_TITLE_ID_OR_STATUS_INACTIVE
REFERRAL_MESSAGE_CODE_YOUR
REFERRAL_MESSAGE_CODE_INCORRECT
REFERRAL_MESSAGE_CODE_ALREADY_ACTIVATED
Example Usage:
Request:
fetch('https://api.idosgames.com/api/[titleTemplateId]/[titleId]/Client/Referral/ActivateReferralCode', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
"FunctionParameter": {
"ReferralCode": "ABC123"
}
})
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
Response:
{
"Message": "REFERRAL_MESSAGE_CODE_SUCCESS_ACTIVATED"
}
Last updated
Was this helpful?