HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

How to POST discussion using curl apiv2


I installed OpenSource Vanilla 3.2 and tried GET method to retrieve discussion using api v2. It works perfectly.

curl http://<localhost>/index.php?p=/api/v2/discussions

whereas POST method is failing.

curl -X POST -d @discussion.json -H  "accept: application/json" -H  "Content-Type: application/json" -H "x-transient-key: va.97oEsAkj35XlbjCcs6svM7H-lxTlNc6S.lCyEcg.uSVzdRr" http://<localhost>/index.php?p=/api/v2/discussions


  "message": "Invalid CSRF token. Please try again.",

  "status": 403,

  "msg": "Invalid CSRF token. Please try again.",

  "code": 403,

  "except": [],

  "type": "!csrf",

  "description": null


looking for example how to POST discussion via command like { curl , python requests} to vanilla.

Thanks in Advance.




Sign In or Register to comment.