Clark Bohs
Hello,
I'm using ID "ws-schwab-dashboard-np" to do a search on groups and I get the error below. Does my ID need permissions added to it?
Thanks!
$ curl --user 'ws-schwab-dashboard-np’ "https://schwab-np.hosted.xmatters.com/api/xm/1/groups?search=ESP Agent Support&fields=name"
{
"code" : 401,
"message" : "Invalid Credentials",
"reason" : "Unauthorized"
}
0
Comments
Please sign in to leave a comment.
Hi Clark, it sounds like it doesn't like your username or password. You need the username and password base-64 encoded to authenticate the request (https://help.xmatters.com/xmapi/index.html#authentication). Some tools let you add the credentials then take care of the formatting and encoding automatically. For others, you might need to add an authentication header with the username and password as the base-64 encoded string username:password. For example, if I use username and password as the credentials, the request would look like this: curl --header Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ= https://mycompany.xmatters.com/api/xm/1/groups etc.
Hey Clark,
As Christine mentioned, this sounds more like an authentication error rather than a permissions error. Authenticating (HTTP 401 error) being more along the lines of we won't let you in the front door, while permissions (HTTP 403 error) are more like we won't let you in that door once you are inside the house.
Also note that curl is pretty helpful and can take the password in the -u parameter like so:
curl -u 'username:password' ....
If you don't add the password, like in your code snippet, curl should prompt you for it, so just make sure you aren't hitting return too many times after submitting the command.
Or if you want to have more fun doing your base64 encoding manually, you can add it as the --header parameter :)
In any case, check that you are entering the password. If you are entering the password, verify it is the right password by attempting to login to the UI with those credentials.
I hope that helps.
Happy Friday!
--- Travis