Update Account Language Preference¶
Updates the email and sms language preference of an account.
Authentication required
Requires account user level access or CAN_ACCESS_CUSTOMER_QUERIES
permission.
- Arguments
-
input
-
Returns
Examples¶
Update Language Preference¶
import json
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}"
}
MUTATION = """
mutation updateLanguagePreference($input: LanguagePreferenceInput!) {
updateLanguagePreference(input: $input) {
languagePreference
}
}
"""
VARIABLES = {
"input": {
"accountNumber": "A-12345",
"languagePreference": "SPANISH"
}
}
session = requests.Session()
session.headers.update(HEADERS)
response = session.post(
url=API_URL,
json={“query”: MUTATION, “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 mutation = `
mutation updateLanguagePreference($input: LanguagePreferenceInput!) {
updateLanguagePreference(input: $input) {
languagePreference
}
}
`
const variables = {
"input": {
"accountNumber": "A-12345",
"languagePreference": "SPANISH"
}
}
axios({
url: apiUrl,
method: "post",
data: {
query: mutation,
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 mutation = `
mutation updateLanguagePreference($input: LanguagePreferenceInput!) {
updateLanguagePreference(input: $input) {
languagePreference
}
}
`
export const variables = {
"input": {
"accountNumber": "A-12345",
"languagePreference": "SPANISH"
}
}
axios({
url: apiUrl,
method: "post",
data: {
query: mutation,
variables: variables,
},
headers: headers,
}).then((response) => {
console.log(JSON.stringify(response.data, null, 4));
});