Brands are used for personalizing communication on behalf of some other entity/organization.
In SuprSend, Brands are workspace level entity. By default, SuprSend creates a brand with brand_id="default" (representing your organization) in each of your workspaces. You can create more brands using our APIs based on your usecases.
Data structure of Brand:
{
"brand_id": "br-01",
"brand_name": "Awesome Brand",
"logo": "https://ik.imagekit.io/l0quatz6utm/suprsend/staging/media/suprsend-only-logo_c8aa27faef118418e8c5bd7b31a1cafc74e09200.png",
"primary_color": "#ff0000",
"secondary_color": "#00ff00",
"tertiary_color": "#0000ff",
"social_links": {
"website": "https://suprsend.com",
"facebook": "",
"linkedin": "",
"twitter": "",
"instagram": "",
"medium": "",
"discord": "",
"telegram": "",
"youtube": "",
},
"properties": {
"prop1": "value1",
"prop2": "value2"
}
}
Field Description:
brand_id (*mandatory)
brand\_id
can be of max 64 characters. It can contain characters [a-z0-9_-] i.e. alphanumeric characters, _(underscore) and -(hyphen). brand_id
is case-insensitive. Suprsend will first converts brand_id
to lowercase before storing it or doing any sort of comparison on it.
brand_name (*mandatory)
Name of the brand
logo (optional)
url of the brand logo
brand colors viz. primary_color, secondary_color, tertiary_color (optional)
brand colors settings are mainly used while designing templates.
If you don't provide any of the colors for the brand, SuprSend will assume you want to use the default values, so color settings will automatically be set to the color settings of default brand.
social_links: (optional)
urls of social media accounts of the brand
While updating a social link, if you pass its value as null, then SuprSend will ignore it. If you really want to remove the value you must the value="" (instead of null)
e.g. If you want to remove social_link url for facebook, you must pass facebook=""
{
"social_links": {
"facebook": ""
}
}
properties:
Custom properties associated with the brand.
Update operation on properties works like upsert on 1st-level keys (i.e. if top level key doesn't already exists, then it will added, otherwise its value will be replace by new value. All other key-value pair will remain unchanged).
e.g
1st update: {"properties": {"k1": "v1", "k2": 1.0}}
2nd update:{"properties": {"k1": "v2", "k3": {"nested_k": "v"}}}
after these 2 updates, value for properties will be
{ "k1": "v2", "k2": 1.0, "k3": { "nested_k": "v" } }
Upsert (Insert or Update Brand)
You can insert or update brand by making POST request to https://hub.suprsend.com/v1/brand/<brand_id>
with Contest-Type header application/json; charset=utf-8
and Authorization
header by following steps on how to sign requests and by passing brand payload as explained above.
For Example, to update or to insert new brand with brand_id "br-01"
POST https://hub.suprsend.com/v1/brand/br-01/
Content-Type: application/json; charset=utf-8
{
"brand_id": "br-01",
"brand_name": "Awesome Brand",
"logo": "https://ik.imagekit.io/l0quatz6utm/suprsend/staging/media/suprsend-only-logo_c8aa27faef118418e8c5bd7b31a1cafc74e09200.png",
"primary_color": "#ff0000",
"secondary_color": "#00ff00",
"tertiary_color": "#0000ff",
"social_links": {
"website": "https://suprsend.com",
"facebook": "",
"linkedin": "",
"twitter": "",
"instagram": "",
"medium": "",
"discord": "",
"telegram": "",
"youtube": "",
},
"properties": {
"prop1": "value1",
"prop2": "value2"
}
}
Getting brand information
You can make a signed GET request to https://hub.suprsend.com/v1/brand/<brand_id>
to get all details stored with SuprSend associated with the given brand id.
For example to fetch details of brand with brand id br-01
GET https://hub.suprsend.com/v1/brand/br-01/