Demander un code d'appareil (Device Flow)
curl --request POST \
--url https://dejavu.plus/api/v1/auth/device/code \
--header 'Content-Type: application/json' \
--data '
{
"client_id": "kodi",
"client_name": "dejaVu Kodi"
}
'import requests
url = "https://dejavu.plus/api/v1/auth/device/code"
payload = {
"client_id": "kodi",
"client_name": "dejaVu Kodi"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({client_id: 'kodi', client_name: 'dejaVu Kodi'})
};
fetch('https://dejavu.plus/api/v1/auth/device/code', 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://dejavu.plus/api/v1/auth/device/code",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'client_id' => 'kodi',
'client_name' => 'dejaVu Kodi'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://dejavu.plus/api/v1/auth/device/code"
payload := strings.NewReader("{\n \"client_id\": \"kodi\",\n \"client_name\": \"dejaVu Kodi\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://dejavu.plus/api/v1/auth/device/code")
.header("Content-Type", "application/json")
.body("{\n \"client_id\": \"kodi\",\n \"client_name\": \"dejaVu Kodi\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dejavu.plus/api/v1/auth/device/code")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"client_id\": \"kodi\",\n \"client_name\": \"dejaVu Kodi\"\n}"
response = http.request(request)
puts response.read_body{
"device_code": "<string>",
"user_code": "<string>",
"verification_uri": "<string>",
"verification_uri_complete": "<string>",
"expires_in": 300,
"interval": 5
}Auth
Request a device code
First authentication step for devices without a keyboard (TV, etc.).
POST
/
auth
/
device
/
code
Demander un code d'appareil (Device Flow)
curl --request POST \
--url https://dejavu.plus/api/v1/auth/device/code \
--header 'Content-Type: application/json' \
--data '
{
"client_id": "kodi",
"client_name": "dejaVu Kodi"
}
'import requests
url = "https://dejavu.plus/api/v1/auth/device/code"
payload = {
"client_id": "kodi",
"client_name": "dejaVu Kodi"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({client_id: 'kodi', client_name: 'dejaVu Kodi'})
};
fetch('https://dejavu.plus/api/v1/auth/device/code', 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://dejavu.plus/api/v1/auth/device/code",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'client_id' => 'kodi',
'client_name' => 'dejaVu Kodi'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://dejavu.plus/api/v1/auth/device/code"
payload := strings.NewReader("{\n \"client_id\": \"kodi\",\n \"client_name\": \"dejaVu Kodi\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://dejavu.plus/api/v1/auth/device/code")
.header("Content-Type", "application/json")
.body("{\n \"client_id\": \"kodi\",\n \"client_name\": \"dejaVu Kodi\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dejavu.plus/api/v1/auth/device/code")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"client_id\": \"kodi\",\n \"client_name\": \"dejaVu Kodi\"\n}"
response = http.request(request)
puts response.read_body{
"device_code": "<string>",
"user_code": "<string>",
"verification_uri": "<string>",
"verification_uri_complete": "<string>",
"expires_in": 300,
"interval": 5
}Usage
Starts the device authentication flow. This operation is public. No API key is required.Example
curl -X POST -H "Content-Type: application/json" "https://dejavu.plus/api/v1/auth/device/code"
Parameters and response
The request body, parameters, and responses are defined by the OpenAPI specification displayed on this page.Errors
See Responses for the operation-specific error codes and formats.Notes
The device code is intended for clients such as Kodi extensions and other living-room applications.Body
application/json