Searching for Groups via REST - Unauthorized

Comments

2 comments
Date Votes

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.

    0
  • 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

    0

Didn't find what you were looking for?

New post