Hello, just trying to follow some instructions how to add a friend. And failed with the following request:
var response = Spark.sendRequestAs({
"@class": ".CreateChallengeRequest",
"challengeMessage": "Hey, lets to be friends!",
"challengeShortCode": "FriendsRequestChallenge",
"endTime": "2018-12-31T12:00Z",
"usersToChallenge": candidateId
}, candidateId);
As a response, i'm getting the following line:
{"@class":".CreateChallengeResponse","error":{"usersToChallenge":"REQUIRED"}}
Not sure what i'm doing wrong. The candidateId is a real existing playerID. Please, help.
Hi Old Scheme
If looks like you are trying to send the challenge as the user you are also trying to challenge.
An example of this in cloud code is
var request = new SparkRequests.CreateChallengeRequest()
request.challengeMessage = "Hey, lets to be friends!",
request.challengeShortCode = "FriendsRequestChallenge",
request.endTime = "2018-12-31T12:00Z",
request.usersToChallenge = candidateId;
var response = request.Execute();
Regards
Katie
Old Scheme
Hello, just trying to follow some instructions how to add a friend. And failed with the following request:
var response = Spark.sendRequestAs({
"@class": ".CreateChallengeRequest",
"challengeMessage": "Hey, lets to be friends!",
"challengeShortCode": "FriendsRequestChallenge",
"endTime": "2018-12-31T12:00Z",
"usersToChallenge": candidateId
}, candidateId);
As a response, i'm getting the following line:
{"@class":".CreateChallengeResponse","error":{"usersToChallenge":"REQUIRED"}}
Not sure what i'm doing wrong. The candidateId is a real existing playerID. Please, help.
Hi Old Scheme
If looks like you are trying to send the challenge as the user you are also trying to challenge.
An example of this in cloud code is
var request = new SparkRequests.CreateChallengeRequest()
request.challengeMessage = "Hey, lets to be friends!",
request.challengeShortCode = "FriendsRequestChallenge",
request.endTime = "2018-12-31T12:00Z",
request.usersToChallenge = candidateId;
var response = request.Execute();
Regards
Katie
Customer Support
Hi Old Scheme
If looks like you are trying to send the challenge as the user you are also trying to challenge.
An example of this in cloud code is
var request = new SparkRequests.CreateChallengeRequest()
request.challengeMessage = "Hey, lets to be friends!",
request.challengeShortCode = "FriendsRequestChallenge",
request.endTime = "2018-12-31T12:00Z",
request.usersToChallenge = candidateId;
var response = request.Execute();
Regards
Katie
-
Documentation Notes
-
Design issues with user events
-
Using NoSQL
-
Runtime Collections vs Metadata Collections
-
Anonymous authentication from browser app
-
Modules
-
Movement With Unity
-
Problem with url parameters for downloadables
-
Querying NoSql GameSparks database
-
Challenge accesType
See all 2487 topics