Skip to content

Get information about an affiliate link

Returns information about an affiliate link.

Authentication Required

Requires CAN_QUERY_AFFILIATE_LINKS permission.

Arguments

  • subdomain: graphene.String!

Returns

query getAffiliateLink($subdomain: String!) {
  affiliateLink(subdomain: $subdomain) {
    subdomain
    contactName
    contactEmail
    landingUrl
    organisation {
      name
      salesChannel
    }
  }
}
1
2
3
4
# Input variables
{
    "subdomain": ""
}

Example

query getAffiliateLink($subdomain: String!) {
  affiliateLink(subdomain: $subdomain) {
    subdomain
    contactName
    contactEmail
    landingUrl
    organisation {
      name
      salesChannel
    }
  }
}
1
2
3
4
# Input variables
{
  "subdomain":"testUser"
}
import pprint

import requests

# API_URL = "https://api.oeus-kraken.energy/v1/graphql/" # prod
API_URL = "https://api.oeus-kraken.systems/v1/graphql/" # test
JWT_TOKEN = "PLACE_JWT_TOKEN_HERE"
HEADERS = {
    "Authorization": f"JWT {JWT_TOKEN}"
}

QUERY = """
    query getAffiliateLink($subdomain: String!) {
      affiliateLink(subdomain: $subdomain) {
        subdomain
        contactName
        contactEmail
        landingUrl
        organisation {
          name
          salesChannel
        }
      }
    }
"""

VARIABLES = {
    "subdomain": "testUser"
}

session = requests.Session()
session.headers.update(HEADERS)
response = session.post(
    url=API_URL,
    json={"query": QUERY, "variables": VARIABLES}
)
pprint.pprint(response.json())
const axios = require("axios")

// const apiUrl = "https://api.oeus-kraken.energy/v1/graphql/" // Prod
const apiUrl = "https://api.oeus-kraken.systems/v1/graphql/" // Test

const jwtToken = "PLACE_JWT_TOKEN_HERE"

let headers = {
  "Authorization": `JWT ${jwtToken}`
}

const query = `
    query getAffiliateLink($subdomain: String!) {
      affiliateLink(subdomain: $subdomain) {
        subdomain
        contactName
        contactEmail
        landingUrl
        organisation {
          name
          salesChannel
        }
      }
    }
`
const variables = {
  "subdomain": "testUser"
}

axios({
  url: apiUrl,
  method: "post",
  data: {
    query: query,
    variables: variables,
  },
  headers: headers,
}).then((response) => {
  console.log(JSON.stringify(response.data, null, 4));
});
{
  "data": {
    "affiliateLink": {
      "subdomain": "testUser",
      "contactName": "Test User",
      "contactEmail": "test.user@example.com",
      "landingUrl": "",
      "organisation": {
        "name": "Test Field sales",
        "salesChannel": "FIELD_SALES"
      }
    }
  }
}
Back to top