(solved) "app_id not found" on Rest API

I am testing here the Rest API, but I am always receiving a “app_id not found.” error. I already triple checked my app id and nothing.

Do I have to enable the Rest API in someplace?

Here is the body that I am sending to the Rest API:

{"contents":{"en":"Testing API"},"isAndroid":false,"url":"http://www.google.com","isIos":true,"app\_id":"xxxx-e3a9-xxxxx-97f1-xxxxxx","include\_player\_ids":["yyyyyy-e3af-11e3-8ca3-yyyyy"]} 

ps: xxx and yyy were added by me.

PS: I am trying to debug on http://docs.gamethrive.apiary.io/traffic but no success yet.

Hi Renato.

It looks like your API request is coming in to our system with the body as a string instead of JSON.

It’s possible that you need to add the following header to your request:

Content-Type: application/json

If that doesn’t work, let me know what tool or code you’re using to send the API request.

Yes, I was writing the answer right now here…

I solved by adding the headers[“Content-Type”] = “application/json”

I still didn’t receive the Push but now I remembered that I already updated to Apple Production Push certificate and my phone is with a Development build. I will try to go back the the Dev Certificate and test it.

Thanks George.

Just to add, the mockup traffic tool is giving the false wrong message:

The ‘included\_segments’ property is required. The included\_segments property must be an array (current value is undefined). The ‘included\_segments,0’ property is required. The ‘send\_after’ property is required.

since these fields are not required.

So, I updated my Apple Push certificate back to the Development one and I still don’t receive any more push.

My messages appears on the “Sent Messages” panel as “Queued”.

It was supposed to be working fine right? Or I cannot go back and change the certificate back to the Sandbox one?

Yeah, we’re aware of that issue. Fixing up the API docs is high up on my todo list.

So, I the Rest API was queued all my messages even after I changed back my Apple Push profile to the SandBox.

So, I tagged my phone and send a Push from the website and it worked.  Now the Rest API is also working.

I don’t know if they were all coincidence (the Rest API working only after sent a Push via website after I updated a Push Certificate), so I am leaving here noted just to if other people have this same problem.

Hi Renato.

It looks like your API request is coming in to our system with the body as a string instead of JSON.

It’s possible that you need to add the following header to your request:

Content-Type: application/json

If that doesn’t work, let me know what tool or code you’re using to send the API request.

Yes, I was writing the answer right now here…

I solved by adding the headers[“Content-Type”] = “application/json”

I still didn’t receive the Push but now I remembered that I already updated to Apple Production Push certificate and my phone is with a Development build. I will try to go back the the Dev Certificate and test it.

Thanks George.

Just to add, the mockup traffic tool is giving the false wrong message:

The ‘included\_segments’ property is required. The included\_segments property must be an array (current value is undefined). The ‘included\_segments,0’ property is required. The ‘send\_after’ property is required.

since these fields are not required.

So, I updated my Apple Push certificate back to the Development one and I still don’t receive any more push.

My messages appears on the “Sent Messages” panel as “Queued”.

It was supposed to be working fine right? Or I cannot go back and change the certificate back to the Sandbox one?

Yeah, we’re aware of that issue. Fixing up the API docs is high up on my todo list.

So, I the Rest API was queued all my messages even after I changed back my Apple Push profile to the SandBox.

So, I tagged my phone and send a Push from the website and it worked.  Now the Rest API is also working.

I don’t know if they were all coincidence (the Rest API working only after sent a Push via website after I updated a Push Certificate), so I am leaving here noted just to if other people have this same problem.