Adobe Analyitics API oAuth does not work.

Avatar

Avatar
Level 1
多田翔14221376
Level 1

Likes

0 likes

Total Posts

1 post

Correct reply

0 solutions
View profile

Avatar
Level 1
多田翔14221376
Level 1

Likes

0 likes

Total Posts

1 post

Correct reply

0 solutions
View profile
多田翔14221376
Level 1

31-05-2018

Hello,

I have a oAuth problem.
The error code is below.

{"message": {"error": "invalid_request", "error_description": "The access token has not been permissioned to access Adobe Analytics"}}

I'm trying to use Adobe Anlytics API on Lambda with phyton.

Program code is below.

import os

import json

import datetime

import requests

import boto3

from boto3.dynamodb.conditions import Key, Attr

dynamodb = boto3.resource('dynamodb')

aa_user = os.environ['aa_user']

aa_secret = os.environ['aa_secret']

aa_rsid = os.environ['aa_rsid']

aa_endpoint = os.environ['aa_endpoint']

aa_reportqueue = os.environ['aa_reportqueue']

aa_tokenurl = os.environ['aa_tokenurl']

#aa_endpoint = https://api4.omniture.com/admin/1.4/rest/

#aa_reportque = ?method=Report.Queue

def lambda_handler(event, context):

    data = {'reportDescription' : {'reportSuiteID':aa_rsid}}

    return {'message':adobe_api(aa_reportqueue,data)}

def adobe_token():

    data = {'grant_type':'client_credentials'}

    token = requests.post(aa_tokenurl,data=data,auth=(aa_user,aa_secret)).json()

    return token['access_token']

def adobe_api(method,data):

    token = adobe_token()

     return requests.post(aa_endpoint+'?method='+method+'&access_token='+token,data=data).json()

Thank you for reading this far. Any information would be greatly appreciated.

Replies

Avatar

Avatar
Coach
Employee
Gigazelle
Employee

Likes

473 likes

Total Posts

1,947 posts

Correct reply

740 solutions
Top badges earned
Coach
Contributor 2
Validate 1
Ignite 80
Ignite 70
View profile

Avatar
Coach
Employee
Gigazelle
Employee

Likes

473 likes

Total Posts

1,947 posts

Correct reply

740 solutions
Top badges earned
Coach
Contributor 2
Validate 1
Ignite 80
Ignite 70
View profile
Gigazelle
Employee

13-11-2018

Have you confirmed that your Analytics account belongs to a permission group that can access the API? Typically the group name is 'Web Services access'.