Expand my Community achievements bar.

Join us January 15th for an AMA with Champion Achaia Walton, who will be talking about her article on Event-Based Reporting and Measuring Content Groups!

Classifications Import API v1.4 not working

Avatar

Level 1

Hi,

I'm currently trying to leverage the Classifications API v1.4 (Classifications API | Adobe Developer Connection ) to automate a classification process for our product variables. I followed the steps outlined in the documentation, i.e. I create a import job, populate it with data and then commit the job. However, it's not working and I currently suspect that that's because the population isn't working.

Creation of the upload job:

DEBUG:omniture.account:Error Code None

INFO:omniture.account:Request: Classifications.CreateImport  Parameters: {'rsid_list': ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'], 'element': 'product', 'header': ['Key', 'Product Name'], 'description': 'test', 'email_address': 'xxx@xxx.com', 'check_divisions': 1, 'export_results': 0, 'overwrite_conflicts': 1}

DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.omniture.com

DEBUG:urllib3.connectionpool:https://api.omniture.com:443 "POST /admin/1.4/rest/?method=Classifications.CreateImport HTTP/1.1" 200 None

DEBUG:omniture.account:Response for Classifications.CreateImport:{"job_id":133972381}

DEBUG:omniture.account:Error Code None

Checking the status:

INFO:omniture.account:Request: Classifications.GetStatus  Parameters: {'job_id': 133972381}

DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.omniture.com

DEBUG:urllib3.connectionpool:https://api.omniture.com:443 "POST /admin/1.4/rest/?method=Classifications.GetStatus HTTP/1.1" 200 103

DEBUG:omniture.account:Response for Classifications.GetStatus:[{"id":133972381,"type":"job_id","viewable_pages":0,"status":"Waiting for user data"}]

So far so good. The job was created and awaits data.

Populating the data:

INFO:omniture.account:Request: Classifications.PopulateImport  Parameters: {'job_id': 133972381, 'page': 1, 'rows': [{'row': ['00000', 'a']}, {'row': ['00001', 'b']}, {'row': ['00002', 'c']}, {'row': ['00003', 'd']}, {'row': ['00004', 'e']}, {'row': ['00005', 'f']}, {'row': ['00006', 'g']}, {'row': ['00007', 'h']}, {'row': ['00008', 'i']}, {'row': ['00009', 'j']}]}j']]}

DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.omniture.com

DEBUG:urllib3.connectionpool:https://api.omniture.com:443 "POST /admin/1.4/rest/?method=Classifications.PopulateImport HTTP/1.1" 200 None

DEBUG:omniture.account:Response for Classifications.PopulateImport:true

The response I'm getting from says true which indicates a success.

Checking the status again:

INFO:omniture.account:Request: Classifications.GetStatus  Parameters: {'job_id': 133972381}

DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.omniture.com

DEBUG:urllib3.connectionpool:https://api.omniture.com:443 "POST /admin/1.4/rest/?method=Classifications.GetStatus HTTP/1.1" 200 103

DEBUG:omniture.account:Response for Classifications.GetStatus:[{"id":133972381,"type":"job_id","viewable_pages":0,"status":"Waiting for user data"}]

But as you can see now, the job status still says "viewable_pages": 0. That's very confusing. I tried populating the job nonetheless, but even after some days passed, the classifications don't show up in the interface.

I am accessing the API from Python, but I am facing the same issues when I use the API explorer.

Did anyone of you have similar issues or knows a way to solve it? Any help is appreciated! Thanks so much

2 Replies

Avatar

Community Advisor

just a guess: your data-json from "populating the data" looks strange at the end (some brackets and chars too much). is this just a copy&paste problem or have you checked the "populating data request" with the API Explorer?

Avatar

Level 1

Hi urs.boller. That's just a flaw from copy/pasting the outputs.

However, I was meanwhile able to fix the issue on my own. In fact the "viewable_pages" field doesn't seem to contain any meaningful information after all. First I had a problem that I was using a nested list for the rows parameter whereas it has to be of the format

"rows": [

     {

          "row": [(string)]

     }

]

After I fixed this, I still had the problem with the "viewable_pages" field, but when I actually tried to upload the data it works now.

Sorry for the confusion and nonetheless thanks for your help urs.boller!