Edita, completa o reabre una tarea del negocio
curl --request PATCH \
--url https://api.raul.ugps.io/api/v1/opportunities/{opportunityId}/tasks/{taskId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expected_version": 2,
"description": "<string>",
"due_date": "2023-11-07T05:31:56Z",
"assigned_to": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api.raul.ugps.io/api/v1/opportunities/{opportunityId}/tasks/{taskId}"
payload = {
"expected_version": 2,
"description": "<string>",
"due_date": "2023-11-07T05:31:56Z",
"assigned_to": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
expected_version: 2,
description: '<string>',
due_date: '2023-11-07T05:31:56Z',
assigned_to: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://api.raul.ugps.io/api/v1/opportunities/{opportunityId}/tasks/{taskId}', 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.raul.ugps.io/api/v1/opportunities/{opportunityId}/tasks/{taskId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'expected_version' => 2,
'description' => '<string>',
'due_date' => '2023-11-07T05:31:56Z',
'assigned_to' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
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.raul.ugps.io/api/v1/opportunities/{opportunityId}/tasks/{taskId}"
payload := strings.NewReader("{\n \"expected_version\": 2,\n \"description\": \"<string>\",\n \"due_date\": \"2023-11-07T05:31:56Z\",\n \"assigned_to\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.raul.ugps.io/api/v1/opportunities/{opportunityId}/tasks/{taskId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"expected_version\": 2,\n \"description\": \"<string>\",\n \"due_date\": \"2023-11-07T05:31:56Z\",\n \"assigned_to\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.raul.ugps.io/api/v1/opportunities/{opportunityId}/tasks/{taskId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"expected_version\": 2,\n \"description\": \"<string>\",\n \"due_date\": \"2023-11-07T05:31:56Z\",\n \"assigned_to\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"task_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"due_date": "2023-11-07T05:31:56Z",
"status": "pending",
"created_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"activity_type": {
"id": 123,
"name": "<string>"
},
"created_by": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"assignee": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"priority": "low",
"version": 123
}Opportunity Tasks
Edita, completa o reabre una tarea del negocio
Exige expected_version: si la tarea cambió desde que se leyó responde 409 sin pisar el cambio.
PATCH
/
api
/
v1
/
opportunities
/
{opportunityId}
/
tasks
/
{taskId}
Edita, completa o reabre una tarea del negocio
curl --request PATCH \
--url https://api.raul.ugps.io/api/v1/opportunities/{opportunityId}/tasks/{taskId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expected_version": 2,
"description": "<string>",
"due_date": "2023-11-07T05:31:56Z",
"assigned_to": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api.raul.ugps.io/api/v1/opportunities/{opportunityId}/tasks/{taskId}"
payload = {
"expected_version": 2,
"description": "<string>",
"due_date": "2023-11-07T05:31:56Z",
"assigned_to": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
expected_version: 2,
description: '<string>',
due_date: '2023-11-07T05:31:56Z',
assigned_to: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://api.raul.ugps.io/api/v1/opportunities/{opportunityId}/tasks/{taskId}', 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.raul.ugps.io/api/v1/opportunities/{opportunityId}/tasks/{taskId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'expected_version' => 2,
'description' => '<string>',
'due_date' => '2023-11-07T05:31:56Z',
'assigned_to' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
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.raul.ugps.io/api/v1/opportunities/{opportunityId}/tasks/{taskId}"
payload := strings.NewReader("{\n \"expected_version\": 2,\n \"description\": \"<string>\",\n \"due_date\": \"2023-11-07T05:31:56Z\",\n \"assigned_to\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.raul.ugps.io/api/v1/opportunities/{opportunityId}/tasks/{taskId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"expected_version\": 2,\n \"description\": \"<string>\",\n \"due_date\": \"2023-11-07T05:31:56Z\",\n \"assigned_to\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.raul.ugps.io/api/v1/opportunities/{opportunityId}/tasks/{taskId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"expected_version\": 2,\n \"description\": \"<string>\",\n \"due_date\": \"2023-11-07T05:31:56Z\",\n \"assigned_to\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"task_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"due_date": "2023-11-07T05:31:56Z",
"status": "pending",
"created_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"activity_type": {
"id": 123,
"name": "<string>"
},
"created_by": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"assignee": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"priority": "low",
"version": 123
}Authorizations
Token de sesión Better Auth para rutas de backoffice; las rutas de portal usan su token propio.
Body
application/json
Versión leída de la tarea
Required range:
x >= 1Maximum string length:
500Available options:
low, medium, high completed completa; pending reabre
Available options:
pending, completed Response
Available options:
pending, overdue, completed Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Available options:
low, medium, high Versión para editar sin pisar cambios ajenos