Get product
curl --request GET \
--url https://api-dev.narrative.io/admin/products/{sku} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api-dev.narrative.io/admin/products/{sku}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api-dev.narrative.io/admin/products/{sku}', 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-dev.narrative.io/admin/products/{sku}",
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;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-dev.narrative.io/admin/products/{sku}"
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))
}HttpResponse<String> response = Unirest.get("https://api-dev.narrative.io/admin/products/{sku}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dev.narrative.io/admin/products/{sku}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "cd98bbb6-1086-4aea-9b5f-8ba39671a659",
"sku": "general-storage",
"sku_type": {
"category": "storage"
},
"payable_company_id": 1,
"name": "name",
"cloud_platform": {
"region": "us-east-1",
"platform": "aws"
},
"unit": "bytes",
"default_rate": {
"type": "per_unit",
"unit_price": {
"value": 1,
"expressed_in": "cents",
"currency": "USD"
}
},
"status": "active",
"created_at": "2023-02-13T12:55:24.104Z",
"created_by_user_id": 1,
"updated_at": "2023-02-13T12:55:24.104Z",
"updated_by_user_id": 1
}Products
Get product
Return single product
GET
/
admin
/
products
/
{sku}
Get product
curl --request GET \
--url https://api-dev.narrative.io/admin/products/{sku} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api-dev.narrative.io/admin/products/{sku}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api-dev.narrative.io/admin/products/{sku}', 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-dev.narrative.io/admin/products/{sku}",
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;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-dev.narrative.io/admin/products/{sku}"
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))
}HttpResponse<String> response = Unirest.get("https://api-dev.narrative.io/admin/products/{sku}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dev.narrative.io/admin/products/{sku}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "cd98bbb6-1086-4aea-9b5f-8ba39671a659",
"sku": "general-storage",
"sku_type": {
"category": "storage"
},
"payable_company_id": 1,
"name": "name",
"cloud_platform": {
"region": "us-east-1",
"platform": "aws"
},
"unit": "bytes",
"default_rate": {
"type": "per_unit",
"unit_price": {
"value": 1,
"expressed_in": "cents",
"currency": "USD"
}
},
"status": "active",
"created_at": "2023-02-13T12:55:24.104Z",
"created_by_user_id": 1,
"updated_at": "2023-02-13T12:55:24.104Z",
"updated_by_user_id": 1
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Unique identifier for a product.
Response
OK
UUID
SKU for product
Sku Type (json object, category filed is mandatory)
Show child attributes
Show child attributes
Payable company id
Product rate
Show child attributes
Show child attributes
Available options:
active, archived Cloud Platform (json object)
Show child attributes
Show child attributes
Example:
123
Example:
123
Was this page helpful?
⌘I

