Customer accounts
To represent your app's customers in n_2 and connect their ad accounts, you must create a customer account for each one.
This account acts as the central entity for managing their ad accounts and making API calls on their behalf.
Your customers can be managed in the Customers section of the control panel.
API Reference
The Customers API allows you to create, retrieve, update, and delete customer entities.
It provides a centralized way to manage the relationship between your app’s users and their advertising accounts across multiple platforms.
Refer to the API reference for customers for a complete list of methods and parameters.
The Customer Model
A Customer in n_2 represents a client who can connect to multiple advertising platforms.
Each customer account is represented as:
Properties
- Name
id- Type
- string
- Description
Unique identifier (UUID) for the customer.
- Name
created-at- Type
- string
- Description
Timestamp indicating when the customer was created.
- Name
name- Type
- string
- Description
Name of the customer, e.g., "John Doe".
- Name
company- Type
- string
- Description
Identifier of the company that owns this customer.
Example Object
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"created-at": "2024-01-01T12:00:00Z",
"name": "John Doe",
"company": "11111111-1111-1111-1111-111111111111"
}
A first example
Example: Retrieve All Customers
This example shows how to retrieve all customers associated with your account.
fetch('https://api.n2api.io/customers', {
method: 'GET', headers: {"accept":"application/json"}
})
Example: Retrieve Customers and their Platform Connections
This example retrieves all customers along with their connected platforms.
fetch('https://api.n2api.io/customers/platforms', {
method: 'GET', headers: {"accept":"application/json"}
})
Example: Retrieve a Single Customer by the Customer Id
Retrieve details for a specific customer using their unique id.
fetch('https://api.n2api.io/customers/<customer_id>', {
method: 'GET', headers: {"accept":"application/json"}
})