cURL
curl "https://api.ionq.co/v0.4/whoami" \
-H "Authorization: apiKey your-api-key"import requests
url = "https://api.ionq.co/v0.4/whoami"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.ionq.co/v0.4/whoami', 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.ionq.co/v0.4/whoami",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.ionq.co/v0.4/whoami"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.ionq.co/v0.4/whoami")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ionq.co/v0.4/whoami")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"key_id": "e060759f-4348-4767-a645-8c0301265791",
"key_name": "My First Key",
"project_id": "944904d6-2e30-4cfb-8bc4-04afaabcdd42"
}Utilities
Get current key
Gets information about the current token.
GET
/
whoami
cURL
curl "https://api.ionq.co/v0.4/whoami" \
-H "Authorization: apiKey your-api-key"import requests
url = "https://api.ionq.co/v0.4/whoami"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.ionq.co/v0.4/whoami', 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.ionq.co/v0.4/whoami",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.ionq.co/v0.4/whoami"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.ionq.co/v0.4/whoami")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ionq.co/v0.4/whoami")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"key_id": "e060759f-4348-4767-a645-8c0301265791",
"key_name": "My First Key",
"project_id": "944904d6-2e30-4cfb-8bc4-04afaabcdd42"
}Response
200 - application/json
Successfully retrieved a current of key from this session.
Was this page helpful?
⌘I

