White-label API

Introduction

CARV's white-label APIs allow you to seamlessly integrate powerful features of CARV onto your sites while maintaining complete control over the user experience and branding. As CARV handles all the work on the backend, various APIs are readily provided to ensure smooth integration.

Features supported include user profile display, third-party account connection, campaign display and campaign NFT minting.

Getting Started

Contact CARV team via infra@carv.io to get an app ID issued to your organization. All your requests to the APIs must include the following headers:

Header NameHeader ValueExample Value

x-app-id

(String) app ID

carv

authorization

(String) user authentication token

7fcbe971-3fae-5988-946b-c25afae3a9b9

API Specifications

Get user token

Pass user identities to CARV to obtain authorization token, such that 3rd platforms could invoke carv authorized APIs. Note that this API is intend to be used by client servers rather than browsers, a user's old authorization token will be invalidated after a new one is generated.

POST https://api.carv.io/auth/token

Headers

NameTypeDescription

x-app-id*

String

Client app ID issued by CARV

x-app-request-time*

String

Millisecond timestamp when client sends the request, CARV only accept requests within 10s of this time.

x-app-request-id*

String

Client request ID, must be unique within 30s.

x-app-request-hmac*

String

Sha256-Hmac in hex format of combined string which is composed of request id, request time and & client API key. Python sample code: client_api_key = 'test_api_key' x_app_request_time = 1677034721554 x_app_request_id='c36212d5-9fc8-41d7-bd34-f7503d7abfe0' data_2_hash = f"{x_app_request_id}&{x_app_request_time}" hmac_val = hmac.new(client_api_key.encode('utf-8'), data_2_hash.encode('utf-8'), hashlib.sha256).hexdigest() // hmac_val = 837a35814c6848a7fc39ae0d76040112e593da109412f1adb415e73a72041489 // hmac_val = 837a35814c6848a7fc39ae0d76040112e593da109412f1adb415e73a72041489

Request Body

NameTypeDescription

platform_user_id*

String

user ID on client's platform.

identities*

Array of objects

user identity type and value

raw_user_data*

Object

User information dictionary, any user properties could put here.

Get user profile

Get current user's profile or another user's profile.

GET https://api.carv.io/user/profile

Headers

NameTypeDescription

x-app-id*

String

Client app ID issued by CARV

authorization*

String

user authentication token

Request Body

NameTypeDescription

user_id*

String

Target user identifier.

List Campaigns

List campaigns in descending order by end date.

GET https://api.carv.io/campaigns/list

Headers

NameTypeDescription

x-app-id*

String

Client app ID issued by CARV

authorization*

String

user authentication token

Get campaign details

Get campaign details from campaign ID.

GET https://api.carv.io/campaigns/{campaign_id}

Headers

NameTypeDescription

x-app-id*

String

Client app ID issued by CARV

authorization

String

user authentication token

List user mints

POST https://api.carv.io/mints/list

Headers

NameTypeDescription

x-app-id*

String

Client app ID issued by CARV

authorization*

String

user authentication token

Request Body

NameTypeDescription

user_id*

String

Target user identifier.

source_ids

Array of strings

List mints from specified campaign IDs.

states

Array of strings

List mints in given status. Status enum: not_started/finished/requested/in_progress/failed.

Start campaign mint

POST https://api.carv.io/mints/list

Headers

NameTypeDescription

x-app-id*

String

Client app ID issued by CARV

authorization*

String

user authentication token

Request Body

NameTypeDescription

source_id

Array of strings

The campaign ID.

mint_to_addr

Array of strings

The mint receiver address.

Last updated