cURL
curl -X GET \
/user/me \
--header "Authorization: Bearer <token>"import requests
url = "https://coreapi.io/user/me"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://coreapi.io/user/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://coreapi.io/user/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: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"user": {
"firstName": "John",
"lastName": "Doe",
"email": "jsmith@example.com",
"id": "01F9Z3ZJXZQZJZJZJZJZJZJZJZ"
},
"account": {
"id": "01F9Z3ZJXZQZJZJZJZJZJZJZJZ"
},
"tenant": {
"name": "ACME",
"legalCompanyName": "Acme Inc.",
"id": "01F9Z3ZJXZQZJZJZJZJZJZJZJZ",
"username": "acme"
},
"roles": [
"ROLE_USER"
]
}User
Get the current user
Get the current user
Required permissions:user:readGET
/
user
/
me
cURL
curl -X GET \
/user/me \
--header "Authorization: Bearer <token>"import requests
url = "https://coreapi.io/user/me"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://coreapi.io/user/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://coreapi.io/user/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: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"user": {
"firstName": "John",
"lastName": "Doe",
"email": "jsmith@example.com",
"id": "01F9Z3ZJXZQZJZJZJZJZJZJZJZ"
},
"account": {
"id": "01F9Z3ZJXZQZJZJZJZJZJZJZJZ"
},
"tenant": {
"name": "ACME",
"legalCompanyName": "Acme Inc.",
"id": "01F9Z3ZJXZQZJZJZJZJZJZJZJZ",
"username": "acme"
},
"roles": [
"ROLE_USER"
]
}Autorisierungen
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
War diese Seite hilfreich?
⌘I