Raw requests

Raw requests allow developers to make direct API calls to underlying platforms, bypassing platform App reviews for quicker access. This feature is perfect for testing new features or API endpoints, which are not yet supported by n_2, enabling more flexibility and full access to the underlying platform.

Supported Platforms

The generic /raw endpoint is currently supported for the following platforms:

FacebookGoogleAds

You can find the official API documentation for each platform here:

The following platforms are currently being integrated:

ActiveAgentLinkedInPinterestTikTok

How to use it

To send a raw request, instead of making a request directly to the platform’s API, route it through n_2’s raw endpoint.

Request Format: Use the same format as the underlying platform API for the request:

  • Ensure the method, headers, query parameters, and request body match the request of the underlying platform API, except the credentials.
  • Authentication for the underlying platform: There is no need to send authentication details for the underlying platform. n_2 will handle authentication using the credentials provided by the customer during login. Simply include the customerId in the URL. You can find the customerId at Customers.

Request

METHOD: GET, POST, PUT, DELETE, PATCH
curl -X METHOD \
 "https://api.n2api.io/{platform}/{customerId}/raw/" \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer <access_token>'
  • Authentication for n_2: You must include the access token provided by n_2 in the Authorization header of the request. This token is used to authenticate your request with n_2.
  • Format the request URL as https://api.n2api.io/{platform}/{customerId}/raw/
  • The platform parameter should be replaced with the platform you are targeting: facebook or googleads.

Interactive/raw

A first example

List all Facebook ad accounts

This example requests a list of all ad accounts associated with the authenticated user on the Facebook platform.

Try it
fetch('https://api.n2api.io/facebook/<customerId>/raw/v19.0/me/adaccounts', { method: 'GET' })

List all Google Ads accessible customers

This example requests a list of all accessible customers associated with the authenticated user on the Google Ads platform.

Try it
fetch('https://api.n2api.io/googleads/<customerId>/raw/v18/customers:listAccessibleCustomers', { method: 'GET' })

Response format

The response format of a raw request is the same as the response format of the underlying platform. The response is returned in the responses array, where each element in the array corresponds to a response from the underlying platform API.

Was this page helpful?