import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
account_overview = client.iam.get_account_overview()
print(account_overview.id)package main
import (
"context"
"fmt"
"github.com/G-Core/gcore-go"
"github.com/G-Core/gcore-go/option"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
accountOverview, err := client.Iam.GetAccountOverview(context.TODO())
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", accountOverview.ID)
}
curl --request GET \
--url https://api.gcore.com/iam/clients/me \
--header 'Authorization: <api-key>'const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.gcore.com/iam/clients/me', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gcore.com/iam/clients/me",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api.gcore.com/iam/clients/me")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/iam/clients/me")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": 123,
"email": "jsmith@example.com",
"name": "<string>",
"status": "new",
"companyName": "<string>",
"currentUser": 123,
"capabilities": [
"CDN"
],
"serviceStatuses": {
"CDN": {
"status": "new",
"enabled": true
},
"CLOUD": {
"status": "new",
"enabled": true
},
"DDOS": {
"status": "new",
"enabled": true
},
"DNS": {
"status": "new",
"enabled": true
},
"STORAGE": {
"status": "new",
"enabled": true
},
"STREAMING": {
"status": "new",
"enabled": true
}
},
"paidFeatures": {
"CDN": [
{
"feature_id": 1,
"name": "paid feature name",
"service": "CDN"
}
],
"STREAMING": [
{
"feature_id": 2,
"name": "another paid feature name",
"service": "STREAMING"
}
]
},
"freeFeatures": {
"CDN": [
{
"feature_id": 1,
"name": "free feature name",
"service": "CDN"
}
],
"STREAMING": [
{
"feature_id": 2,
"name": "another free feature name",
"service": "STREAMING"
}
]
},
"entryBaseDomain": "<string>",
"deleted": true,
"bill_type": "<string>",
"is_test": true,
"has_active_admin": true,
"users": [
{
"id": 123,
"email": "jsmith@example.com",
"name": "<string>",
"lang": "de",
"phone": "<string>",
"company": "<string>",
"reseller": 123,
"client": 123,
"deleted": true,
"groups": [
{
"id": 1,
"name": "Administrators"
}
],
"activated": true,
"sso_auth": true,
"two_fa": true,
"auth_types": [
"password"
]
}
],
"phone": "<string>",
"website": "<string>",
"signup_process": "sign_up_full",
"custom_id": "<string>",
"country_code": "<string>"
}Account Details
Get information about your profile, users and other account details.
import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
account_overview = client.iam.get_account_overview()
print(account_overview.id)package main
import (
"context"
"fmt"
"github.com/G-Core/gcore-go"
"github.com/G-Core/gcore-go/option"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
accountOverview, err := client.Iam.GetAccountOverview(context.TODO())
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", accountOverview.ID)
}
curl --request GET \
--url https://api.gcore.com/iam/clients/me \
--header 'Authorization: <api-key>'const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.gcore.com/iam/clients/me', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gcore.com/iam/clients/me",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api.gcore.com/iam/clients/me")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/iam/clients/me")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": 123,
"email": "jsmith@example.com",
"name": "<string>",
"status": "new",
"companyName": "<string>",
"currentUser": 123,
"capabilities": [
"CDN"
],
"serviceStatuses": {
"CDN": {
"status": "new",
"enabled": true
},
"CLOUD": {
"status": "new",
"enabled": true
},
"DDOS": {
"status": "new",
"enabled": true
},
"DNS": {
"status": "new",
"enabled": true
},
"STORAGE": {
"status": "new",
"enabled": true
},
"STREAMING": {
"status": "new",
"enabled": true
}
},
"paidFeatures": {
"CDN": [
{
"feature_id": 1,
"name": "paid feature name",
"service": "CDN"
}
],
"STREAMING": [
{
"feature_id": 2,
"name": "another paid feature name",
"service": "STREAMING"
}
]
},
"freeFeatures": {
"CDN": [
{
"feature_id": 1,
"name": "free feature name",
"service": "CDN"
}
],
"STREAMING": [
{
"feature_id": 2,
"name": "another free feature name",
"service": "STREAMING"
}
]
},
"entryBaseDomain": "<string>",
"deleted": true,
"bill_type": "<string>",
"is_test": true,
"has_active_admin": true,
"users": [
{
"id": 123,
"email": "jsmith@example.com",
"name": "<string>",
"lang": "de",
"phone": "<string>",
"company": "<string>",
"reseller": 123,
"client": 123,
"deleted": true,
"groups": [
{
"id": 1,
"name": "Administrators"
}
],
"activated": true,
"sso_auth": true,
"two_fa": true,
"auth_types": [
"password"
]
}
],
"phone": "<string>",
"website": "<string>",
"signup_process": "sign_up_full",
"custom_id": "<string>",
"country_code": "<string>"
}Authorizations
API key for authentication. Make sure to include the word apikey, followed by a single space and then your token.
Example: apikey 1234_abcdef
Response
OK
The account ID.
The account email.
Name of a user who registered the requested account.
Status of the account.
new, trial, trialend, active, integration, paused, preparation, ready The company name.
ID of the current user.
System field. List of services available for the account.
Service's name.
CDN, STORAGE, STREAMING, DNS, DDOS, CLOUD An object of arrays which contains information about all services available for the requested account.
Show child attributes
Show child attributes
An object of arrays which contains information about paid features available for the requested account.
Show child attributes
Show child attributes
{
"CDN": [
{
"feature_id": 1,
"name": "paid feature name",
"service": "CDN"
}
],
"STREAMING": [
{
"feature_id": 2,
"name": "another paid feature name",
"service": "STREAMING"
}
]
}
An object of arrays which contains information about free features available for the requested account.
Show child attributes
Show child attributes
{
"CDN": [
{
"feature_id": 1,
"name": "free feature name",
"service": "CDN"
}
],
"STREAMING": [
{
"feature_id": 2,
"name": "another free feature name",
"service": "STREAMING"
}
]
}
System field. Control panel domain.
The field shows the status of the account:
true– the account has been deletedfalse– the account is not deleted
System field. Billing type of the account.
System field:
true— a test account;false— a production account.
System field.
List of account users.
Show child attributes
Show child attributes
Phone of a user who registered the requested account.
The company website.
System field. Type of the account registration process.
sign_up_full, sign_up_simple The account custom ID.
System field. The company country (ISO 3166-1 alpha-2 format).
Was this page helpful?