This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TI-API: Getting error while trying authenticate in OAuth 2

Part Number: TI-API

Hi i am trying to login to ti api using insomnia , i have provided my mail id in client id and password in client secret, but i am getting invalid credential error.

I have pasted the error here.

Request to check into this error and provide support for the same.

{
    "errors": [
        {
            "errorCode": "TI-API-0401",
            "type": "Security",
            "reason": "Invalid Credentials",
            "message": "Invalid bearer token. Please contact your local IT support to verify authentication information. Once resolved, please resubmit request."
        }
    ]
}

Thank you

  • Suresh,

    A few things to confirm:

    1.  Confirm that you are using your v2 credentials (not v1);  You can not use the v2 APIs with v1 credentials

    2. If you are using your v2 credentials with the v2 APIs:

      You may be sending your credentials as a JSON payload, while the API is expecting Form URL-encoded data.

    Details on the authentication requirements can be found at https://api-portal.ti.com/order-api-authentication

    For reference, the body in a sample Insomnia request would look like the following:

    And the header should contain:

    Some additional information:

    • The URL to generate token is https://transact.ti.com/v1/oauth/accesstoken
    • When you pass in “form-urlencoded” payload it should be in this format:
      "grant_type=client_credentials&client_id=<your key>&client_secret=<your secret>"

    Below is the full curl command that you can use to generate the oAuth token:

       curl --request POST \
           --url transact.ti.com/.../accesstoken \   
           --header 'Content-Type: application/x-www-form-urlencoded' \   
           --data grant_type=client_credentials \   
           --data client_id=<your key> \   
           --data client_secret=<your secret>

    If you continue to see the issue, please provide an example of the request you're sending (please without the key and secret).

**Attention** This is a public forum