HTTP post rejected from SIM900 GSM module

So I have code that pushes data (GPS coordinates) to a bucket, and until recently this code worked perfectly. Thinger.io apparently made some changes at the start of May (new platform release), and the code has since not worked.

Now, this is usually a good indication where to start, changes are made and stuff stops working! I first thought that the API was changed or something, but when trying the request through the postman service using the exact same URL, authorisation token and input data, the data is updated successfully, so apparently the API still works, and I’m left thinking it might be something with my syntax or the way I build the HTTP post request since the error I receive is this: “{“error”:{“message”:“Content-Type must be application/json”}}”?

I’m using an Arduino Leonardo with a SIM900 development board.

The output from the application is as follows (it also outputs the commands pushed to thinger API):

AT

OK
AT+CMGF=1

OK
AT+CNMI=1,2,0,0,0

OK
AT+SAPBR=3,1,"CONTYPE","GPRS"

OK
AT+SAPBR=3,1,"APN","TeleXXX"

OK
AT+SAPBR=1,1

OK
AT+SAPBR=2,1

+SAPBR: 1,1,"46.156.55.XXX"

OK
AT+HTTPINIT

OK
AT+HTTPPARA="CID",1

OK
AT+HTTPPARA="URL","http://backend.thinger.io/v3/users/tom/devices/CT/callback/data?authorization=eyJhbGKLJSDFKLJSsdfsdfsdf.eyJqdGkiOiJEZXZpY2VDYWxsYmFja19DVCIsInVzciI6InRvcm1vZCJ9.AR1gWvIZB9KmtI-5Z12YXKuchPTGn58AkwBJSZQIoxQ"

OK
AT+HTTPPARA="CONTENT","application/json"

OK
AT+HTTPDATA=51,10000

DOWNLOAD
{ "longitude" : 5.336664 , "latitude" : 50.365433 }

OK
AT+HTTPACTION=1

OK

+HTTPACTION:1,400,61
AT+HTTPREAD

+HTTPREAD:61
{"error":{"message":"Content-Type must be application/json"}}

OK
AT+HTTPTERM

OK

Hy @tormod,

I think you have any mistake in the token, can you copy here your access token configuration?

best

Hi @JorgeTrincado,

And thanks for the reply. What mistake are you referring to? I should probably mentioned that I have purposely replaced parts of the access token with random characters, so not to reveal the token publicly. I have attached a screenshot from my device setup callback page.!

I have also replaced the SSL part of the URL (using http and not https) due to the SIM900 module not supporting SSL. Now, I’ve tested the non-SSL URL with postman and it works, so I don’t think that would be a problem either, otherwise I would expect an “authorization failure” reply from the request.

21|689x364

Hy @tormod

always you have problems with authorizations, try creating an ad-hoc access token instead of using the original one that can maybe be replaced by the oauth system.

best

@JorgeTrincado I’ve created a new access token, but it did not improve anything. Taking into account that they both update the bucket through the API using postman (200 - OK returned) I am assuming that the access tokens actually work.

I have seen similar posts regarding the updated API as well, so it looks like I’m not the only one. I tried to change “v3” to “v2” to use the old one, but that returned a “not authorised” reply.