Skip to content

Get accounts using email address

Returns accounts that are associated with the given email address.

Authentication Required

Requires CAN_CREATE_SHELL_ACCOUNTS, CAN_QUERY_ACCOUNTS_WITH_EMAIL_ADDRESS permissions.

Arguments

  • email: String!

Returns

Code

query getAccountWithEmailId($email: String!) {
  getAccountsWithEmailAddress(email: $email) {
    billingName
    number
    status
    users {
      givenName
    }
    accountType
    urn
  }
}
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 getAccountWithEmailId($email: String!) {
      getAccountsWithEmailAddress(email: $email) {
        billingName
        number
        status
        users {
          givenName
        }
        accountType
        urn
      }
    }
"""
VARIABLES =     {
  "email":"bob@example.com"
}

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 getAccountWithEmailId($email: String!) {
  getAccountsWithEmailAddress(email: $email) {
    billingName
    number
    status
    users {
      givenName
    }
    accountType
    urn
  }
}
`
const variables = {
  "email": "bob@example.com"
}
axios({
  url: apiUrl,
  method: "post",
  data: {
    query: query,
    variables: variables,
  },
  headers: headers,
}).then((response) => {
  console.log(JSON.stringify(response.data, null, 4));
});
import axios from 'axios';

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

export const jwtToken = "PLACE_JWT_TOKEN_HERE"

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

export const query = `
query getAccountWithEmailId($email: String!) {
  getAccountsWithEmailAddress(email: $email) {
    billingName
    number
    status
    users {
      givenName
    }
    accountType
    urn
  }
}
`
export const variables = {
  "email": "bob@example.com"
}

axios({
  url: apiUrl,
  method: "post",
  data: {
    query: query,
    variables: variables,
  },
  headers: headers,
}).then((response) => {
  console.log(JSON.stringify(response.data, null, 4));
});
{}
Back to top