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",
"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
}Whoami
Get a current user
GET
/
whoami
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",
"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
200 - application/json
OK
The user id
Information about the access token used to make this request.
Show child attributes
Show child attributes
Name of the 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
Example:
{
"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 company was created.
Example:
"2021-06-24T00:54:40.029056Z"
Contact of user who created the company
The instant this company was created.
Example:
"2021-06-24T00:54:40.029056Z"
Contact of user who updated the company
Was this page helpful?
⌘I

