پرش به مطلب اصلی

Referral Code API

POST /getReferralCode

Description

This endpoint retrieves the referral code for the user.

Request

Endpoint: /getReferralCode

Method: POST

Body:

query getReferralCode {
getReferralCode {
code
}
}

GraphQL Variables:

{}

Example Request

cURL:

curl --location 'YOUR_API_ENDPOINT' \
--header 'Content-Type: application/json' \
--data '{"query":"query getReferralCode {\n getReferralCode {\n code\n }\n}","variables":{}}'

Response

The response will include:

  • code: The referral code associated with the user.

Errors

  • 500 Internal Server Error: Server error while processing the request.

Notes

  • Ensure that the user is authenticated before making this request.
  • The referral code is a unique identifier that can be used for tracking and incentives.
  • If the user does not have a referral code, the response may be empty or null.