http://localhost/api/v1/account
scope: account
Returns the calling user and the calling API key's own name, scopes, and rate limit.
curl "http://localhost/api/v1/account" \
-H "Authorization: Bearer wsk_xxx_xxx"
<?php
$ch = curl_init('http://localhost/api/v1/account');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer wsk_xxx_xxx']);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
import requests
response = requests.get("http://localhost/api/v1/account",
headers={"Authorization": "Bearer wsk_xxx_xxx"},
)
data = response.json()
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
client := &http.Client{}
req, _ := http.NewRequest("GET", "http://localhost/api/v1/account", nil)
req.Header.Set("Authorization", "Bearer wsk_xxx_xxx")
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
respBody, _ := io.ReadAll(resp.Body)
fmt.Println(string(respBody))
}
{
"data": {
"user": {"id": 12, "name": "Jane Doe", "email": "[email protected]"},
"key": {"name": "Production", "scopes": ["ip.check", "email.check"], "rate_limit_per_minute": 60}
}
}