Using the Data Sources API to create a Google Analytics data source
Once a user has created an OAuth profile, the user can use the Data Sources API to create a Google Analytics data source. The user must have the CreateDataSource (1) permission to create a data source. For example, the following POST operation creates the GoogleAnalytics_Test data source.
POST https://MyServer:8443/api/mgmt/datasources
Example request payload
{
"name": "GoogleAnalytics_Test",
"dataStore": 54,
"description": "DS for testing GA profiles",
"options": {
"OAuthProfileId": "31",
"ODataVersion": "4",
"DefaultQueryOptions": "segmentId=-1;",
"ConfigOptions": "defaultView=Progress - No Filters"
}
}
Example response payload
Status code: 201
Successful response
{
"id": 279,
"name": "GoogleAnalytics_Test",
"dataStore": 54,
"description": "DS for testing GA profiles",
"options": {
"OAuthProfileId": "17",
"ODataVersion": "4",
"AuthenticationCode": "4/ABCDEFGHiJkLMNO_PQRSTu1vWXYZ-ABc2-abC3",
"DefaultQueryOptions": "segmentId=-1;",
"ConfigOptions": "defaultView=Progress - No Filters"
}
}