Menu

{"code":1,"message":"Error: Invalid login"}

Jan Birk
2026-03-23
2026-03-23
  • Jan Birk

    Jan Birk - 2026-03-23

    Hi

    I am trying to connect to iTop using REST/Web service but do not have a success. I got an Invalid login. I have tried using username(admin)/password (can login) and tokens. I do not think that it is username/password but maybe some other access stuff somewhere:

    The test call look like this:

    curl -X POST \
      -H "Content-Type: application/json" \
      -H "Authorization: UserToken $token" \
      -d '{
        "operation": "core/get",
        "class": "Change",
        "key": "",
        "output_fields": "id, friendlyname, title, status, description",
        "query": "SELECT Change WHERE status != \"closed\""
      }' \
      "https://itop-site.dk/webservices/rest.php?version=1.3
    

    What am I doing wrong ?

    Thanks :-)

    Best

     
  • Jeffrey Bostoen

    Jeffrey Bostoen - 2026-03-23

    Since you're using a user token, did you also assign the "REST User" profile to this account?

    Where did you see the authorization header format?

    The documentation provides the following example:

    curl --location -g --request POST 'https://localhost/itop/Develop/webservices/rest.php?version=1.3&json_data={
    "operation": "core/get",
    "class": "Person",
    "key": "SELECT Person WHERE email LIKE '\''%.fr'\''",
    "output_fields": "friendlyname, email"
    }' \
    --header 'Auth-Token: YOURTOKEN'
    

    ( Mind that the word "UserToken" is not present )

     
  • Jan Birk

    Jan Birk - 2026-03-23

    Thanks, that was helpful. I have tried a lot and peeked/poked around. My search abilities should be better, because I didn't find a example in the documentation.

    But using your example I am on to it.

    Best and thanks again

    /Jan

     

Log in to post a comment.

MongoDB Logo MongoDB