Data Source API - save | Community
Skip to main content
Level 2
June 22, 2024
Question

Data Source API - save

  • June 22, 2024
  • 1 reply
  • 831 views

Hi,
I am creating a data source using API. I am encountering some error. below is my api assuming client id and access token is correct. Event1 is configured as "Registrations" and eVar1 is configured as "Channel"

 

curl -X POST "https://api.omniture.com/admin/1.4/rest/?method=DataSources.Save" \ -H "x-api-key: xxx" \ -H "Authorization: Bearer xxx" \ -H "Content-Type: application/json" \ -d '{ "id": "1", "reportSuiteID":"xxx", "email": "xxx", "name": "xxx", "processing_type": "generic", "settings": { "allowOutOfOrderHits": true, "stopOnWarning": false, "metricNames": ["Registrations"], "metricEvents": ["Event 1"], "dimensionNames": ["Channel"], "dimensionVariables": ["Evar 1"] } }'

 

 error I am getting : 

Can someone help here metrics name is correct? Am I missing something here?

 

{ "error": "Bad Request", "error_description": "invalid metric in metricEvents, should be a data sources metric or a custom event", "error_uri": null }

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

Jennifer_Dungan
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
June 22, 2024

This might sound silly, but have you tried using:

  • "event1" instead of "Event 1"
  • "evar1" or "eVar1" instead of "Evar 1"

 

I think the "name" fields are probably fine, but the actual metric and dimension references have to match exactly what Adobe is looking for, just like when you are sending data to Adobe via JS, you don't use:

 

s.events = "Event 1";

 

You use:

 

s.events = "event1";
Level 2
July 1, 2024

Thanks, yes I tried this and it worked!