0

POST https://api.smtp2go.com/v3/stats/email_summary HTTP/1.1 Host: api.smtp2go.com Content-Type: application/json Connection: close Content-Length: 52

{ "api_key":"api-" }

GETTING response as

400 Bad Request

Bad Request

Your browser sent a request that this server could not understand.


Apache/2.4.10 (Debian) Server at us-api-1.smtp2go.com Port 80
  • This is not related with api key. If it is caused by invalid api key, the response body will show `INVALID_IN_PAYLOAD` error code etc. This is more like issues on: request format / request modified by browser plugin / request modified by browser security policy etc. Could you compare the request sent from browser and sent via Postman? – shaochuancs Apr 16 '17 at 15:26
  • it's the same request that i am sending with my arduino board. Can, it be a problem related to port address of the server? – user3131121 Apr 17 '17 at 04:05
  • I heard some Arduino does not support HTTPS, long time ago. Maybe it is a good idea to check? – shaochuancs Apr 17 '17 at 04:13
  • I tried changing to port 443 but it says you are using plain http text for SSL port. What should I do know? I am sending the same request from different sources like postman and www.codepunker.com and they don't have the same problem as it is occurring with arduino. – user3131121 Apr 17 '17 at 04:32
  • Do you mean you were sending request to `http://api.smtp2go.com/...`? If yes, I think the root cause of your problem is: smtp2go API only support HTTPS. To send HTTPS request, you need client support -- generate public/private key, encode/decode message etc. Just change port from 80 to 443 won't work. – shaochuancs Apr 17 '17 at 04:36
  • I am getting bad request because of Content-Type using Apache 2.4.18 – barrypicker Oct 11 '18 at 18:16

1 Answers1

0

For security reasons, you should not post your API Key publicly. I would recommend removing it from this post. As for your problem, I would recommend that you double check that your API key is active. That could be part of the problem.

If that is not your problem. I'd recommend checking out this site which includes all API error codes. https://kb.insideview.com/hc/en-us/articles/202959833-API-Error-Codes