cURL
curl --request GET \
--url https://api.vinkit.co/v1/posts \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.vinkit.co/v1/posts"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.vinkit.co/v1/posts', 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.vinkit.co/v1/posts",
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.vinkit.co/v1/posts"
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.vinkit.co/v1/posts")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vinkit.co/v1/posts")
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[
{
"id": "<string>",
"title": "<string>",
"status": "published",
"slug": "<string>",
"content": "<string>",
"excerpt": "<string>",
"tags": [
"<string>"
],
"cover_image": "<string>",
"published_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z"
}
]{
"error": 123,
"message": "<string>"
}Posts
Lister les articles
Récupère la liste de tous vos articles
GET
/
posts
cURL
curl --request GET \
--url https://api.vinkit.co/v1/posts \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.vinkit.co/v1/posts"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.vinkit.co/v1/posts', 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.vinkit.co/v1/posts",
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.vinkit.co/v1/posts"
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.vinkit.co/v1/posts")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vinkit.co/v1/posts")
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[
{
"id": "<string>",
"title": "<string>",
"status": "published",
"slug": "<string>",
"content": "<string>",
"excerpt": "<string>",
"tags": [
"<string>"
],
"cover_image": "<string>",
"published_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z"
}
]{
"error": 123,
"message": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Nombre maximum de résultats à retourner
Filtrer par statut (published, draft, scheduled, archived)
Available options:
published, draft, scheduled, archived Filtrer par tag
Response
Liste des articles
Identifiant unique de l'article
Titre de l'article
Statut de l'article
Available options:
published, draft, scheduled, archived Slug URL de l'article
Contenu de l'article en Markdown
Extrait court de l'article
Liste des tags associés
URL de l'image de couverture
Date de publication (ISO 8601)
Date de création (ISO 8601)
Was this page helpful?