curl --request GET \
--url https://api-dev.narrative.io/whoami \
--header 'Authorization: Bearer <token>'import requests
url = "https://api-dev.narrative.io/whoami"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api-dev.narrative.io/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-dev.narrative.io/whoami",
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;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-dev.narrative.io/whoami"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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-dev.narrative.io/whoami")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dev.narrative.io/whoami")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"user_id": 407,
"access_token": {
"expires_at": "2026-01-01T00:00:00Z"
},
"name": "John Doe",
"email": "[email protected]",
"role": "partner_admin",
"company_access_list": [
1
],
"accessible_companies": [
{
"company_id": 1,
"slug": "narrative",
"name": "Narrative, Inc (id 1!)",
"short_description": "Another New Short Description",
"long_description": "Narrative Long Description",
"contact_email": null,
"website": "https://app-dev.narrative.io/",
"data_shop_url": "https://shop.nicks.io/",
"twitter_link": "https://twitter.com/narrative_io",
"linkedin_link": "https://www.linkedin.com/company/narrative-io",
"image_url": null,
"status": "active",
"visibility": "visible"
}
],
"current_company_scope": {
"company_id": 1,
"slug": "narrative",
"name": "Narrative, Inc (id 1!)",
"short_description": "Another New Short Description",
"long_description": "Narrative Long Description",
"contact_email": null,
"website": "https://app-dev.narrative.io/",
"data_shop_url": "https://shop.nicks.io/",
"twitter_link": "https://twitter.com/narrative_io",
"linkedin_link": "https://www.linkedin.com/company/narrative-io",
"image_url": null,
"status": "active",
"visibility": "visible"
},
"created_at": "2022-11-29T21:42:24.978707Z",
"created_by": null,
"last_updated_at": null,
"last_updated_by": null
}Get a current user
curl --request GET \
--url https://api-dev.narrative.io/whoami \
--header 'Authorization: Bearer <token>'import requests
url = "https://api-dev.narrative.io/whoami"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api-dev.narrative.io/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-dev.narrative.io/whoami",
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;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-dev.narrative.io/whoami"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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-dev.narrative.io/whoami")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dev.narrative.io/whoami")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"user_id": 407,
"access_token": {
"expires_at": "2026-01-01T00:00:00Z"
},
"name": "John Doe",
"email": "[email protected]",
"role": "partner_admin",
"company_access_list": [
1
],
"accessible_companies": [
{
"company_id": 1,
"slug": "narrative",
"name": "Narrative, Inc (id 1!)",
"short_description": "Another New Short Description",
"long_description": "Narrative Long Description",
"contact_email": null,
"website": "https://app-dev.narrative.io/",
"data_shop_url": "https://shop.nicks.io/",
"twitter_link": "https://twitter.com/narrative_io",
"linkedin_link": "https://www.linkedin.com/company/narrative-io",
"image_url": null,
"status": "active",
"visibility": "visible"
}
],
"current_company_scope": {
"company_id": 1,
"slug": "narrative",
"name": "Narrative, Inc (id 1!)",
"short_description": "Another New Short Description",
"long_description": "Narrative Long Description",
"contact_email": null,
"website": "https://app-dev.narrative.io/",
"data_shop_url": "https://shop.nicks.io/",
"twitter_link": "https://twitter.com/narrative_io",
"linkedin_link": "https://www.linkedin.com/company/narrative-io",
"image_url": null,
"status": "active",
"visibility": "visible"
},
"created_at": "2022-11-29T21:42:24.978707Z",
"created_by": null,
"last_updated_at": null,
"last_updated_by": null
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Response
OK
The user id
Information about the access token used to make this request.
Show child attributes
Show child attributes
Name of the user
Email address of the user
The user's role.
global_admin— Narrative staff, unrestricted across companiespartner_admin— administers their own companypartner_user— ordinary member of their own company
global_admin, partner_admin, partner_user IDs of companies that could be accessed by the user. Deprecated, use accessible_companies instead. Will be removed in a future release.
Companies that could be accessed by the user, with full company details.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
{
"company_id": 42,
"slug": "acm",
"name": "ACM",
"long_description": "The Acme Corporation is an ironic name for the fictional corporation, appearing in the Road Runner/Wile E. Coyote animated shorts, where it was used as a running gag.",
"short_description": "American Company that Manufactures Everything",
"contact_email": "[email protected]",
"data_shop_url": "https://shop.acm.io",
"twitter_link": "https://twitter.com/acm_company",
"linkedin_link": "https://www.linkedin.com/company/acm_company",
"image_url": null,
"visibility": "visible",
"status": "active",
"website": null
}
Show child attributes
Show child attributes
The instant this user account was created.
"2021-06-24T00:54:40.029056Z"
Email address of the user who created this account. Null when no creator was recorded.
The instant this user account was last updated. Null when it has never been updated.
"2021-06-24T00:54:40.029056Z"
Email address of the user who last updated this account. Null when it has never been updated.
Was this page helpful?

