📔Open API Specification
Context
Here you will find our OpenAPI specification for the Chainvine API.
All endpoints below require you to provide your api key in the headers
{
'X-API-KEY': 'your-api-key'
}
SyncUser
Always call this method early on in your flows to fetch a user's Chainvine ID.
Note: the SDK handles calling this endpoint for your when using the SDK to call the methods in the ChainvineUser section.
Creates or updates a user, and returns the user's details. Use this method to get your user's Chainvine ID to use the methods bellow.
wallet
Pattern: ^(wallet|email|externalId)
POST /api/v2/users HTTP/1.1
Host: api.chainvine.xyz
X-API-KEY: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 154
{
"chain_id": "text",
"email": "text",
"external_id": "text",
"firstName": "text",
"lastName": "text",
"network": "text",
"wallet_address": "text",
"user_type": "wallet"
}
{
"id": "text"
}
This endpoint can also be used to update the user's information.
ChainvineUser
These endpoints can also be covered via the SDK. Please see methods outlined there as needed or examples of how to use these endpoints to suit your needs.
Create a referral between a referrer and a claimer
The campaign id you want to create a referral in
The campaign id you want to create a referral in
joidj2odkd
The referring user's Chainvine Id, obtained via the referral link r parameter
fjdopwdp2pmosjo2ds
0x03jkd0ij2od
POST /api/v2/user/{user_id}/campaign/{campaign_id}/link/referral HTTP/1.1
Host: api.chainvine.xyz
X-API-KEY: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 93
{
"campaign_id": "joidj2odkd",
"referrer": "fjdopwdp2pmosjo2ds",
"wallet_address": "0x03jkd0ij2od"
}
No content
Generates your user's referral url for the program id provided
The campaign id you want to generate a referral url for
GET /api/v2/user/{user_id}/campaign/{campaign_id}/referral/url HTTP/1.1
Host: api.chainvine.xyz
X-API-KEY: YOUR_API_KEY
Accept: */*
No content
Send a custom transfer event with a monetary payload to apply to credit as a reward to the referrer who referrer the user
The campaign id you want to generate a transfer event in
12443.43
anId123
Ok
134.32
Ok
Ok
134.32
Ok
Ok
POST /api/v2/user/{user_id}/campaign/{campaign_id}/events/transfer HTTP/1.1
Host: api.chainvine.xyz
X-API-KEY: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 187
{
"amount": 12443.43,
"requirement_id": "anId123",
"external_identifier": "Ok",
"fee": 134.32,
"token_address": "Ok",
"transaction_hash": "Ok",
"usd_value": 134.32,
"user_id": "Ok",
"wallet_address": "Ok"
}
{
"amount": 12443.43,
"requirement_id": "anId123",
"external_identifier": "Ok",
"fee": 134.32,
"token_address": "Ok",
"transaction_hash": "Ok",
"usd_value": 134.32,
"user_id": "Ok",
"wallet_address": "Ok"
}
Completes a requirement for a user within a referral program/campaign
https://docs.chainvine.xyz/technical/sdk/use-cases/requirements/completing-a-requirement-for-a-user
The id of the requirement your wish to complete for the user
d0djj9dj9dj0jk
POST /api/v2/user/{user_id}/requirements/complete HTTP/1.1
Host: api.chainvine.xyz
X-API-KEY: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 52
{
"campaign": {
"id": "c5de90fe"
},
"id": "d0djj9dj9dj0jk"
}
{
"message": "Ok"
}
V1 Endpoints
Records a click on a user's referral URL
The campaign id to track the link click against
The referrer's referral code (found in the URL)
The campaign id you want to create a referral in
joidj2odkd
The referring user's Chainvine Id, obtained via the referral link r parameter
fjdopwdp2pmosjo2ds
0x03jkd0ij2od
POST /v1/chainvine/community/{community_id}/campaign/{campaign_id}/record-click HTTP/1.1
Host: api.chainvine.xyz
X-API-KEY: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 93
{
"campaign_id": "joidj2odkd",
"referrer": "fjdopwdp2pmosjo2ds",
"wallet_address": "0x03jkd0ij2od"
}
No content
CodeGeneration
If you would like to generate custom code for the endpoints above, please visit our swaggerhub page and select the "Export" drop down at the top right of the page.
Last updated