Help with API V2
I am trying to use the V2 API to create categories and discussions on Vanilla. I have set up a local (dev) space as a sandbox. Once I have a proof of concept build I plan to move it to production which is on the hosted (paid) plan.
After going through all of the help articles I have not been able to find an article or set of articles that I can use to consume the V2 API. I am looking for the following:
- Authentication: Based on what I have read, I think all that is needed is for me to use a personal access token and include that in the header of each API request along with the Authorization: Bearer <token>". I tried this but keep receiving an error saying I need to authenticate into the site. I am looking for some sample code (nodeJs, PHP, or even curl) that would show how I authenticate.
Here is what I was doing:
curl -G -H "Authorization: Bearer vva.VoACpIVzcvh_ptjZ40cxxxxxxxxxxxxxxx" -H "Accept: application/json" "http://localhost/vanilla/index.php?p=/api/v2/discussions"
This is the response I keep getting:
"message": "You must sign in to the private community.",
"msg": "You must sign in to the private community.",