Skip to content

Check for a valid subdomain link

Verifies if the given subdomain (affiliate link) is attributed to an organization.

Note: This query performs a case-insensitive but exact match.

Authentication Required

Requires CAN_QUERY_AFFILIATE_LINKS permission.

Arguments

  • subdomain: String!

Returns

1
2
3
4
5
query isValidSubdomainQuery($subdomain: String!) {
    isValidSubdomain(subdomain: $subdomain) {
        isValid
    }
}
1
2
3
4
# Input variables
{
  "subdomain":""
}

Example

1
2
3
4
5
query isValidSubdomainQuery($subdomain: String!) {
    isValidSubdomain(subdomain: $subdomain) {
        isValid
    }
}
1
2
3
4
# Input variables
{
  "subdomain":"some_cool_subdomain"
}
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 isValidSubdomainQuery($subdomain: String!) {
        isValidSubdomain(subdomain: $subdomain) {
            isValid
        }
    }
"""

VARIABLES = {
    "subdomain": "some_cool_subdomain"
}

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 isValidSubdomainQuery($subdomain: String!) {
        isValidSubdomain(subdomain: $subdomain) {
            isValid
        }
    }
`
const variables = {
  "subdomain": "some_cool_subdomain"
}

axios({
  url: apiUrl,
  method: "post",
  data: {
    query: query,
    variables: variables,
  },
  headers: headers,
}).then((response) => {
  console.log(JSON.stringify(response.data, null, 4));
});
1
2
3
4
5
6
7
{
    "data": {
        "isValidSubdomain": {
            "isValid": true
        }
    }
}
Back to top