My use case involves an external content creation system which generates JSON and sends it to GameSparks, where it is processed and stored in MongoDB. I could have the tool call a custom event using the REST API to do the data processing, but without a playerId it fails with an "NOTAUTHORIZED" error. Is it advisable to use Cloud Code events for tasks which don't directly relate to one particular user?
I know I could use the NoSQL REST APIs to do everything externally, but the data processing would be much easier to do in Cloud Code.
Is there a better way to run some custom logic on GameSparks for my use case?
Thanks.
Best Answer
C
Customer Support
said
almost 6 years ago
Hi Jordan,
A callback as suggested above by Jeffwould be a good way to go about this. Have a read through the linked documentation and if you have any further questions just let us know.
Okay. I just found the callbacks tutorial. I have to say that I was surprised to read that callbacks are scripts on GameSparks thatyou can call from an external server. I think that solves my problem though.
J
Jeff Amiel
said
almost 6 years ago
We use the Gamesparks callback functionality to do exactly what you are trying to do..
A callback as suggested above by Jeffwould be a good way to go about this. Have a read through the linked documentation and if you have any further questions just let us know.
Jordan Ephron
My use case involves an external content creation system which generates JSON and sends it to GameSparks, where it is processed and stored in MongoDB. I could have the tool call a custom event using the REST API to do the data processing, but without a playerId it fails with an "NOTAUTHORIZED" error. Is it advisable to use Cloud Code events for tasks which don't directly relate to one particular user?
I know I could use the NoSQL REST APIs to do everything externally, but the data processing would be much easier to do in Cloud Code.
Is there a better way to run some custom logic on GameSparks for my use case?
Thanks.
Hi Jordan,
A callback as suggested above by Jeff would be a good way to go about this. Have a read through the linked documentation and if you have any further questions just let us know.
Regards,
Liam
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstJordan Ephron
Okay. I just found the callbacks tutorial. I have to say that I was surprised to read that callbacks are scripts on GameSparks that you can call from an external server. I think that solves my problem though.
Jeff Amiel
We use the Gamesparks callback functionality to do exactly what you are trying to do..
https://docs.gamesparks.com/tutorials/cloud-code-and-the-test-harness/implementing-external-http-callbacks.html
https://docs.gamesparks.com/tutorials/cloud-code-and-the-test-harness/using-custom-callback-urls.html
1 person likes this
Customer Support
Hi Jordan,
A callback as suggested above by Jeff would be a good way to go about this. Have a read through the linked documentation and if you have any further questions just let us know.
Regards,
Liam
-
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