Saltar al contenido principal
PUT
/
v1
/
credentials
/
dataprev
/
oauth
Sube o rota las credenciales OAuth2 de Dataprev
curl --request PUT \
  --url https://api.example.com/v1/credentials/dataprev/oauth \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "clientId": "<string>",
  "clientSecret": "<string>"
}
'
import requests

url = "https://api.example.com/v1/credentials/dataprev/oauth"

payload = {
"clientId": "<string>",
"clientSecret": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({clientId: '<string>', clientSecret: '<string>'})
};

fetch('https://api.example.com/v1/credentials/dataprev/oauth', 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/v1/credentials/dataprev/oauth",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'clientId' => '<string>',
'clientSecret' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.example.com/v1/credentials/dataprev/oauth"

payload := strings.NewReader("{\n \"clientId\": \"<string>\",\n \"clientSecret\": \"<string>\"\n}")

req, _ := http.NewRequest("PUT", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
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.put("https://api.example.com/v1/credentials/dataprev/oauth")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"clientId\": \"<string>\",\n \"clientSecret\": \"<string>\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.example.com/v1/credentials/dataprev/oauth")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"clientId\": \"<string>\",\n \"clientSecret\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "certPresent": true,
  "oauthPresent": true,
  "provider": "<string>",
  "updatedAt": "2023-11-07T05:31:56Z",
  "certFingerprint": "<string>",
  "certNotAfter": "2023-11-07T05:31:56Z"
}
{
"code": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "about:blank"
}

Autorizaciones

Authorization
string
header
requerido

JWT bearer token issued by the identity provider.

Cuerpo

application/json
clientId
string
requerido

OAuth2 client_credentials client id.

Required string length: 1 - 512
clientSecret
string
requerido

OAuth2 client_credentials client secret.

Required string length: 1 - 4096

Respuesta

OK

certPresent
boolean
requerido

Whether a client certificate is stored for the tenant.

oauthPresent
boolean
requerido

Whether OAuth2 client_credentials are stored for the tenant.

provider
string
requerido

External rail the credentials belong to.

Ejemplo:

"dataprev"

updatedAt
string<date-time>
requerido

Last-update timestamp (RFC 3339, UTC).

Ejemplo:

"2026-06-23T12:00:00Z"

certFingerprint
string

SHA-256 hex fingerprint of the stored certificate (absent when none).

Ejemplo:

"3b1f...c0"

certNotAfter
string<date-time>

RFC 3339 cert expiry (UTC); absent when no cert is stored.

Ejemplo:

"2027-01-01T00:00:00Z"