Get single product details - Fabric
Get Single Product Details
cURL
curl --request GET \
--url https://marketplace-api.fabric.inc/v1/retailers/{retailer_pk}/products/{id}/ \
--header 'Authorization: Bearer <token>'
Python
import requests
url = "https://marketplace-api.fabric.inc/v1/retailers/{retailer_pk}/products/{id}/"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)
JavaScript (Fetch)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://marketplace-api.fabric.inc/v1/retailers/{retailer_pk}/products/{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://marketplace-api.fabric.inc/v1/retailers/{retailer_pk}/products/{id}/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
Go
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://marketplace-api.fabric.inc/v1/retailers/{retailer_pk}/products/{id}/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
Response Example
{
"id": 2863,
"parent_identifier": "1000-BL",
"parent_name": "T-Shirt, Blue",
"description": null,
"brand": {
"code": "marla-store",
"id": 456,
"name": "Marla Store"
},
"manufacturer": {
"code": "manu_sample_uio",
"id": 6775,
"name": "Manu Sample UIO",
"logo_url": "https://assets.demo.com/attachments/path_to_attachment/attachment.pdf",
"website": "https://assets.demo.com"
},
"num_variants": 1,
"variants": {
"id": 100024,
"name": "T-Shirt, Blue, L",
"color": "Red",
"style": "Print",
"size": "Large",
"media": [
{
"id": 249,
"url": "192.168.99.100/media/default/original"
}
]
},
"rcn_status": "not_published",
"primary_media": {
"id": 567,
"url": "https://assets.demo.com/attachments/path_to_attachment/attachment.pdf"
},
"created_at": "2022-08-10T15:24:56Z",
"updated_at": "2022-09-10T15:24:56Z"
}
Path Parameters
id: integer (required) - Product ID
retailer_pk: number (required) - Retailer ID
Authorization
Authorization: string (header, required) - Bearer authentication header of the form Bearer <token>.