Server MUST verify signature or apiKey before returning referral codes.
Headres:
- x-ref-campaign-key // api key, needed if request did not contain body
Params:
- campaign_id: referral campaign id
- referrer: ethereum address of the user
Body:
- signature_data: // needed if request did not contain x-ref-campaign-key
- signature: signature, singed by with creator address
- address: creator address of referral campaign
- domain: domain to use in veryfication message
- version: version to use in veryfication message
- chain_id: chain_id to use in veryfication message
- uri: uri to use in veryfication message
- nonce: nonce to use in veryfication message
- issued_at: issued_atto use in veryfication message
Returns (success):
- success: boolean, indicating whether the operation was successful
- referrer: ethereum address of the user
- campaign_active: boolean, indicating whether the campaign was active
- claim_codes[]: array of claim code objects associated with the referrer
- claim_code: claim code
- link_id: link id associated with the claim code
- status: status of the claim link
Returns (errored):
- success: boolean, indicating whether the operation was successful
- errors:
- Referrer is not provided - referrer address was not provided in params
- Campaign id is not provided - campaing id was not provided in params
- Referral campaing not found - campaing was not find with id in db
- Invalid x-ref-campaign-key - x-ref-campaign-key did not match with apiKey for campaign in db
- URI is not provided - body did not contain uri param
- Nonce is not provided - body did not contain nonce param
- Domain is not provided - body did not contain domain param
- Address is not provided - body did not contain address param
- Version is not provided - body did not contain version param
- Signature is not provided - body did not contain siganture param
- Chain id is not provided - body did not contain chain id param
- issuedAt param is not provided - body did not contain issuedAt param