Looks up the referral code on file for a player. If the player has no referral on file, the response is 404 with code set to PlayerHasNoReferral.
Authorizations
Section titled “Authorizations”X-SHARED-SECRET
required
stringheader
Send your public API key (nexus_pk_...) in the X-SHARED-SECRET header. Generate one in the Publisher Dashboard.
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”playerId
required
string
Example
player_8f2c41d0Unique identifier of the player to look up the current referral code for.
Query Parameters
Section titled “Query Parameters”groupId
string
Example
V1StGXR8_Z5jdHi6B1LiOCreator group to use for this operation. If your key is scoped to a single program, that group is always used instead of this value; otherwise the lookup falls back to your default group when this is omitted.
Responses
Section titled “ Responses ”Current referral code for the given player
Media typeapplication/json
string
Specified player has not used a referral code
Media typeapplication/json
object
code
string
GET
/player/{playerId}/code
const url = 'https://api.nexus.gg/v1/referrals/player/player_8f2c41d0/code?groupId=V1StGXR8_Z5jdHi6B1LiO';const options = {method: 'GET', headers: {'X-SHARED-SECRET': 'nexus_pk_your_key_here'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.nexus.gg/v1/referrals/player/player_8f2c41d0/code?groupId=V1StGXR8_Z5jdHi6B1LiO' \ --header 'X-SHARED-SECRET: nexus_pk_your_key_here'Example
popcornfrogExample
{ "code": "PlayerHasNoReferral"}