Update deal
curl --request PUT \
--url https://connect.pingback.com/v2/deals/{dealId} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"contactId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"stageId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"attributes": {
"pb_name": "<string>",
"pb_amount": "<string>",
"pb_closingDate": "2023-11-07T05:31:56Z"
}
}
'import requests
url = "https://connect.pingback.com/v2/deals/{dealId}"
payload = {
"contactId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"stageId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"attributes": {
"pb_name": "<string>",
"pb_amount": "<string>",
"pb_closingDate": "2023-11-07T05:31:56Z"
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
contactId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
stageId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
attributes: {
pb_name: '<string>',
pb_amount: '<string>',
pb_closingDate: '2023-11-07T05:31:56Z'
}
})
};
fetch('https://connect.pingback.com/v2/deals/{dealId}', 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://connect.pingback.com/v2/deals/{dealId}",
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([
'contactId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'stageId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'attributes' => [
'pb_name' => '<string>',
'pb_amount' => '<string>',
'pb_closingDate' => '2023-11-07T05:31:56Z'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://connect.pingback.com/v2/deals/{dealId}"
payload := strings.NewReader("{\n \"contactId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"stageId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"attributes\": {\n \"pb_name\": \"<string>\",\n \"pb_amount\": \"<string>\",\n \"pb_closingDate\": \"2023-11-07T05:31:56Z\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://connect.pingback.com/v2/deals/{dealId}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"contactId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"stageId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"attributes\": {\n \"pb_name\": \"<string>\",\n \"pb_amount\": \"<string>\",\n \"pb_closingDate\": \"2023-11-07T05:31:56Z\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://connect.pingback.com/v2/deals/{dealId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"contactId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"stageId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"attributes\": {\n \"pb_name\": \"<string>\",\n \"pb_amount\": \"<string>\",\n \"pb_closingDate\": \"2023-11-07T05:31:56Z\"\n }\n}"
response = http.request(request)
puts response.read_body{
"message": "Deal updated",
"data": {
"id": "ea8a2a47-2a05-4a43-b284-35df0ea46333"
}
}{
"error": "Body is necessary.",
"requestId": "6795d530-07c4-43b6-8b85-dfc2cfceceb5",
"errorCode": "MISSING_BODY"
}{
"error": "User is not authorized to access this resource with an explicit deny in an identity-based policy.",
"requestId": "6795d530-07c4-43b6-8b85-dfc2cfceceb5",
"errorCode": "FORBIDDEN"
}{
"error": "Deal not found",
"requestId": "6795d530-07c4-43b6-8b85-dfc2cfceceb5",
"errorCode": "DEAL_NOT_FOUND"
}{
"error": "Contact associated with a deal",
"requestId": "6795d530-07c4-43b6-8b85-dfc2cfceceb5",
"errorCode": "CONTACT_ASSOCIATED_WITH_A_DEAL"
}{
"error": "Deal ID is missing",
"requestId": "6795d530-07c4-43b6-8b85-dfc2cfceceb5",
"errorCode": "DEAL_ID_IS_NECESSARY"
}{
"error": "An unexpected error occurred.",
"requestId": "6795d530-07c4-43b6-8b85-dfc2cfceceb5",
"errorCode": "INTERNAL_SERVER_ERROR"
}Oportunidades
Atualizar Oportunidade
Atualiza os atributos de oportunidade existente.
PUT
/
deals
/
{dealId}
Update deal
curl --request PUT \
--url https://connect.pingback.com/v2/deals/{dealId} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"contactId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"stageId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"attributes": {
"pb_name": "<string>",
"pb_amount": "<string>",
"pb_closingDate": "2023-11-07T05:31:56Z"
}
}
'import requests
url = "https://connect.pingback.com/v2/deals/{dealId}"
payload = {
"contactId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"stageId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"attributes": {
"pb_name": "<string>",
"pb_amount": "<string>",
"pb_closingDate": "2023-11-07T05:31:56Z"
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
contactId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
stageId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
attributes: {
pb_name: '<string>',
pb_amount: '<string>',
pb_closingDate: '2023-11-07T05:31:56Z'
}
})
};
fetch('https://connect.pingback.com/v2/deals/{dealId}', 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://connect.pingback.com/v2/deals/{dealId}",
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([
'contactId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'stageId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'attributes' => [
'pb_name' => '<string>',
'pb_amount' => '<string>',
'pb_closingDate' => '2023-11-07T05:31:56Z'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://connect.pingback.com/v2/deals/{dealId}"
payload := strings.NewReader("{\n \"contactId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"stageId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"attributes\": {\n \"pb_name\": \"<string>\",\n \"pb_amount\": \"<string>\",\n \"pb_closingDate\": \"2023-11-07T05:31:56Z\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://connect.pingback.com/v2/deals/{dealId}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"contactId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"stageId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"attributes\": {\n \"pb_name\": \"<string>\",\n \"pb_amount\": \"<string>\",\n \"pb_closingDate\": \"2023-11-07T05:31:56Z\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://connect.pingback.com/v2/deals/{dealId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"contactId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"stageId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"attributes\": {\n \"pb_name\": \"<string>\",\n \"pb_amount\": \"<string>\",\n \"pb_closingDate\": \"2023-11-07T05:31:56Z\"\n }\n}"
response = http.request(request)
puts response.read_body{
"message": "Deal updated",
"data": {
"id": "ea8a2a47-2a05-4a43-b284-35df0ea46333"
}
}{
"error": "Body is necessary.",
"requestId": "6795d530-07c4-43b6-8b85-dfc2cfceceb5",
"errorCode": "MISSING_BODY"
}{
"error": "User is not authorized to access this resource with an explicit deny in an identity-based policy.",
"requestId": "6795d530-07c4-43b6-8b85-dfc2cfceceb5",
"errorCode": "FORBIDDEN"
}{
"error": "Deal not found",
"requestId": "6795d530-07c4-43b6-8b85-dfc2cfceceb5",
"errorCode": "DEAL_NOT_FOUND"
}{
"error": "Contact associated with a deal",
"requestId": "6795d530-07c4-43b6-8b85-dfc2cfceceb5",
"errorCode": "CONTACT_ASSOCIATED_WITH_A_DEAL"
}{
"error": "Deal ID is missing",
"requestId": "6795d530-07c4-43b6-8b85-dfc2cfceceb5",
"errorCode": "DEAL_ID_IS_NECESSARY"
}{
"error": "An unexpected error occurred.",
"requestId": "6795d530-07c4-43b6-8b85-dfc2cfceceb5",
"errorCode": "INTERNAL_SERVER_ERROR"
}Autorizações
Parâmetros de caminho
Corpo
application/json
Esta página foi útil?
⌘I