# Direct API

## Aurinko /direct API

The Aurinko /direct API endpoint enables applications to request native provider payloads directly, leveraging Aurinko's OAuth Flow and secure access token storage. It is a valuable alternative to data unification, offering flexibility and control for complex integrations while still benefiting from Aurinko's core security and authentication features.

**The Aurinko /direct API offers significant advantages in specific scenarios:**

* **Circumventing Data Unification:** When data unification isn't necessary or feasible (due to complexity or specific integration requirements), the /direct API allows for direct interaction with the provider's native API. This provides the flexibility needed for intricate or unique integrations.
* **Debugging and Troubleshooting:** The /direct API serves as an invaluable tool for debugging and troubleshooting. By directly interacting with the provider's API within the context of Aurinko's authentication framework, developers can isolate and pinpoint issues related to specific API calls or provider responses.
* **Leveraging Aurinko's Authentication:** While bypassing data unification, the /direct API still leverages Aurinko's robust authentication and authorization mechanisms. This ensures secure and controlled access to provider APIs, maintaining a consistent security posture across all integrations.

### **Examples**

#### **Gmail API**

Get a list of Gmail messages for a Gmail Aurinko account:

```bash
curl -X GET -H 'Authorization: Bearer <access token>'
    -G https://api.aurinko.io/v1/direct/gmail/v1/users/me/messages
```

/gmail/v1/users/me/messages is the path of the [Gmail API endpoint](https://developers.google.com/gmail/api/reference/rest/v1/users.messages/list).

#### **Graph API**

Geta list of Office 365 messages for an Office 365 Aurinko account:

```bash
curl -X GET -H 'Authorization: Bearer <access token>'
    -G https://api.aurinko.io/v1/direct/me/messages
```

/me/messages is the path of the [Graph API endpoint](https://learn.microsoft.com/en-us/graph/api/user-list-messages?view=graph-rest-1.0\&tabs=http#http-request).\
\
**Salesforce API**

Get a description of a Salesforce Contact object for a Salesforce Aurinko account:

```bash
curl -X GET -H 'Authorization: Bearer <access token>'
    -G https://api.aurinko.io/v1/direct/services/data/v51.0/sobjects/Contact/describe/
```

/sobjects/Contact/describe/ is the path of the [Salesforce API endpoint](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_sobject_describe.htm).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.aurinko.io/unified-apis/direct-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
