cURL
curl --request POST \
--url https://api.doctacapital.com.ar/api/v1/auth/token \
--header 'Content-Type: application/json' \
--data '
{
"grant_type": "client_credentials",
"client_id": "<string>",
"client_secret": "<string>"
}
'import requests
url = "https://api.doctacapital.com.ar/api/v1/auth/token"
payload = {
"grant_type": "client_credentials",
"client_id": "<string>",
"client_secret": "<string>"
}
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({
grant_type: 'client_credentials',
client_id: '<string>',
client_secret: '<string>'
})
};
fetch('https://api.doctacapital.com.ar/api/v1/auth/token', 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.doctacapital.com.ar/api/v1/auth/token",
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([
'grant_type' => 'client_credentials',
'client_id' => '<string>',
'client_secret' => '<string>'
]),
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://api.doctacapital.com.ar/api/v1/auth/token"
payload := strings.NewReader("{\n \"grant_type\": \"client_credentials\",\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\"\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://api.doctacapital.com.ar/api/v1/auth/token")
.header("Content-Type", "application/json")
.body("{\n \"grant_type\": \"client_credentials\",\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.doctacapital.com.ar/api/v1/auth/token")
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 \"grant_type\": \"client_credentials\",\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"access_token": "<string>",
"token_type": "Bearer",
"expires_in": 123,
"scope": "<string>"
}{
"type": "/errors/authentication-required",
"title": "Invalid client credentials",
"status": 401,
"detail": "Invalid client credentials",
"correlation_id": "2eb07802-94de-468a-b70f-75a49f3e9516"
}{
"type": "/errors/authentication-required",
"title": "Invalid client credentials",
"status": 401,
"detail": "Invalid client credentials",
"correlation_id": "2eb07802-94de-468a-b70f-75a49f3e9516"
}Autenticación
Obtener Token de Acceso
Obtener un token de acceso usando credenciales de cliente para la autenticación de la API
POST
/
api
/
v1
/
auth
/
token
cURL
curl --request POST \
--url https://api.doctacapital.com.ar/api/v1/auth/token \
--header 'Content-Type: application/json' \
--data '
{
"grant_type": "client_credentials",
"client_id": "<string>",
"client_secret": "<string>"
}
'import requests
url = "https://api.doctacapital.com.ar/api/v1/auth/token"
payload = {
"grant_type": "client_credentials",
"client_id": "<string>",
"client_secret": "<string>"
}
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({
grant_type: 'client_credentials',
client_id: '<string>',
client_secret: '<string>'
})
};
fetch('https://api.doctacapital.com.ar/api/v1/auth/token', 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.doctacapital.com.ar/api/v1/auth/token",
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([
'grant_type' => 'client_credentials',
'client_id' => '<string>',
'client_secret' => '<string>'
]),
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://api.doctacapital.com.ar/api/v1/auth/token"
payload := strings.NewReader("{\n \"grant_type\": \"client_credentials\",\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\"\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://api.doctacapital.com.ar/api/v1/auth/token")
.header("Content-Type", "application/json")
.body("{\n \"grant_type\": \"client_credentials\",\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.doctacapital.com.ar/api/v1/auth/token")
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 \"grant_type\": \"client_credentials\",\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"access_token": "<string>",
"token_type": "Bearer",
"expires_in": 123,
"scope": "<string>"
}{
"type": "/errors/authentication-required",
"title": "Invalid client credentials",
"status": 401,
"detail": "Invalid client credentials",
"correlation_id": "2eb07802-94de-468a-b70f-75a49f3e9516"
}{
"type": "/errors/authentication-required",
"title": "Invalid client credentials",
"status": 401,
"detail": "Invalid client credentials",
"correlation_id": "2eb07802-94de-468a-b70f-75a49f3e9516"
}Este endpoint se utiliza para obtener un token de acceso usando credenciales de cliente para la autenticación de la API.
Cuerpo de la Solicitud
El cuerpo de la solicitud debe contener los siguientes campos requeridos:string
required
El tipo de concesión OAuth 2.0. Debe establecerse en
client_credentials.string
required
Tu identificador de cliente proporcionado por Docta.
string
required
Tu secreto de cliente proporcionado por Docta.
Ejemplo de Solicitud
curl -X POST https://api.doctacapital.com.ar/api/v1/auth/token/ \
-H "Content-Type: application/json" \
-d '{
"grant_type": "client_credentials",
"client_id": "your-client-id",
"client_secret": "your-client-secret",
"scope": "bonds:read cedears:read stocks:read"
}'
Respuesta Exitosa
string
El token de acceso a ser usado para solicitudes posteriores de la API.
string
El tipo de token. Será
Bearer.integer
El número de segundos hasta que el token expire.
string
El alcance de acceso otorgado por este token.
string
El plan asociado al token. Puede ser
basic, professional o enterprise.Ejemplo de Respuesta Exitosa
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJwcm9kLWJhc3Rpb24tMDAxIiwiY2xpZW50X2lkIjoicHJvZC1iYXN0aW9uLTAwMSIsInNjb3BlcyI6WyJtYXJrZXRfZGF0YTpyZWFkIl0sInBsYW4iOiJlbnRlcnByaXNlIiwidG9rZW5fdHlwZSI6ImJlYXJlciIsImV4cCI6MTc1NzQ1Njg5OSwiaWF0IjoxNzU3NDUzMjk5fQ.zbvaoJLRwXFgW0aYG3DiZQM3p_4BZ3SNWj1mZEtN9wU",
"token_type": "bearer",
"expires_in": 3600,
"scope": "bonds:read cedears:read stocks:read",
"plan": "enterprise"
}
Respuesta de Error
string
El identificador del tipo de error.
string
Una breve descripción del error.
integer
El código de estado HTTP.
string
Una descripción detallada del error.
string
Un identificador único para rastrear esta solicitud de error.
Ejemplo de Respuesta de Error
{
"type": "/errors/authentication-required",
"title": "Invalid client credentials",
"status": 401,
"detail": "Invalid client credentials",
"correlation_id": "2eb07802-94de-468a-b70f-75a49f3e9516"
}
Body
application/json
Credenciales de cliente para autenticación
El tipo de concesión OAuth 2.0. Debe establecerse en client_credentials
Available options:
client_credentials Tu identificador de cliente proporcionado por Docta
Tu secreto de cliente proporcionado por Docta
Response
Token de acceso obtenido exitosamente
El token de acceso a ser usado para solicitudes posteriores de la API
El tipo de token. Será Bearer
Available options:
Bearer El número de segundos hasta que el token expire
El alcance de acceso otorgado por este token
Was this page helpful?
⌘I