Show Insight author
curl --request GET \
--url https://{host}/v1/articles/{id}/author \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{host}/v1/articles/{id}/author', 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://{host}/v1/articles/{id}/author",
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;
}import requests
url = "https://{host}/v1/articles/{id}/author"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"data": {
"type": "authors",
"id": "15",
"attributes": {
"name": "Jeffrey Ponsen",
"function": "Founder",
"bio": "Has been buying and selling watches since 2009.",
"linkedin": "https://www.linkedin.com/in/example",
"slug": "jeffrey-ponsen",
"image": "https://cdn.wristler.eu/uploads/jeffrey-square-medium.jpg",
"url": "https://wristler.eu/insights/author/jeffrey-ponsen"
}
}
}{
"errors": [
{
"status": "404",
"code": "watch_reserved",
"title": "Not Found",
"detail": "<string>",
"meta": {},
"source": {
"pointer": "/data/attributes/reference",
"parameter": "<string>"
}
}
],
"jsonapi": {
"version": "1.0"
}
}{
"errors": [
{
"status": "404",
"code": "watch_reserved",
"title": "Not Found",
"detail": "<string>",
"meta": {},
"source": {
"pointer": "/data/attributes/reference",
"parameter": "<string>"
}
}
],
"jsonapi": {
"version": "1.0"
}
}Content (Insights)
Show Insight author
Scope: content:read
Who wrote it. The same thing ?include=author gives you beside the article,
which is one call rather than two.
An authors resource is a byline, not an account: what the website’s author box
and author page show, and nothing else.
| Attribute | |
|---|---|
name | First and last name |
function | The role under the name, in the language asked for; null when there is none |
bio | A paragraph, plain text, in the language asked for; null when there is none |
linkedin | A profile URL, or null |
slug | What filter[author] on /v1/articles takes |
image | The square portrait, or null |
url | Their page on the website, with everything they wrote |
There is no /v1/authors: an author is reached through an article.
GET
/
v1
/
articles
/
{id}
/
author
Show Insight author
curl --request GET \
--url https://{host}/v1/articles/{id}/author \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{host}/v1/articles/{id}/author', 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://{host}/v1/articles/{id}/author",
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;
}import requests
url = "https://{host}/v1/articles/{id}/author"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"data": {
"type": "authors",
"id": "15",
"attributes": {
"name": "Jeffrey Ponsen",
"function": "Founder",
"bio": "Has been buying and selling watches since 2009.",
"linkedin": "https://www.linkedin.com/in/example",
"slug": "jeffrey-ponsen",
"image": "https://cdn.wristler.eu/uploads/jeffrey-square-medium.jpg",
"url": "https://wristler.eu/insights/author/jeffrey-ponsen"
}
}
}{
"errors": [
{
"status": "404",
"code": "watch_reserved",
"title": "Not Found",
"detail": "<string>",
"meta": {},
"source": {
"pointer": "/data/attributes/reference",
"parameter": "<string>"
}
}
],
"jsonapi": {
"version": "1.0"
}
}{
"errors": [
{
"status": "404",
"code": "watch_reserved",
"title": "Not Found",
"detail": "<string>",
"meta": {},
"source": {
"pointer": "/data/attributes/reference",
"parameter": "<string>"
}
}
],
"jsonapi": {
"version": "1.0"
}
}