Developer Forum Equinix Fabric™ APIs Fabric API generate token using client_credentialsClosed
 The Developer Forum is shutting down. Please join the Equinix Community to participate in new discussions.
KK
API User
Friday, January 13, 2023 - 00:46

I am trying to generate token using this method but in Postman:
 

Access Token using grant_type = client_credentials (Recommended).

POST 'https://api.equinix.com/oauth2/v1/token' -H "content-type: application/json" -d '{ "grant_type": "client_credentials", "client_id": "******", "client_secret": "****" }'

I have the body set as specified in the link: https://developer.equinix.com/docs?page=/dev-docs/fabric/overview but when I execute the query I get this error:

{

    "errorDomain": "apps-fqa",

    "errorTitle": "Unable to Process the Request",

    "errorCode": "S1002",

    "developerMessage": "Failed to execute the ExtractVariables: extractjsonparams",

    "errorMessage": "Unable to Process the Request, Please try again later."

}

I have a client-id and client_sercret generated and have tested it with Terraform. What am I missing?

 

Thanks!

AH
API User
Monday, April 17, 2023 - 19:58

I have this problem also.

oauth2/v1 worked since year ago, but there are many updates on the api.

https://developer.equinix.com/catalog/fabricv4 shows only bearer auth without any example on how to get a bearer token.

AH
API User
Monday, April 17, 2023 - 22:28

got it, used wrong credentials

access_token=`curl -s --request POST \
                         --url https://${endpoint_url}/oauth2/v1/token \

                         --header 'accept: application/json' \

                         --header 'content-type: application/json' \

                        --data '{"client_id":"'${client_id}'","client_secret":"'${client_secret}'","grant_type":"client_credentials"}' \

                        | jq -r '.access_token'`

KK
API User
Monday, April 17, 2023 - 23:02

Nice, glad you got this one. Should have replied when I was able to get it working in Postman, few hours later posting this message :-) . 

Used raw rather than json as it is normally in a cli.