I’ve setup Postman to replicate what I used to curl manually, but when I run it with Postman I get a 400 Bad Request. If I copy and paste the cURL code snippet that Postman generated into Terminal on macOS, the query succeeds. What is Postman doing different that causes the call to fail?
All requests to Postmark’s API require you to authenticate yourself to the service. In order to do this you must send the correct HTTP header with the correct API token. Postmark has two types of API tokens:
Server Token —X-Postmark-Server-Token Used for requests that require server level privileges. This token can be found from the API Tokens tab under your Postmark server.
Account Token —X-Postmark-Account-Token Used for requests that require account level privileges. This token is only accessible by the account owner, and can be found on the API Tokens tab of your Postmark account.
This is separate from the PM API you have added already.
Also, I can’t find any reference to https://dmarc.postmarkapp.com/records/my in the documentation… Might be worth checking the URL against the available options in the atached documentation;
You’re looking at the docs for the main Postmark product, not their free DMARC service, those docs are here → API Docs | Free DMARC Monitoring from Postmark as posted on my original post
Thanks for the console tip! Didn’t get much insight though? I did save it before hand, and yes, of course I’m using the Postmark key. It works via terminal, just not via Postman. Was hoping to automate some of my tasks.
My initial thoughts is that the problem is still something to do with the headers.
The blurb from the API documentation says it could be malformed JSON although it doesn’t appear that the get request against the /records/my end point request requires a JSON body or any other parameters than the two you’ve included.
Can you try a post request which doesn’t require authentication?
This does require a JSON request in the body. For example…