Sign In Register

How can we help you today?

Start a new topic

Set HTTP response code in callback event

While implementing SEGA's Noah Pass in our game, we found that GameSparks does not seem to currently have the ability to set the HTTP response code of a callback event.


This is necessary for the successful integration of SEGA's Noah Pass (and I am sure other services as well). The SEGA Noah Pass service requires us to respond with codes 403 and 225 under certain conditions.


Since this should be a relatively trivial enhancement to the callback system, I would like to request that it be added. I suggest the following notation:


Spark.setScriptData("HTTP_RESPONSE", 403)


or


Spark.setScriptData("HTTP_RESPONSE", "HTTP/1.0 403 Forbidden")


If this feature is already implemented and I missed it, please let me know, and also follow up with this other thread we found on the topic:

https://support.gamesparks.net/support/discussions/topics/1000079722


Thank you


Hi Mike,


Thanks for the request. I'll run this by the team and see if its suitable as a feature request or there is a workaround that you can use here.


Regards,

Liam

Hi Mike,


Setting the scriptData with Spark.setScriptData("HTTP_RESPONSE", 403) will set the HTTP_RESPONSE response value in the body of the response. I assume here that SEGA Noah Pass doesn't allow you to read data from the response ? It only allows you to use the response code that the callback returns by default. Is that correct ?


Regards,

Liam 

Apologies, but your wording is a little ambiguous to me. However, I believe this is what you're asking:


The SEGA Noah Pass system is not setup to read anything except the HTTP response code. We've also contacted them about a possible workaround, but there is no resolution. Their system expects either an 200 225 or 403 HTTP response code depending on what happens inside the callback, given the information they pass to us. They won't look at the response headers or the response body.


Since gamesparks returns a value of 200 by default, that particular HTTP response code is covered, but the other two are not.

To be very specific, here is the RAW response of our callback (as captured by Postman Canary). I've redacted part of the url:


 

GET /callback/************/NP_Callback/******************/

cache-control: no-cache

user-agent: PostmanRuntime/6.4.1-beta.1

accept: */*

host: preview.gamesparks.net

accept-encoding: gzip, deflate

 

 

HTTP/1.1 200

status: 200

x-gs-lb: lb02

x-gs-server: se08

content-length: 3




What we are talking about in this thread specifically are these two lines:

HTTP/1.1 200

status: 200


Yes this is an issue for us as well. We're using Fyber for rewarded video ads, and for server verification they will hit our callback URL and expect any HTTP response code besides 200 if there was an error processing the callback.


1 person likes this

Hi Guys,


Ok. Thanks for the details. I'll present this to the dev team give you an update early next week.


Regards,

Liam

Hi Guys,


I've added this as a feature request in our backlog. If there is any change to it's status I'll be in touch.


Regards,

Liam


1 person likes this

Any news on this issue? I need to set the http response code myself, as well.

Further more... 

If you throw new Error("Somerror") inside an external callback script, the response body is empty and the status code is (200 OK).


It should return, 500 if we were to follow any standard behavior of restful api's.

"500 Internal Server Error "

"The server encountered an unexpected condition which prevented it from fulfilling the request."


1 person likes this

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

Login to post a comment