Legacy Data Integration API Reference (1.0.0) - OAuth2Connections
Oauth2 process initiation. In order to support OAuth2 connections, In order to create new connections OAuth2 method, there's a need to create OAuth2 request to the provider, and then get the credentials by callback. The OAuth2 response will provide a credentials response that will be pass to the connection used an OAuth2 request in the credentials key. In order to determine the OAuth2 connections in Data Integration, find the oauth=true segmentation in the connection type.
OAuth2 New Credentials Requst
Initiating new OAuth2 process using Data Integration.
The request will provide an external link of auth_uri, that can be hit externally to the API (using any web browser). After the process will end in the provider side, Data Integration will get a callback request from the OAuth2 provider, and Data Integration will continue the process.
In order to get the OAuth2 process response, please continue to /oauth2/credentials.
- scope:
connection:edit
Authorizations:
Request Body schema: application/json
Ask for new OAuth2 process from Data Integration. The request includes a datasource_type in the body.
| datasource_id | string A valid datasource id in Data Integration. |
| validity_duration | integer [ 300 .. 43200 ] The maximum time in seconds, the auth_uri and pull_id are valid. maximum = 12 hours (43200 seconds). An invalid time will return 429 (invalid param) status code. |
Responses
Response Schema: application/json
| auth_uri | string The auth uri provided from the OAuth2 request. |
| pull_id | string <token> An hashed pull id that attach the auth uri and the correct response from the OAuth2 provider, in order to make sure the OAuth2 provider is the callback sender. |
Request samples
- Payload
- cURL
- Python
{- "datasource_id": "fb",
- "validity_duration": 300
}Response samples
- 200
- 402
- 403
- 429
{- "pull_id": "Xkoaopdlkmcpoasposam321-9231kd-054kmam,.adslwqirdHA0-NFKDKLAnlka...",
}OAuth2 Get Credentials
Getting the results of the Oauth2 process request.
- scope:
connection:edit
Authorizations:
Request Body schema: application/json
| auth_uri | string The auth uri provided from the OAuth2 request. |
| pull_id | string <token> An hashed pull id that attach the auth uri and the correct response from the OAuth2 provider, in order to make sure the OAuth2 provider is the callback sender. |
Responses
Request samples
- Payload
- cURL
- Python
{- "pull_id": "eyJhbGciOiJIUzI1NiIsImV4cCI6MTUwMjM3OTk3NywiaWF0IjoxNTAyMzc5Mz....",
}Response samples
- 200
- 402
- 403
{- "access_token": "Sksosa43ma904mnfnmaklasioewjns.akjsadiuewq",
- "message": "Facebook Ads Connected Successfully",
- "userId": 12847564034,
- "status": 200,
- "clientId": 194785639383273120
}