Create Illuminate resources for your customers

This guide shows you how to set up customer records in PubNub, assign keysets to them, and create Illuminate resources on their behalf from the Admin Portal.

If you have not completed the one-time account setup (enabling the partner feature), do that first. See For partners for an overview of how the integration works.

Before you start​

Before starting, confirm you have:

  • A PubNub account with access to the Admin Portal.
  • The partner feature enabled on your account. Contact PubNub Support or your account executive to enable it if it is not already active.
  • Your PubNub account ID. Find it in the Admin Portal under your account settings.
  • If you plan to use the API: an x-session-token. Generate one:
1curl --location --request POST 'https://admin.pubnub.com/api/me' \
2--header 'Content-Type: application/json' \
3--data-raw '{
4 "email": "'$LOGIN'",
5 "password": "'$PASSWORD'"
6}'

The response includes a session token. Use it as the x-session-token header in all API calls below.

For the complete list of partner API operations, including keyset generation and customer listing, see API operations for partners.

Create a customer record​

Create a record for each end customer before assigning keysets or creating Illuminate resources for them.

Use the Partner Portal​

  1. Sign in to the Admin Portal and go to Partner Portal > Customers.
  2. Create a new customer. Provide the customer name and a customer ID. The customer ID is your unique identifier for this customer. A customer's external ID cannot be changed after you save the customer record.
  3. Save the customer.

Use the API​

1curl -X POST "https://admin.pubnub.com/api/oem/customers" \
2 -H "Content-Type: application/json" \
3 -H "x-session-token: <portal-session-token>" \
4 -d '{
5 "externalId": "<customer-unique-id>",
6 "name": "<customer-name>",
7 "accountId": <your-PubNub-account-id>
8 }'

Creating a customer that already exists returns 400 Bad Request with the message partner customer unique constraint violated.

Assign keysets to a customer​

Assign at least one keyset to a customer before creating Illuminate resources for them. One keyset can only be assigned to one customer. A PubNub partner customer can have up to five keysets assigned to it.

Use the Partner Portal​

  1. In the Partner Portal Customers section, open the customer record.
  2. Assign one or more keysets to the customer.

Use the API​

To assign keysets, you need the PubNub-generated customer ID (not your external ID). Retrieve it:

1curl -X GET "https://admin.pubnub.com/api/oem/customers?accountId=<your-PubNub-account-id>" \
2 -H "x-session-token: <portal-session-token>"

The response includes an id field for each customer. Use that ID to assign keysets.

If you do not yet have a keyset to assign, create one first. Call POST /api/keys to generate a new keyset and get its numeric ID. See Generate a keyset in the API reference for the full request. The response returns the keyset's id. Use that value as keysetId1 below.

1curl -X POST "https://admin.pubnub.com/api/oem/customers/<PubNub-customer-id>/keysets" \
2 -H "Content-Type: application/json" \
3 -H "x-session-token: <portal-session-token>" \
4 -d '{
5 "keysetIds": [<keysetId1>, <keysetId2>],
6 "accountId": <your-PubNub-account-id>
7 }'

Assigning a keyset that's already assigned to another customer returns 500 Internal Server Error.

Create Illuminate resources for a customer​

Once a customer has a keyset assigned, you can create Business Objects, Decisions, and Dashboards for them from the Admin Portal.

  1. Sign in to the Admin Portal and open the Illuminate section.

  2. Use the partner drop-down to select the customer you are working on.

    The drop-down options are your company name (for your own resources), a specific customer name, all customers, or all internal and customers combined.

  3. Create Business Objects, Decisions, and Dashboards for this customer following the standard steps. All resources you create are scoped to the selected customer.

The Customer column in each section identifies whether a resource belongs to a customer or to your organization.

For step-by-step creation instructions, see:

Troubleshoot​

Customer not visible in the drop-down. Create the customer in the Partner Portal and assign a keyset to them, then reload the drop-down.

No apps or keysets visible after selecting a customer. Assign keysets to this customer in the Partner Portal.

Was this page useful?

Last updated on