Test Credential
curl --request POST \
--url https://api.example.com/api/projects/{project_id}/odoo/credentials/{cred_id}/testimport requests
url = "https://api.example.com/api/projects/{project_id}/odoo/credentials/{cred_id}/test"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/api/projects/{project_id}/odoo/credentials/{cred_id}/test', 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.example.com/api/projects/{project_id}/odoo/credentials/{cred_id}/test",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$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.example.com/api/projects/{project_id}/odoo/credentials/{cred_id}/test"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/projects/{project_id}/odoo/credentials/{cred_id}/test")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/projects/{project_id}/odoo/credentials/{cred_id}/test")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"status": "<string>",
"databases": [
"<string>"
],
"db_name": "<string>",
"error": "<string>",
"resolved_url": "<string>",
"server_version": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Odoo Connections
Test Credential
Probe the Odoo instance with the stored credential and update the last_test_* bookkeeping. Runs the (sync) XML-RPC call in a thread so the event loop stays responsive.
POST
/
api
/
projects
/
{project_id}
/
odoo
/
credentials
/
{cred_id}
/
test
Test Credential
curl --request POST \
--url https://api.example.com/api/projects/{project_id}/odoo/credentials/{cred_id}/testimport requests
url = "https://api.example.com/api/projects/{project_id}/odoo/credentials/{cred_id}/test"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/api/projects/{project_id}/odoo/credentials/{cred_id}/test', 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.example.com/api/projects/{project_id}/odoo/credentials/{cred_id}/test",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$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.example.com/api/projects/{project_id}/odoo/credentials/{cred_id}/test"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/projects/{project_id}/odoo/credentials/{cred_id}/test")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/projects/{project_id}/odoo/credentials/{cred_id}/test")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"status": "<string>",
"databases": [
"<string>"
],
"db_name": "<string>",
"error": "<string>",
"resolved_url": "<string>",
"server_version": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}