skip to main content
Hybrid Data Pipeline API reference : Management API : OAuth API for Google Analytics connectivity : OAuth profiles API : Create an OAuth profile
  

Try Now
Create an OAuth profile

Purpose

Creates an OAuth profile that can be associated with a data source for access to Google Analytics.
Note: An administrator can execute this operation on behalf of a user by appending the user query parameter to the request and specifying a user name. See also Managing resources on behalf of users.

URL

https://<myserver>:<port>/api/mgmt/oauthprofiles

Method

POST

URL Parameters

<myserver> is the hostname or IP address of the machine hosting the Hybrid Data Pipeline server for a standalone installation, or the machine hosting the load balancer for a load balancer installation. For a standalone installation, <port> is the port number specified as the Server Access Port during installation. For a load balancer installation, <port> must be either 80 for http or 443 for https. Whenever port 80 or 443 are used, it is not necessary to include the port number in the URL.

Request Payload Parameters

The request takes the following format.

{
"name": "oauth_profile_name",
"oauthAppId": oauth_application_id,
"description": "oauth_profile_description",
"accessToken": "access_token",
"refreshToken": "refresh_token"
}
Parameter
Description
Usage
Valid Values
"name"
The name of the OAuth profile.
Required
The name can contain only alphanumeric characters and the underscore character.
"oauthAppId"
The ID of the OAuth application object.
Required
The automatically generated OAuth application ID.
"description"
A description of the OAuth profile.
Optional
A description provided by the user.
"accessToken"
The access token includes the credential information required to gain access to the Google Analytics API.
Optional
A valid access token.
"refreshToken"
The refresh token is used to generate new access tokens.
Required
A valid refresh token.

Sample Request Payload

{
"name": "Google_User_1",
"oauthAppId": 17,
"description": "OAuth profile 1",
"accessToken": "111c334445e55",
"refreshToken": "222d88899966fa"
}

Sample Server Success Response

Status code: 201
Successful response
{
"id": 33,
"name": "Google_User_1",
"oauthAppId": 17,
"description": "OAuth profile 1",
"accessToken": "111c334445e55",
"refreshToken": "222d88899966fa"
}

Sample Server Failure Response


{
"error": {
"code": "222207710",
"message": {
"lang": "en-US",
"value": "Invalid OAuthProfileId: 1"
}
}
}

Authentication

Basic Authentication using Login ID and Password.

Authorization

The user must have the MgmtAPI (11) and CreateDataSource (1) permissions.