I’m trying to do a simple post a comment to a story and I can’t get the right response. I’m using php/unirest as in the docs and it looks like I have the correct authentication and headers. I’m not sure what is intended with the Bearer header but I used the token again there too; didn’t appear to change anything.
The only response I see is 415 unsupported media type.
You will notice that the ‘Content-Type’ differs from your implementation. The Bearer header is not applicable, since you have chosen for Basic Auth. So you can remove that header, and replace it with the ‘Authorization’ => 'Basic '.$tokenEncoded header.
Now, given that you have already provided the Authorization header, you do not also have to add
However, because you are receiving a 415 method not allowed and not a 401, it seems like the authentication is not the issue. So my best bet would be the fact that the Content-Type and Accept headers are malformed.
Thank you so much. I haven’t done anything development related in nearly five years and it has been an uphill crawl to get functional again. This was a big help to my sanity.