Posted April 1Apr 1 Hello, I'm trying to reply to an existing post in our community as a test, topic linkI have a community that uses the invision platformhttps://forum.casadodesenvolvedor.com.brI created a test topic within ithttps://forum.casadodesenvolvedor.com.br/topic/49348-api-fabiano/I need to respond to this topic via API. I read all the documentation found in the administrator panel and created an API KEY credential, but after several attempts, most of them with "INVALID_ACCESS_TOKEN"I was unable to respond to the topic.I need help. Does anyone have an example or clear documentation on how to perform such communication?I'm trying to do this via Postman, so if anyone could provide a collection that I could import, it would be very helpful.I have already tried using routes endpoints like:https://forum.casadodesenvolvedor.com.br/api/forums/topics/49348/postsandhttps://forum.casadodesenvolvedor.com.br/api/forums/posts/49348I don't know if I'm using the right routes, and I'm most likely configuring the credential incorrectly.I have also reviewed the credential permissions, which are all allowed to work with posts, topics, and forums.
April 1Apr 1 Community Expert How are you sending the data through the API? In JSON format, perhaps? 🤔Post the request you're using as a starting point.
April 2Apr 2 Author endpoint: https://forum.casadodesenvolvedor.com.br/api/forums/topics/49345/posts{ "author": 0, "author_name": "Fabiano", "post": "<p>teste do fabiano</p>" }Header:Authorization: "ApiKey *********************"Content-Type: application/json
April 2Apr 2 I would very much advise on not using the API to programmatically alter, add, or remove data from your site, unless you are 100% sure on what you are doing there, and have fully read the documentation. You can break your site in all manner of ways by using the wrong endpoints to do the wrong things. In the case of what you are doing here. Your issues that I can see off hand areAuthorisationIs you are using postman, use Basic Authentication as the authorization type (you should add these in the authorization section, not the Headers section). Body dataYou also should be sending your content as form encoded, not as raw json. EndpointYou mention you are looking to add a post to an exiting topic. The endpoint you are using will not do that. That endpoint accepts only GET requests, and returns he posts from a given topic. You should be using the forums/posts enpoint to add new posts, which is described herehttps://invisioncommunity.com/developers/rest-api?endpoint=forums/posts/POSTindex
April 2Apr 2 Author changed from json to form, and changed the endpointstill with the same problemI didn't find clear documentation on how to do authentication, my basic authentication is with two factors, and I believe that this doesn't work via API, since in the platform's own admin, I create an API KEY for this specifically
April 2Apr 2 You need to go through and re-read the post I did above, and correct your authorisation. Its "Basic" you need to use. You add your key into the username field (nothing in the password field)
April 2Apr 2 Community Expert All IPS endpoints don't accept data in a JSON format: https://invisioncommunity.com/developers/rest-apiParametersFor all GET requests, provide parameters in the query string. For PUT and POST requests, all parameters should be sent Form URL Encoded in the body.