Python
import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
user = client.iam.users.get(
0,
)
print(user.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"),
)
user, err := client.Iam.Users.Get(context.TODO(), 0)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", user.ID)
}
curl --request GET \
--url https://api.gcore.com/iam/users/{userId} \
--header 'Authorization: <api-key>'const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.gcore.com/iam/users/{userId}', 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/users/{userId}",
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/users/{userId}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/iam/users/{userId}")
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>",
"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"
],
"user_type": "common",
"is_active": true
}Users
Get user's details
GET
/
iam
/
users
/
{userId}
Python
import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
user = client.iam.users.get(
0,
)
print(user.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"),
)
user, err := client.Iam.Users.Get(context.TODO(), 0)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", user.ID)
}
curl --request GET \
--url https://api.gcore.com/iam/users/{userId} \
--header 'Authorization: <api-key>'const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.gcore.com/iam/users/{userId}', 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/users/{userId}",
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/users/{userId}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/iam/users/{userId}")
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>",
"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"
],
"user_type": "common",
"is_active": true
}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
Path Parameters
User's ID.
Response
OK.
User's ID.
User's email address.
User's name.
User's language.
Defines language of the control panel and email messages.
Available options:
de, en, ru, zh, az User's phone.
User's company.
Services provider ID.
User's account ID.
Deletion flag. If true then user was deleted.
User's group in the current account.
IAM supports 5 groups:
- Users
- Administrators
- Engineers
- Purge and Prefetch only (API)
- Purge and Prefetch only (API+Web)
Show child attributes
Show child attributes
Email confirmation:
true– user confirmed the email;false– user did not confirm the email.
SSO authentication flag. If true then user can login via SAML SSO.
Two-step verification:
true– user enabled two-step verification;false– user disabled two-step verification.
System field. List of auth types available for the account.
Auth types.
Available options:
password, sso, github, google-oauth2 User's type.
Available options:
common, reseller, seller User activity flag.
Was this page helpful?