by Ben A.
I have setup web services and am able to successfully callout to Moodle using Postman using the token as a parameter (ie: .../server.php?wstoken=[mytoken]).
However, I want to pass the token as a header in the request. I'm sure I saw this somewhere in the docs but cannot find it. I've tried various authorisation types in postman, and have also tried adding as a header with a Key of "Authorization", "Token", "wstoken", etc.
The response I get back is:
{
"exception": "moodle_exception",
"errorcode": "invalidtoken",
"message": "Invalid token - token not found"
}
Can anyone help with how to pass the token in the header of a rest callout?
Thanks