Analytics API and oauth authorization | Community
Skip to main content
Level 2
Sep 19, 2018 4:35 PM UTC
Solved

Analytics API and oauth authorization

Hi - I'm trying to start pulling data from the analytics API but am falling at the first hurdle, trying to get an authorization token.

I'm following the instructions here:

analytics-1.4-apis/auth_client_credentials.md at master · AdobeDocs/analytics-1.4-apis · GitHub

However when I submit the request I always get the response "The grant type was not specified in the request"

Any idea what I might be doing wrong?

This is what I'm entering into curl (with a client ID and secret from a recently registered app):

$ curl -i -v "https://api.omniture.com/token" -u 'YOUR_CLIENT_ID:YOUR_CLIENT_SECRET' -d "grant_type=client_credentials"

Thanks

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Andrew_Chepurny
Andrew_ChepurnyAccepted solution
Employee
Sep 21, 2018 11:38 AM UTC

So are you following this method in this order?

Then you can put in your App ID and secret into the curl scripts.

Example Script

Example Application:

Application ID [Your application ID here]

Application Secret [Your application Secret here]

Type Client Credentials

Get token doc example:

curl -i -v "https://api.omniture.com/token" -u '[Application ID]:[Application Secret]' -d "grant_type=client_credentials"

example to get the stream (on a mac from terminal):

curl "[insert stream url here]" --header "Authorization: Bearer [paste token here]" --compressed

Be sure to put your client credentials exactly.  It looks like your call is failing on the first call on the Grant Type.

5 replies

Level 2
Sep 26, 2018 1:23 PM UTC

Hi - thanks for all your help. Looks like it was down to the limitations of the curl tool I was using. I am now able to perform the request.

Translate
Andrew_Chepurny
Andrew_ChepurnyAccepted solution
Employee
Sep 21, 2018 11:38 AM UTC

So are you following this method in this order?

Then you can put in your App ID and secret into the curl scripts.

Example Script

Example Application:

Application ID [Your application ID here]

Application Secret [Your application Secret here]

Type Client Credentials

Get token doc example:

curl -i -v "https://api.omniture.com/token" -u '[Application ID]:[Application Secret]' -d "grant_type=client_credentials"

example to get the stream (on a mac from terminal):

curl "[insert stream url here]" --header "Authorization: Bearer [paste token here]" --compressed

Be sure to put your client credentials exactly.  It looks like your call is failing on the first call on the Grant Type.

Translate
Level 2
Sep 21, 2018 9:06 AM UTC

Unfortunately this doesn't seem to be the solution. I have tested this again with a new application ID & secret that was only a couple of minutes old and got the same response.

Translate
Level 2
Sep 20, 2018 9:37 AM UTC

Ah I was not aware of that It's possible that it was a few hours between it being created and my using it. I'll create a new one and have a go. Thanks for the response.

Translate
Andrew_Chepurny
Employee
Sep 19, 2018 5:03 PM UTC

How recent is your application ID and secret?  They do expire after several hours if they are not used for security purposes.

Translate