Sign In Register

How can we help you today?

Start a new topic

setting status code in callbacks

Hi,


I'm implementing webhooks for Facebook Messenger using callbacks. It's working fine, but in some cases I need to return a 403 http status but with which API?


I know that I can return custom reponse with this

Spark.setScriptData("RESPONSE_RAW", somethingCustom);


Is there something similar like:Spark.setScriptData("RESPONSE_STATUS_CODE", 403)?



Hi Christian,


Can you let us know what event you are using in your game for this so we can take a closer look at it for you ?


Thanks,

Liam

No events is used to accomplish this. I'm experimenting with FB messenger chatbot.

So here's what I did:

In facebook:

I configured my facebook app with a webhook to gamespark using an URL with this format https: //{stage}.gamesparks.net/messenger/{apiKey}/{serverSecret}


In GS->Cloud Code->Callbacks I added a callback name "messenger" and added the necessary code to support a basic chatbot. But the implementation requires to return a status code 403 when the validation token is incorrect. How can I do that?

I too would like to be able to set the HTTP status from within a callback script.  Please can you tell me how I can do that?


1 person likes this

One thought I had if GS doesn't support this, is you can create your own WebService seperate from GS and have it wrap GS error codes into HTTP responses.


Drew

Did this get solved, if so, what was the solotion, i'm having a similar issue, where i need to set the http status

I would also like to have update on this issue. Server to server callbacks are very important for securing ad monetization.

Bump! I'd also like to be able to set the HTTP response code.

Login to post a comment