I want to create an API request in Postman that creates a category in Moodle. The following are the steps which I did in Moodle :
This is my POST URL: http://localhost/test/moodle/webservice/rest/server.php?username=admin&password=Password@1&service=mycustomservice&name=CustomCategory&parent=1&idnumber=CSTM1&description=Desc
Under Authorization tab, I have selected Bearer Token and added the Token from Moodle web service.
When I send the request, I am getting invalidtoken Invalid token - token not found error.
Can anyone please suggest a solution for this
Moodle version: 3.4.8 and Postman version 7.6.0
Thanks in advance.
You can not call API by GET Method. In postman you have to call the API using POST method. pass your token in form-data as wstoken. call your function as wsfunction.