cURL
curl --request GET \
--url https://api.example.com/listings/{id}import requests
url = "https://api.example.com/listings/{id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/listings/{id}', 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/listings/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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/listings/{id}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/listings/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/listings/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"id": "e4b6d4e8-8e6d-41da-abdb-8fc358a9e7f1",
"connectionId": "488fa4bd-9e19-4eb5-b461-abeb38a0f9de",
"productId": null,
"externalId": "MLB12345678",
"sku": "SKU-XPTO",
"title": "Celular Smartphone Top de Linha",
"price": 1500.00,
"stock": 10,
"status": "active",
"permalink": "https://...",
"thumbnail": "https://...",
"lastSyncedAt": "2024-02-15T10:00:00.000Z"
}
Listings
Detalhes do Anúncio
Obtém as características de um anúncio importado através do id salvo localmente no OmniDom.
GET
/
listings
/
{id}
cURL
curl --request GET \
--url https://api.example.com/listings/{id}import requests
url = "https://api.example.com/listings/{id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/listings/{id}', 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/listings/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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/listings/{id}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/listings/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/listings/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"id": "e4b6d4e8-8e6d-41da-abdb-8fc358a9e7f1",
"connectionId": "488fa4bd-9e19-4eb5-b461-abeb38a0f9de",
"productId": null,
"externalId": "MLB12345678",
"sku": "SKU-XPTO",
"title": "Celular Smartphone Top de Linha",
"price": 1500.00,
"stock": 10,
"status": "active",
"permalink": "https://...",
"thumbnail": "https://...",
"lastSyncedAt": "2024-02-15T10:00:00.000Z"
}
Path
UUID da entidade de listing local.
Response
{
"id": "e4b6d4e8-8e6d-41da-abdb-8fc358a9e7f1",
"connectionId": "488fa4bd-9e19-4eb5-b461-abeb38a0f9de",
"productId": null,
"externalId": "MLB12345678",
"sku": "SKU-XPTO",
"title": "Celular Smartphone Top de Linha",
"price": 1500.00,
"stock": 10,
"status": "active",
"permalink": "https://...",
"thumbnail": "https://...",
"lastSyncedAt": "2024-02-15T10:00:00.000Z"
}
Path Parameters
Response
200 - undefined
⌘I