SubizDeveloper Docs
Customers (Users)

API 4.1

Find or create by channel identity

Get the Subiz customer for a Facebook, Zalo, or other channel profile.

POSThttps://api.subiz.com.vn/4.1/accounts/{accid}/contact-profiles/{channel}/sources/{source}/{id}

Use this endpoint when you know a customer’s identity on a channel, such as their Facebook profile on your page, but not their Subiz user ID. It returns the existing customer, or creates one if none exists.

Channel identity

A channel identity has three parts, all in the URL path:

Parameter Type Description
accid (path) string Your account ID.
channel (path) string Channel, such as facebook or zalo.
source (path) string Connected page or account on that channel, such as a Facebook page ID.
id (path) string Customer’s profile ID on that channel.

Use values from your connected integration. Do not put a Subiz user ID in id. There is no request body.

Find without creating

Use GET on the same path to look up a customer without creating one:

GET https://api.subiz.com.vn/4.1/accounts/YOUR_ACCID/contact-profiles/YOUR_CHANNEL/sources/YOUR_SOURCE/YOUR_ID
Authorization: Bearer YOUR_ACCESS_TOKEN

Use POST, shown at the end of this page, to find the customer or create them.

Response

Both methods return HTTP 200 with the customer. Selected fields:

{
  "id": "user_example",
  "account_id": "account_example",
  "channel": "facebook",
  "channel_source": "page_example",
  "profile_id": "profile_example",
  "attributes": [
    {
      "key": "fullname",
      "text": "Alex Example"
    }
  ]
}

Store the Subiz id together with the channel identity. Use the id to get or update the customer.

Subiz may normalize or merge customer identities. If a lookup fails temporarily, retry it rather than creating a separate customer with Create a customer.

Send without resolving first

To message a customer by channel identity, you can skip this step. Send to a customer accepts channel, channel_source, and profile_id directly.

HTTP request

Replace YOUR_ACCID, YOUR_CHANNEL, YOUR_SOURCE, YOUR_ID, and YOUR_ACCESS_TOKEN with your values.

POST https://api.subiz.com.vn/4.1/accounts/YOUR_ACCID/contact-profiles/YOUR_CHANNEL/sources/YOUR_SOURCE/YOUR_ID
Authorization: Bearer YOUR_ACCESS_TOKEN
Content-Type: application/json

{}