Swagger API2Cart
POST
AccountCartAdd
{{baseUrl}}/account.cart.add.json
HEADERS
x-api-key
{{apiKey}}
BODY json
{
"3dcart_access_token": "",
"3dcart_private_key": "",
"3dcartapi_api_key": "",
"amazon_access_key_id": "",
"amazon_access_token": "",
"amazon_marketplaces_ids": "",
"amazon_secret_key": "",
"amazon_seller_id": "",
"amazon_sp_api_environment": "",
"amazon_sp_aws_region": "",
"amazon_sp_aws_role_arn": "",
"amazon_sp_aws_user_key_id": "",
"amazon_sp_aws_user_secret": "",
"amazon_sp_client_id": "",
"amazon_sp_client_secret": "",
"amazon_sp_refresh_token": "",
"aspdotnetstorefront_api_pass": "",
"aspdotnetstorefront_api_user": "",
"bigcommerceapi_access_token": "",
"bigcommerceapi_admin_account": "",
"bigcommerceapi_api_key": "",
"bigcommerceapi_api_path": "",
"bigcommerceapi_client_id": "",
"bigcommerceapi_context": "",
"bridge_url": "",
"cart_id": "",
"commercehq_api_key": "",
"commercehq_api_password": "",
"db_tables_prefix": "",
"demandware_api_password": "",
"demandware_client_id": "",
"demandware_user_name": "",
"demandware_user_password": "",
"ebay_access_token": "",
"ebay_client_id": "",
"ebay_client_secret": "",
"ebay_environment": "",
"ebay_refresh_token": "",
"ebay_runame": "",
"ebay_site_id": 0,
"ecwid_acess_token": "",
"ecwid_store_id": "",
"etsy_access_token": "",
"etsy_client_id": "",
"etsy_keystring": "",
"etsy_refresh_token": "",
"etsy_shared_secret": "",
"etsy_token_secret": "",
"ftp_host": "",
"ftp_password": "",
"ftp_port": 0,
"ftp_store_dir": "",
"ftp_user": "",
"hybris_client_id": "",
"hybris_client_secret": "",
"hybris_password": "",
"hybris_username": "",
"hybris_websites": [
{
"storeIds": [],
"uid": "",
"url": ""
}
],
"lightspeed_api_key": "",
"lightspeed_api_secret": "",
"magento_access_token": "",
"magento_consumer_key": "",
"magento_consumer_secret": "",
"magento_token_secret": "",
"mercado_libre_app_id": "",
"mercado_libre_app_secret_key": "",
"mercado_libre_refresh_token": "",
"neto_api_key": "",
"neto_api_username": "",
"prestashop_webservice_key": "",
"shopify_access_token": "",
"shopify_api_key": "",
"shopify_api_password": "",
"shopify_shared_secret": "",
"shopware_access_key": "",
"shopware_api_key": "",
"shopware_api_secret": "",
"squarespace_api_key": "",
"store_key": "",
"store_root": "",
"store_url": "",
"validate_version": false,
"verify": false,
"volusion_login": "",
"volusion_password": "",
"walmart_channel_type": "",
"walmart_client_id": "",
"walmart_client_secret": "",
"walmart_environment": "",
"wc_consumer_key": "",
"wc_consumer_secret": "",
"wix_app_id": "",
"wix_app_secret_key": "",
"wix_refresh_token": "",
"zid_access_token": "",
"zid_authorization": "",
"zid_client_id": 0,
"zid_client_secret": "",
"zid_refresh_token": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/account.cart.add.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"3dcart_access_token\": \"\",\n \"3dcart_private_key\": \"\",\n \"3dcartapi_api_key\": \"\",\n \"amazon_access_key_id\": \"\",\n \"amazon_access_token\": \"\",\n \"amazon_marketplaces_ids\": \"\",\n \"amazon_secret_key\": \"\",\n \"amazon_seller_id\": \"\",\n \"amazon_sp_api_environment\": \"\",\n \"amazon_sp_aws_region\": \"\",\n \"amazon_sp_aws_role_arn\": \"\",\n \"amazon_sp_aws_user_key_id\": \"\",\n \"amazon_sp_aws_user_secret\": \"\",\n \"amazon_sp_client_id\": \"\",\n \"amazon_sp_client_secret\": \"\",\n \"amazon_sp_refresh_token\": \"\",\n \"aspdotnetstorefront_api_pass\": \"\",\n \"aspdotnetstorefront_api_user\": \"\",\n \"bigcommerceapi_access_token\": \"\",\n \"bigcommerceapi_admin_account\": \"\",\n \"bigcommerceapi_api_key\": \"\",\n \"bigcommerceapi_api_path\": \"\",\n \"bigcommerceapi_client_id\": \"\",\n \"bigcommerceapi_context\": \"\",\n \"bridge_url\": \"\",\n \"cart_id\": \"\",\n \"commercehq_api_key\": \"\",\n \"commercehq_api_password\": \"\",\n \"db_tables_prefix\": \"\",\n \"demandware_api_password\": \"\",\n \"demandware_client_id\": \"\",\n \"demandware_user_name\": \"\",\n \"demandware_user_password\": \"\",\n \"ebay_access_token\": \"\",\n \"ebay_client_id\": \"\",\n \"ebay_client_secret\": \"\",\n \"ebay_environment\": \"\",\n \"ebay_refresh_token\": \"\",\n \"ebay_runame\": \"\",\n \"ebay_site_id\": 0,\n \"ecwid_acess_token\": \"\",\n \"ecwid_store_id\": \"\",\n \"etsy_access_token\": \"\",\n \"etsy_client_id\": \"\",\n \"etsy_keystring\": \"\",\n \"etsy_refresh_token\": \"\",\n \"etsy_shared_secret\": \"\",\n \"etsy_token_secret\": \"\",\n \"ftp_host\": \"\",\n \"ftp_password\": \"\",\n \"ftp_port\": 0,\n \"ftp_store_dir\": \"\",\n \"ftp_user\": \"\",\n \"hybris_client_id\": \"\",\n \"hybris_client_secret\": \"\",\n \"hybris_password\": \"\",\n \"hybris_username\": \"\",\n \"hybris_websites\": [\n {\n \"storeIds\": [],\n \"uid\": \"\",\n \"url\": \"\"\n }\n ],\n \"lightspeed_api_key\": \"\",\n \"lightspeed_api_secret\": \"\",\n \"magento_access_token\": \"\",\n \"magento_consumer_key\": \"\",\n \"magento_consumer_secret\": \"\",\n \"magento_token_secret\": \"\",\n \"mercado_libre_app_id\": \"\",\n \"mercado_libre_app_secret_key\": \"\",\n \"mercado_libre_refresh_token\": \"\",\n \"neto_api_key\": \"\",\n \"neto_api_username\": \"\",\n \"prestashop_webservice_key\": \"\",\n \"shopify_access_token\": \"\",\n \"shopify_api_key\": \"\",\n \"shopify_api_password\": \"\",\n \"shopify_shared_secret\": \"\",\n \"shopware_access_key\": \"\",\n \"shopware_api_key\": \"\",\n \"shopware_api_secret\": \"\",\n \"squarespace_api_key\": \"\",\n \"store_key\": \"\",\n \"store_root\": \"\",\n \"store_url\": \"\",\n \"validate_version\": false,\n \"verify\": false,\n \"volusion_login\": \"\",\n \"volusion_password\": \"\",\n \"walmart_channel_type\": \"\",\n \"walmart_client_id\": \"\",\n \"walmart_client_secret\": \"\",\n \"walmart_environment\": \"\",\n \"wc_consumer_key\": \"\",\n \"wc_consumer_secret\": \"\",\n \"wix_app_id\": \"\",\n \"wix_app_secret_key\": \"\",\n \"wix_refresh_token\": \"\",\n \"zid_access_token\": \"\",\n \"zid_authorization\": \"\",\n \"zid_client_id\": 0,\n \"zid_client_secret\": \"\",\n \"zid_refresh_token\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/account.cart.add.json" {:headers {:x-api-key "{{apiKey}}"}
:content-type :json
:form-params {:3dcart_access_token ""
:3dcart_private_key ""
:3dcartapi_api_key ""
:amazon_access_key_id ""
:amazon_access_token ""
:amazon_marketplaces_ids ""
:amazon_secret_key ""
:amazon_seller_id ""
:amazon_sp_api_environment ""
:amazon_sp_aws_region ""
:amazon_sp_aws_role_arn ""
:amazon_sp_aws_user_key_id ""
:amazon_sp_aws_user_secret ""
:amazon_sp_client_id ""
:amazon_sp_client_secret ""
:amazon_sp_refresh_token ""
:aspdotnetstorefront_api_pass ""
:aspdotnetstorefront_api_user ""
:bigcommerceapi_access_token ""
:bigcommerceapi_admin_account ""
:bigcommerceapi_api_key ""
:bigcommerceapi_api_path ""
:bigcommerceapi_client_id ""
:bigcommerceapi_context ""
:bridge_url ""
:cart_id ""
:commercehq_api_key ""
:commercehq_api_password ""
:db_tables_prefix ""
:demandware_api_password ""
:demandware_client_id ""
:demandware_user_name ""
:demandware_user_password ""
:ebay_access_token ""
:ebay_client_id ""
:ebay_client_secret ""
:ebay_environment ""
:ebay_refresh_token ""
:ebay_runame ""
:ebay_site_id 0
:ecwid_acess_token ""
:ecwid_store_id ""
:etsy_access_token ""
:etsy_client_id ""
:etsy_keystring ""
:etsy_refresh_token ""
:etsy_shared_secret ""
:etsy_token_secret ""
:ftp_host ""
:ftp_password ""
:ftp_port 0
:ftp_store_dir ""
:ftp_user ""
:hybris_client_id ""
:hybris_client_secret ""
:hybris_password ""
:hybris_username ""
:hybris_websites [{:storeIds []
:uid ""
:url ""}]
:lightspeed_api_key ""
:lightspeed_api_secret ""
:magento_access_token ""
:magento_consumer_key ""
:magento_consumer_secret ""
:magento_token_secret ""
:mercado_libre_app_id ""
:mercado_libre_app_secret_key ""
:mercado_libre_refresh_token ""
:neto_api_key ""
:neto_api_username ""
:prestashop_webservice_key ""
:shopify_access_token ""
:shopify_api_key ""
:shopify_api_password ""
:shopify_shared_secret ""
:shopware_access_key ""
:shopware_api_key ""
:shopware_api_secret ""
:squarespace_api_key ""
:store_key ""
:store_root ""
:store_url ""
:validate_version false
:verify false
:volusion_login ""
:volusion_password ""
:walmart_channel_type ""
:walmart_client_id ""
:walmart_client_secret ""
:walmart_environment ""
:wc_consumer_key ""
:wc_consumer_secret ""
:wix_app_id ""
:wix_app_secret_key ""
:wix_refresh_token ""
:zid_access_token ""
:zid_authorization ""
:zid_client_id 0
:zid_client_secret ""
:zid_refresh_token ""}})
require "http/client"
url = "{{baseUrl}}/account.cart.add.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"3dcart_access_token\": \"\",\n \"3dcart_private_key\": \"\",\n \"3dcartapi_api_key\": \"\",\n \"amazon_access_key_id\": \"\",\n \"amazon_access_token\": \"\",\n \"amazon_marketplaces_ids\": \"\",\n \"amazon_secret_key\": \"\",\n \"amazon_seller_id\": \"\",\n \"amazon_sp_api_environment\": \"\",\n \"amazon_sp_aws_region\": \"\",\n \"amazon_sp_aws_role_arn\": \"\",\n \"amazon_sp_aws_user_key_id\": \"\",\n \"amazon_sp_aws_user_secret\": \"\",\n \"amazon_sp_client_id\": \"\",\n \"amazon_sp_client_secret\": \"\",\n \"amazon_sp_refresh_token\": \"\",\n \"aspdotnetstorefront_api_pass\": \"\",\n \"aspdotnetstorefront_api_user\": \"\",\n \"bigcommerceapi_access_token\": \"\",\n \"bigcommerceapi_admin_account\": \"\",\n \"bigcommerceapi_api_key\": \"\",\n \"bigcommerceapi_api_path\": \"\",\n \"bigcommerceapi_client_id\": \"\",\n \"bigcommerceapi_context\": \"\",\n \"bridge_url\": \"\",\n \"cart_id\": \"\",\n \"commercehq_api_key\": \"\",\n \"commercehq_api_password\": \"\",\n \"db_tables_prefix\": \"\",\n \"demandware_api_password\": \"\",\n \"demandware_client_id\": \"\",\n \"demandware_user_name\": \"\",\n \"demandware_user_password\": \"\",\n \"ebay_access_token\": \"\",\n \"ebay_client_id\": \"\",\n \"ebay_client_secret\": \"\",\n \"ebay_environment\": \"\",\n \"ebay_refresh_token\": \"\",\n \"ebay_runame\": \"\",\n \"ebay_site_id\": 0,\n \"ecwid_acess_token\": \"\",\n \"ecwid_store_id\": \"\",\n \"etsy_access_token\": \"\",\n \"etsy_client_id\": \"\",\n \"etsy_keystring\": \"\",\n \"etsy_refresh_token\": \"\",\n \"etsy_shared_secret\": \"\",\n \"etsy_token_secret\": \"\",\n \"ftp_host\": \"\",\n \"ftp_password\": \"\",\n \"ftp_port\": 0,\n \"ftp_store_dir\": \"\",\n \"ftp_user\": \"\",\n \"hybris_client_id\": \"\",\n \"hybris_client_secret\": \"\",\n \"hybris_password\": \"\",\n \"hybris_username\": \"\",\n \"hybris_websites\": [\n {\n \"storeIds\": [],\n \"uid\": \"\",\n \"url\": \"\"\n }\n ],\n \"lightspeed_api_key\": \"\",\n \"lightspeed_api_secret\": \"\",\n \"magento_access_token\": \"\",\n \"magento_consumer_key\": \"\",\n \"magento_consumer_secret\": \"\",\n \"magento_token_secret\": \"\",\n \"mercado_libre_app_id\": \"\",\n \"mercado_libre_app_secret_key\": \"\",\n \"mercado_libre_refresh_token\": \"\",\n \"neto_api_key\": \"\",\n \"neto_api_username\": \"\",\n \"prestashop_webservice_key\": \"\",\n \"shopify_access_token\": \"\",\n \"shopify_api_key\": \"\",\n \"shopify_api_password\": \"\",\n \"shopify_shared_secret\": \"\",\n \"shopware_access_key\": \"\",\n \"shopware_api_key\": \"\",\n \"shopware_api_secret\": \"\",\n \"squarespace_api_key\": \"\",\n \"store_key\": \"\",\n \"store_root\": \"\",\n \"store_url\": \"\",\n \"validate_version\": false,\n \"verify\": false,\n \"volusion_login\": \"\",\n \"volusion_password\": \"\",\n \"walmart_channel_type\": \"\",\n \"walmart_client_id\": \"\",\n \"walmart_client_secret\": \"\",\n \"walmart_environment\": \"\",\n \"wc_consumer_key\": \"\",\n \"wc_consumer_secret\": \"\",\n \"wix_app_id\": \"\",\n \"wix_app_secret_key\": \"\",\n \"wix_refresh_token\": \"\",\n \"zid_access_token\": \"\",\n \"zid_authorization\": \"\",\n \"zid_client_id\": 0,\n \"zid_client_secret\": \"\",\n \"zid_refresh_token\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/account.cart.add.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
Content = new StringContent("{\n \"3dcart_access_token\": \"\",\n \"3dcart_private_key\": \"\",\n \"3dcartapi_api_key\": \"\",\n \"amazon_access_key_id\": \"\",\n \"amazon_access_token\": \"\",\n \"amazon_marketplaces_ids\": \"\",\n \"amazon_secret_key\": \"\",\n \"amazon_seller_id\": \"\",\n \"amazon_sp_api_environment\": \"\",\n \"amazon_sp_aws_region\": \"\",\n \"amazon_sp_aws_role_arn\": \"\",\n \"amazon_sp_aws_user_key_id\": \"\",\n \"amazon_sp_aws_user_secret\": \"\",\n \"amazon_sp_client_id\": \"\",\n \"amazon_sp_client_secret\": \"\",\n \"amazon_sp_refresh_token\": \"\",\n \"aspdotnetstorefront_api_pass\": \"\",\n \"aspdotnetstorefront_api_user\": \"\",\n \"bigcommerceapi_access_token\": \"\",\n \"bigcommerceapi_admin_account\": \"\",\n \"bigcommerceapi_api_key\": \"\",\n \"bigcommerceapi_api_path\": \"\",\n \"bigcommerceapi_client_id\": \"\",\n \"bigcommerceapi_context\": \"\",\n \"bridge_url\": \"\",\n \"cart_id\": \"\",\n \"commercehq_api_key\": \"\",\n \"commercehq_api_password\": \"\",\n \"db_tables_prefix\": \"\",\n \"demandware_api_password\": \"\",\n \"demandware_client_id\": \"\",\n \"demandware_user_name\": \"\",\n \"demandware_user_password\": \"\",\n \"ebay_access_token\": \"\",\n \"ebay_client_id\": \"\",\n \"ebay_client_secret\": \"\",\n \"ebay_environment\": \"\",\n \"ebay_refresh_token\": \"\",\n \"ebay_runame\": \"\",\n \"ebay_site_id\": 0,\n \"ecwid_acess_token\": \"\",\n \"ecwid_store_id\": \"\",\n \"etsy_access_token\": \"\",\n \"etsy_client_id\": \"\",\n \"etsy_keystring\": \"\",\n \"etsy_refresh_token\": \"\",\n \"etsy_shared_secret\": \"\",\n \"etsy_token_secret\": \"\",\n \"ftp_host\": \"\",\n \"ftp_password\": \"\",\n \"ftp_port\": 0,\n \"ftp_store_dir\": \"\",\n \"ftp_user\": \"\",\n \"hybris_client_id\": \"\",\n \"hybris_client_secret\": \"\",\n \"hybris_password\": \"\",\n \"hybris_username\": \"\",\n \"hybris_websites\": [\n {\n \"storeIds\": [],\n \"uid\": \"\",\n \"url\": \"\"\n }\n ],\n \"lightspeed_api_key\": \"\",\n \"lightspeed_api_secret\": \"\",\n \"magento_access_token\": \"\",\n \"magento_consumer_key\": \"\",\n \"magento_consumer_secret\": \"\",\n \"magento_token_secret\": \"\",\n \"mercado_libre_app_id\": \"\",\n \"mercado_libre_app_secret_key\": \"\",\n \"mercado_libre_refresh_token\": \"\",\n \"neto_api_key\": \"\",\n \"neto_api_username\": \"\",\n \"prestashop_webservice_key\": \"\",\n \"shopify_access_token\": \"\",\n \"shopify_api_key\": \"\",\n \"shopify_api_password\": \"\",\n \"shopify_shared_secret\": \"\",\n \"shopware_access_key\": \"\",\n \"shopware_api_key\": \"\",\n \"shopware_api_secret\": \"\",\n \"squarespace_api_key\": \"\",\n \"store_key\": \"\",\n \"store_root\": \"\",\n \"store_url\": \"\",\n \"validate_version\": false,\n \"verify\": false,\n \"volusion_login\": \"\",\n \"volusion_password\": \"\",\n \"walmart_channel_type\": \"\",\n \"walmart_client_id\": \"\",\n \"walmart_client_secret\": \"\",\n \"walmart_environment\": \"\",\n \"wc_consumer_key\": \"\",\n \"wc_consumer_secret\": \"\",\n \"wix_app_id\": \"\",\n \"wix_app_secret_key\": \"\",\n \"wix_refresh_token\": \"\",\n \"zid_access_token\": \"\",\n \"zid_authorization\": \"\",\n \"zid_client_id\": 0,\n \"zid_client_secret\": \"\",\n \"zid_refresh_token\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/account.cart.add.json");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"3dcart_access_token\": \"\",\n \"3dcart_private_key\": \"\",\n \"3dcartapi_api_key\": \"\",\n \"amazon_access_key_id\": \"\",\n \"amazon_access_token\": \"\",\n \"amazon_marketplaces_ids\": \"\",\n \"amazon_secret_key\": \"\",\n \"amazon_seller_id\": \"\",\n \"amazon_sp_api_environment\": \"\",\n \"amazon_sp_aws_region\": \"\",\n \"amazon_sp_aws_role_arn\": \"\",\n \"amazon_sp_aws_user_key_id\": \"\",\n \"amazon_sp_aws_user_secret\": \"\",\n \"amazon_sp_client_id\": \"\",\n \"amazon_sp_client_secret\": \"\",\n \"amazon_sp_refresh_token\": \"\",\n \"aspdotnetstorefront_api_pass\": \"\",\n \"aspdotnetstorefront_api_user\": \"\",\n \"bigcommerceapi_access_token\": \"\",\n \"bigcommerceapi_admin_account\": \"\",\n \"bigcommerceapi_api_key\": \"\",\n \"bigcommerceapi_api_path\": \"\",\n \"bigcommerceapi_client_id\": \"\",\n \"bigcommerceapi_context\": \"\",\n \"bridge_url\": \"\",\n \"cart_id\": \"\",\n \"commercehq_api_key\": \"\",\n \"commercehq_api_password\": \"\",\n \"db_tables_prefix\": \"\",\n \"demandware_api_password\": \"\",\n \"demandware_client_id\": \"\",\n \"demandware_user_name\": \"\",\n \"demandware_user_password\": \"\",\n \"ebay_access_token\": \"\",\n \"ebay_client_id\": \"\",\n \"ebay_client_secret\": \"\",\n \"ebay_environment\": \"\",\n \"ebay_refresh_token\": \"\",\n \"ebay_runame\": \"\",\n \"ebay_site_id\": 0,\n \"ecwid_acess_token\": \"\",\n \"ecwid_store_id\": \"\",\n \"etsy_access_token\": \"\",\n \"etsy_client_id\": \"\",\n \"etsy_keystring\": \"\",\n \"etsy_refresh_token\": \"\",\n \"etsy_shared_secret\": \"\",\n \"etsy_token_secret\": \"\",\n \"ftp_host\": \"\",\n \"ftp_password\": \"\",\n \"ftp_port\": 0,\n \"ftp_store_dir\": \"\",\n \"ftp_user\": \"\",\n \"hybris_client_id\": \"\",\n \"hybris_client_secret\": \"\",\n \"hybris_password\": \"\",\n \"hybris_username\": \"\",\n \"hybris_websites\": [\n {\n \"storeIds\": [],\n \"uid\": \"\",\n \"url\": \"\"\n }\n ],\n \"lightspeed_api_key\": \"\",\n \"lightspeed_api_secret\": \"\",\n \"magento_access_token\": \"\",\n \"magento_consumer_key\": \"\",\n \"magento_consumer_secret\": \"\",\n \"magento_token_secret\": \"\",\n \"mercado_libre_app_id\": \"\",\n \"mercado_libre_app_secret_key\": \"\",\n \"mercado_libre_refresh_token\": \"\",\n \"neto_api_key\": \"\",\n \"neto_api_username\": \"\",\n \"prestashop_webservice_key\": \"\",\n \"shopify_access_token\": \"\",\n \"shopify_api_key\": \"\",\n \"shopify_api_password\": \"\",\n \"shopify_shared_secret\": \"\",\n \"shopware_access_key\": \"\",\n \"shopware_api_key\": \"\",\n \"shopware_api_secret\": \"\",\n \"squarespace_api_key\": \"\",\n \"store_key\": \"\",\n \"store_root\": \"\",\n \"store_url\": \"\",\n \"validate_version\": false,\n \"verify\": false,\n \"volusion_login\": \"\",\n \"volusion_password\": \"\",\n \"walmart_channel_type\": \"\",\n \"walmart_client_id\": \"\",\n \"walmart_client_secret\": \"\",\n \"walmart_environment\": \"\",\n \"wc_consumer_key\": \"\",\n \"wc_consumer_secret\": \"\",\n \"wix_app_id\": \"\",\n \"wix_app_secret_key\": \"\",\n \"wix_refresh_token\": \"\",\n \"zid_access_token\": \"\",\n \"zid_authorization\": \"\",\n \"zid_client_id\": 0,\n \"zid_client_secret\": \"\",\n \"zid_refresh_token\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/account.cart.add.json"
payload := strings.NewReader("{\n \"3dcart_access_token\": \"\",\n \"3dcart_private_key\": \"\",\n \"3dcartapi_api_key\": \"\",\n \"amazon_access_key_id\": \"\",\n \"amazon_access_token\": \"\",\n \"amazon_marketplaces_ids\": \"\",\n \"amazon_secret_key\": \"\",\n \"amazon_seller_id\": \"\",\n \"amazon_sp_api_environment\": \"\",\n \"amazon_sp_aws_region\": \"\",\n \"amazon_sp_aws_role_arn\": \"\",\n \"amazon_sp_aws_user_key_id\": \"\",\n \"amazon_sp_aws_user_secret\": \"\",\n \"amazon_sp_client_id\": \"\",\n \"amazon_sp_client_secret\": \"\",\n \"amazon_sp_refresh_token\": \"\",\n \"aspdotnetstorefront_api_pass\": \"\",\n \"aspdotnetstorefront_api_user\": \"\",\n \"bigcommerceapi_access_token\": \"\",\n \"bigcommerceapi_admin_account\": \"\",\n \"bigcommerceapi_api_key\": \"\",\n \"bigcommerceapi_api_path\": \"\",\n \"bigcommerceapi_client_id\": \"\",\n \"bigcommerceapi_context\": \"\",\n \"bridge_url\": \"\",\n \"cart_id\": \"\",\n \"commercehq_api_key\": \"\",\n \"commercehq_api_password\": \"\",\n \"db_tables_prefix\": \"\",\n \"demandware_api_password\": \"\",\n \"demandware_client_id\": \"\",\n \"demandware_user_name\": \"\",\n \"demandware_user_password\": \"\",\n \"ebay_access_token\": \"\",\n \"ebay_client_id\": \"\",\n \"ebay_client_secret\": \"\",\n \"ebay_environment\": \"\",\n \"ebay_refresh_token\": \"\",\n \"ebay_runame\": \"\",\n \"ebay_site_id\": 0,\n \"ecwid_acess_token\": \"\",\n \"ecwid_store_id\": \"\",\n \"etsy_access_token\": \"\",\n \"etsy_client_id\": \"\",\n \"etsy_keystring\": \"\",\n \"etsy_refresh_token\": \"\",\n \"etsy_shared_secret\": \"\",\n \"etsy_token_secret\": \"\",\n \"ftp_host\": \"\",\n \"ftp_password\": \"\",\n \"ftp_port\": 0,\n \"ftp_store_dir\": \"\",\n \"ftp_user\": \"\",\n \"hybris_client_id\": \"\",\n \"hybris_client_secret\": \"\",\n \"hybris_password\": \"\",\n \"hybris_username\": \"\",\n \"hybris_websites\": [\n {\n \"storeIds\": [],\n \"uid\": \"\",\n \"url\": \"\"\n }\n ],\n \"lightspeed_api_key\": \"\",\n \"lightspeed_api_secret\": \"\",\n \"magento_access_token\": \"\",\n \"magento_consumer_key\": \"\",\n \"magento_consumer_secret\": \"\",\n \"magento_token_secret\": \"\",\n \"mercado_libre_app_id\": \"\",\n \"mercado_libre_app_secret_key\": \"\",\n \"mercado_libre_refresh_token\": \"\",\n \"neto_api_key\": \"\",\n \"neto_api_username\": \"\",\n \"prestashop_webservice_key\": \"\",\n \"shopify_access_token\": \"\",\n \"shopify_api_key\": \"\",\n \"shopify_api_password\": \"\",\n \"shopify_shared_secret\": \"\",\n \"shopware_access_key\": \"\",\n \"shopware_api_key\": \"\",\n \"shopware_api_secret\": \"\",\n \"squarespace_api_key\": \"\",\n \"store_key\": \"\",\n \"store_root\": \"\",\n \"store_url\": \"\",\n \"validate_version\": false,\n \"verify\": false,\n \"volusion_login\": \"\",\n \"volusion_password\": \"\",\n \"walmart_channel_type\": \"\",\n \"walmart_client_id\": \"\",\n \"walmart_client_secret\": \"\",\n \"walmart_environment\": \"\",\n \"wc_consumer_key\": \"\",\n \"wc_consumer_secret\": \"\",\n \"wix_app_id\": \"\",\n \"wix_app_secret_key\": \"\",\n \"wix_refresh_token\": \"\",\n \"zid_access_token\": \"\",\n \"zid_authorization\": \"\",\n \"zid_client_id\": 0,\n \"zid_client_secret\": \"\",\n \"zid_refresh_token\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/account.cart.add.json HTTP/1.1
X-Api-Key: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 2840
{
"3dcart_access_token": "",
"3dcart_private_key": "",
"3dcartapi_api_key": "",
"amazon_access_key_id": "",
"amazon_access_token": "",
"amazon_marketplaces_ids": "",
"amazon_secret_key": "",
"amazon_seller_id": "",
"amazon_sp_api_environment": "",
"amazon_sp_aws_region": "",
"amazon_sp_aws_role_arn": "",
"amazon_sp_aws_user_key_id": "",
"amazon_sp_aws_user_secret": "",
"amazon_sp_client_id": "",
"amazon_sp_client_secret": "",
"amazon_sp_refresh_token": "",
"aspdotnetstorefront_api_pass": "",
"aspdotnetstorefront_api_user": "",
"bigcommerceapi_access_token": "",
"bigcommerceapi_admin_account": "",
"bigcommerceapi_api_key": "",
"bigcommerceapi_api_path": "",
"bigcommerceapi_client_id": "",
"bigcommerceapi_context": "",
"bridge_url": "",
"cart_id": "",
"commercehq_api_key": "",
"commercehq_api_password": "",
"db_tables_prefix": "",
"demandware_api_password": "",
"demandware_client_id": "",
"demandware_user_name": "",
"demandware_user_password": "",
"ebay_access_token": "",
"ebay_client_id": "",
"ebay_client_secret": "",
"ebay_environment": "",
"ebay_refresh_token": "",
"ebay_runame": "",
"ebay_site_id": 0,
"ecwid_acess_token": "",
"ecwid_store_id": "",
"etsy_access_token": "",
"etsy_client_id": "",
"etsy_keystring": "",
"etsy_refresh_token": "",
"etsy_shared_secret": "",
"etsy_token_secret": "",
"ftp_host": "",
"ftp_password": "",
"ftp_port": 0,
"ftp_store_dir": "",
"ftp_user": "",
"hybris_client_id": "",
"hybris_client_secret": "",
"hybris_password": "",
"hybris_username": "",
"hybris_websites": [
{
"storeIds": [],
"uid": "",
"url": ""
}
],
"lightspeed_api_key": "",
"lightspeed_api_secret": "",
"magento_access_token": "",
"magento_consumer_key": "",
"magento_consumer_secret": "",
"magento_token_secret": "",
"mercado_libre_app_id": "",
"mercado_libre_app_secret_key": "",
"mercado_libre_refresh_token": "",
"neto_api_key": "",
"neto_api_username": "",
"prestashop_webservice_key": "",
"shopify_access_token": "",
"shopify_api_key": "",
"shopify_api_password": "",
"shopify_shared_secret": "",
"shopware_access_key": "",
"shopware_api_key": "",
"shopware_api_secret": "",
"squarespace_api_key": "",
"store_key": "",
"store_root": "",
"store_url": "",
"validate_version": false,
"verify": false,
"volusion_login": "",
"volusion_password": "",
"walmart_channel_type": "",
"walmart_client_id": "",
"walmart_client_secret": "",
"walmart_environment": "",
"wc_consumer_key": "",
"wc_consumer_secret": "",
"wix_app_id": "",
"wix_app_secret_key": "",
"wix_refresh_token": "",
"zid_access_token": "",
"zid_authorization": "",
"zid_client_id": 0,
"zid_client_secret": "",
"zid_refresh_token": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/account.cart.add.json")
.setHeader("x-api-key", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"3dcart_access_token\": \"\",\n \"3dcart_private_key\": \"\",\n \"3dcartapi_api_key\": \"\",\n \"amazon_access_key_id\": \"\",\n \"amazon_access_token\": \"\",\n \"amazon_marketplaces_ids\": \"\",\n \"amazon_secret_key\": \"\",\n \"amazon_seller_id\": \"\",\n \"amazon_sp_api_environment\": \"\",\n \"amazon_sp_aws_region\": \"\",\n \"amazon_sp_aws_role_arn\": \"\",\n \"amazon_sp_aws_user_key_id\": \"\",\n \"amazon_sp_aws_user_secret\": \"\",\n \"amazon_sp_client_id\": \"\",\n \"amazon_sp_client_secret\": \"\",\n \"amazon_sp_refresh_token\": \"\",\n \"aspdotnetstorefront_api_pass\": \"\",\n \"aspdotnetstorefront_api_user\": \"\",\n \"bigcommerceapi_access_token\": \"\",\n \"bigcommerceapi_admin_account\": \"\",\n \"bigcommerceapi_api_key\": \"\",\n \"bigcommerceapi_api_path\": \"\",\n \"bigcommerceapi_client_id\": \"\",\n \"bigcommerceapi_context\": \"\",\n \"bridge_url\": \"\",\n \"cart_id\": \"\",\n \"commercehq_api_key\": \"\",\n \"commercehq_api_password\": \"\",\n \"db_tables_prefix\": \"\",\n \"demandware_api_password\": \"\",\n \"demandware_client_id\": \"\",\n \"demandware_user_name\": \"\",\n \"demandware_user_password\": \"\",\n \"ebay_access_token\": \"\",\n \"ebay_client_id\": \"\",\n \"ebay_client_secret\": \"\",\n \"ebay_environment\": \"\",\n \"ebay_refresh_token\": \"\",\n \"ebay_runame\": \"\",\n \"ebay_site_id\": 0,\n \"ecwid_acess_token\": \"\",\n \"ecwid_store_id\": \"\",\n \"etsy_access_token\": \"\",\n \"etsy_client_id\": \"\",\n \"etsy_keystring\": \"\",\n \"etsy_refresh_token\": \"\",\n \"etsy_shared_secret\": \"\",\n \"etsy_token_secret\": \"\",\n \"ftp_host\": \"\",\n \"ftp_password\": \"\",\n \"ftp_port\": 0,\n \"ftp_store_dir\": \"\",\n \"ftp_user\": \"\",\n \"hybris_client_id\": \"\",\n \"hybris_client_secret\": \"\",\n \"hybris_password\": \"\",\n \"hybris_username\": \"\",\n \"hybris_websites\": [\n {\n \"storeIds\": [],\n \"uid\": \"\",\n \"url\": \"\"\n }\n ],\n \"lightspeed_api_key\": \"\",\n \"lightspeed_api_secret\": \"\",\n \"magento_access_token\": \"\",\n \"magento_consumer_key\": \"\",\n \"magento_consumer_secret\": \"\",\n \"magento_token_secret\": \"\",\n \"mercado_libre_app_id\": \"\",\n \"mercado_libre_app_secret_key\": \"\",\n \"mercado_libre_refresh_token\": \"\",\n \"neto_api_key\": \"\",\n \"neto_api_username\": \"\",\n \"prestashop_webservice_key\": \"\",\n \"shopify_access_token\": \"\",\n \"shopify_api_key\": \"\",\n \"shopify_api_password\": \"\",\n \"shopify_shared_secret\": \"\",\n \"shopware_access_key\": \"\",\n \"shopware_api_key\": \"\",\n \"shopware_api_secret\": \"\",\n \"squarespace_api_key\": \"\",\n \"store_key\": \"\",\n \"store_root\": \"\",\n \"store_url\": \"\",\n \"validate_version\": false,\n \"verify\": false,\n \"volusion_login\": \"\",\n \"volusion_password\": \"\",\n \"walmart_channel_type\": \"\",\n \"walmart_client_id\": \"\",\n \"walmart_client_secret\": \"\",\n \"walmart_environment\": \"\",\n \"wc_consumer_key\": \"\",\n \"wc_consumer_secret\": \"\",\n \"wix_app_id\": \"\",\n \"wix_app_secret_key\": \"\",\n \"wix_refresh_token\": \"\",\n \"zid_access_token\": \"\",\n \"zid_authorization\": \"\",\n \"zid_client_id\": 0,\n \"zid_client_secret\": \"\",\n \"zid_refresh_token\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/account.cart.add.json"))
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"3dcart_access_token\": \"\",\n \"3dcart_private_key\": \"\",\n \"3dcartapi_api_key\": \"\",\n \"amazon_access_key_id\": \"\",\n \"amazon_access_token\": \"\",\n \"amazon_marketplaces_ids\": \"\",\n \"amazon_secret_key\": \"\",\n \"amazon_seller_id\": \"\",\n \"amazon_sp_api_environment\": \"\",\n \"amazon_sp_aws_region\": \"\",\n \"amazon_sp_aws_role_arn\": \"\",\n \"amazon_sp_aws_user_key_id\": \"\",\n \"amazon_sp_aws_user_secret\": \"\",\n \"amazon_sp_client_id\": \"\",\n \"amazon_sp_client_secret\": \"\",\n \"amazon_sp_refresh_token\": \"\",\n \"aspdotnetstorefront_api_pass\": \"\",\n \"aspdotnetstorefront_api_user\": \"\",\n \"bigcommerceapi_access_token\": \"\",\n \"bigcommerceapi_admin_account\": \"\",\n \"bigcommerceapi_api_key\": \"\",\n \"bigcommerceapi_api_path\": \"\",\n \"bigcommerceapi_client_id\": \"\",\n \"bigcommerceapi_context\": \"\",\n \"bridge_url\": \"\",\n \"cart_id\": \"\",\n \"commercehq_api_key\": \"\",\n \"commercehq_api_password\": \"\",\n \"db_tables_prefix\": \"\",\n \"demandware_api_password\": \"\",\n \"demandware_client_id\": \"\",\n \"demandware_user_name\": \"\",\n \"demandware_user_password\": \"\",\n \"ebay_access_token\": \"\",\n \"ebay_client_id\": \"\",\n \"ebay_client_secret\": \"\",\n \"ebay_environment\": \"\",\n \"ebay_refresh_token\": \"\",\n \"ebay_runame\": \"\",\n \"ebay_site_id\": 0,\n \"ecwid_acess_token\": \"\",\n \"ecwid_store_id\": \"\",\n \"etsy_access_token\": \"\",\n \"etsy_client_id\": \"\",\n \"etsy_keystring\": \"\",\n \"etsy_refresh_token\": \"\",\n \"etsy_shared_secret\": \"\",\n \"etsy_token_secret\": \"\",\n \"ftp_host\": \"\",\n \"ftp_password\": \"\",\n \"ftp_port\": 0,\n \"ftp_store_dir\": \"\",\n \"ftp_user\": \"\",\n \"hybris_client_id\": \"\",\n \"hybris_client_secret\": \"\",\n \"hybris_password\": \"\",\n \"hybris_username\": \"\",\n \"hybris_websites\": [\n {\n \"storeIds\": [],\n \"uid\": \"\",\n \"url\": \"\"\n }\n ],\n \"lightspeed_api_key\": \"\",\n \"lightspeed_api_secret\": \"\",\n \"magento_access_token\": \"\",\n \"magento_consumer_key\": \"\",\n \"magento_consumer_secret\": \"\",\n \"magento_token_secret\": \"\",\n \"mercado_libre_app_id\": \"\",\n \"mercado_libre_app_secret_key\": \"\",\n \"mercado_libre_refresh_token\": \"\",\n \"neto_api_key\": \"\",\n \"neto_api_username\": \"\",\n \"prestashop_webservice_key\": \"\",\n \"shopify_access_token\": \"\",\n \"shopify_api_key\": \"\",\n \"shopify_api_password\": \"\",\n \"shopify_shared_secret\": \"\",\n \"shopware_access_key\": \"\",\n \"shopware_api_key\": \"\",\n \"shopware_api_secret\": \"\",\n \"squarespace_api_key\": \"\",\n \"store_key\": \"\",\n \"store_root\": \"\",\n \"store_url\": \"\",\n \"validate_version\": false,\n \"verify\": false,\n \"volusion_login\": \"\",\n \"volusion_password\": \"\",\n \"walmart_channel_type\": \"\",\n \"walmart_client_id\": \"\",\n \"walmart_client_secret\": \"\",\n \"walmart_environment\": \"\",\n \"wc_consumer_key\": \"\",\n \"wc_consumer_secret\": \"\",\n \"wix_app_id\": \"\",\n \"wix_app_secret_key\": \"\",\n \"wix_refresh_token\": \"\",\n \"zid_access_token\": \"\",\n \"zid_authorization\": \"\",\n \"zid_client_id\": 0,\n \"zid_client_secret\": \"\",\n \"zid_refresh_token\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"3dcart_access_token\": \"\",\n \"3dcart_private_key\": \"\",\n \"3dcartapi_api_key\": \"\",\n \"amazon_access_key_id\": \"\",\n \"amazon_access_token\": \"\",\n \"amazon_marketplaces_ids\": \"\",\n \"amazon_secret_key\": \"\",\n \"amazon_seller_id\": \"\",\n \"amazon_sp_api_environment\": \"\",\n \"amazon_sp_aws_region\": \"\",\n \"amazon_sp_aws_role_arn\": \"\",\n \"amazon_sp_aws_user_key_id\": \"\",\n \"amazon_sp_aws_user_secret\": \"\",\n \"amazon_sp_client_id\": \"\",\n \"amazon_sp_client_secret\": \"\",\n \"amazon_sp_refresh_token\": \"\",\n \"aspdotnetstorefront_api_pass\": \"\",\n \"aspdotnetstorefront_api_user\": \"\",\n \"bigcommerceapi_access_token\": \"\",\n \"bigcommerceapi_admin_account\": \"\",\n \"bigcommerceapi_api_key\": \"\",\n \"bigcommerceapi_api_path\": \"\",\n \"bigcommerceapi_client_id\": \"\",\n \"bigcommerceapi_context\": \"\",\n \"bridge_url\": \"\",\n \"cart_id\": \"\",\n \"commercehq_api_key\": \"\",\n \"commercehq_api_password\": \"\",\n \"db_tables_prefix\": \"\",\n \"demandware_api_password\": \"\",\n \"demandware_client_id\": \"\",\n \"demandware_user_name\": \"\",\n \"demandware_user_password\": \"\",\n \"ebay_access_token\": \"\",\n \"ebay_client_id\": \"\",\n \"ebay_client_secret\": \"\",\n \"ebay_environment\": \"\",\n \"ebay_refresh_token\": \"\",\n \"ebay_runame\": \"\",\n \"ebay_site_id\": 0,\n \"ecwid_acess_token\": \"\",\n \"ecwid_store_id\": \"\",\n \"etsy_access_token\": \"\",\n \"etsy_client_id\": \"\",\n \"etsy_keystring\": \"\",\n \"etsy_refresh_token\": \"\",\n \"etsy_shared_secret\": \"\",\n \"etsy_token_secret\": \"\",\n \"ftp_host\": \"\",\n \"ftp_password\": \"\",\n \"ftp_port\": 0,\n \"ftp_store_dir\": \"\",\n \"ftp_user\": \"\",\n \"hybris_client_id\": \"\",\n \"hybris_client_secret\": \"\",\n \"hybris_password\": \"\",\n \"hybris_username\": \"\",\n \"hybris_websites\": [\n {\n \"storeIds\": [],\n \"uid\": \"\",\n \"url\": \"\"\n }\n ],\n \"lightspeed_api_key\": \"\",\n \"lightspeed_api_secret\": \"\",\n \"magento_access_token\": \"\",\n \"magento_consumer_key\": \"\",\n \"magento_consumer_secret\": \"\",\n \"magento_token_secret\": \"\",\n \"mercado_libre_app_id\": \"\",\n \"mercado_libre_app_secret_key\": \"\",\n \"mercado_libre_refresh_token\": \"\",\n \"neto_api_key\": \"\",\n \"neto_api_username\": \"\",\n \"prestashop_webservice_key\": \"\",\n \"shopify_access_token\": \"\",\n \"shopify_api_key\": \"\",\n \"shopify_api_password\": \"\",\n \"shopify_shared_secret\": \"\",\n \"shopware_access_key\": \"\",\n \"shopware_api_key\": \"\",\n \"shopware_api_secret\": \"\",\n \"squarespace_api_key\": \"\",\n \"store_key\": \"\",\n \"store_root\": \"\",\n \"store_url\": \"\",\n \"validate_version\": false,\n \"verify\": false,\n \"volusion_login\": \"\",\n \"volusion_password\": \"\",\n \"walmart_channel_type\": \"\",\n \"walmart_client_id\": \"\",\n \"walmart_client_secret\": \"\",\n \"walmart_environment\": \"\",\n \"wc_consumer_key\": \"\",\n \"wc_consumer_secret\": \"\",\n \"wix_app_id\": \"\",\n \"wix_app_secret_key\": \"\",\n \"wix_refresh_token\": \"\",\n \"zid_access_token\": \"\",\n \"zid_authorization\": \"\",\n \"zid_client_id\": 0,\n \"zid_client_secret\": \"\",\n \"zid_refresh_token\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/account.cart.add.json")
.post(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/account.cart.add.json")
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"3dcart_access_token\": \"\",\n \"3dcart_private_key\": \"\",\n \"3dcartapi_api_key\": \"\",\n \"amazon_access_key_id\": \"\",\n \"amazon_access_token\": \"\",\n \"amazon_marketplaces_ids\": \"\",\n \"amazon_secret_key\": \"\",\n \"amazon_seller_id\": \"\",\n \"amazon_sp_api_environment\": \"\",\n \"amazon_sp_aws_region\": \"\",\n \"amazon_sp_aws_role_arn\": \"\",\n \"amazon_sp_aws_user_key_id\": \"\",\n \"amazon_sp_aws_user_secret\": \"\",\n \"amazon_sp_client_id\": \"\",\n \"amazon_sp_client_secret\": \"\",\n \"amazon_sp_refresh_token\": \"\",\n \"aspdotnetstorefront_api_pass\": \"\",\n \"aspdotnetstorefront_api_user\": \"\",\n \"bigcommerceapi_access_token\": \"\",\n \"bigcommerceapi_admin_account\": \"\",\n \"bigcommerceapi_api_key\": \"\",\n \"bigcommerceapi_api_path\": \"\",\n \"bigcommerceapi_client_id\": \"\",\n \"bigcommerceapi_context\": \"\",\n \"bridge_url\": \"\",\n \"cart_id\": \"\",\n \"commercehq_api_key\": \"\",\n \"commercehq_api_password\": \"\",\n \"db_tables_prefix\": \"\",\n \"demandware_api_password\": \"\",\n \"demandware_client_id\": \"\",\n \"demandware_user_name\": \"\",\n \"demandware_user_password\": \"\",\n \"ebay_access_token\": \"\",\n \"ebay_client_id\": \"\",\n \"ebay_client_secret\": \"\",\n \"ebay_environment\": \"\",\n \"ebay_refresh_token\": \"\",\n \"ebay_runame\": \"\",\n \"ebay_site_id\": 0,\n \"ecwid_acess_token\": \"\",\n \"ecwid_store_id\": \"\",\n \"etsy_access_token\": \"\",\n \"etsy_client_id\": \"\",\n \"etsy_keystring\": \"\",\n \"etsy_refresh_token\": \"\",\n \"etsy_shared_secret\": \"\",\n \"etsy_token_secret\": \"\",\n \"ftp_host\": \"\",\n \"ftp_password\": \"\",\n \"ftp_port\": 0,\n \"ftp_store_dir\": \"\",\n \"ftp_user\": \"\",\n \"hybris_client_id\": \"\",\n \"hybris_client_secret\": \"\",\n \"hybris_password\": \"\",\n \"hybris_username\": \"\",\n \"hybris_websites\": [\n {\n \"storeIds\": [],\n \"uid\": \"\",\n \"url\": \"\"\n }\n ],\n \"lightspeed_api_key\": \"\",\n \"lightspeed_api_secret\": \"\",\n \"magento_access_token\": \"\",\n \"magento_consumer_key\": \"\",\n \"magento_consumer_secret\": \"\",\n \"magento_token_secret\": \"\",\n \"mercado_libre_app_id\": \"\",\n \"mercado_libre_app_secret_key\": \"\",\n \"mercado_libre_refresh_token\": \"\",\n \"neto_api_key\": \"\",\n \"neto_api_username\": \"\",\n \"prestashop_webservice_key\": \"\",\n \"shopify_access_token\": \"\",\n \"shopify_api_key\": \"\",\n \"shopify_api_password\": \"\",\n \"shopify_shared_secret\": \"\",\n \"shopware_access_key\": \"\",\n \"shopware_api_key\": \"\",\n \"shopware_api_secret\": \"\",\n \"squarespace_api_key\": \"\",\n \"store_key\": \"\",\n \"store_root\": \"\",\n \"store_url\": \"\",\n \"validate_version\": false,\n \"verify\": false,\n \"volusion_login\": \"\",\n \"volusion_password\": \"\",\n \"walmart_channel_type\": \"\",\n \"walmart_client_id\": \"\",\n \"walmart_client_secret\": \"\",\n \"walmart_environment\": \"\",\n \"wc_consumer_key\": \"\",\n \"wc_consumer_secret\": \"\",\n \"wix_app_id\": \"\",\n \"wix_app_secret_key\": \"\",\n \"wix_refresh_token\": \"\",\n \"zid_access_token\": \"\",\n \"zid_authorization\": \"\",\n \"zid_client_id\": 0,\n \"zid_client_secret\": \"\",\n \"zid_refresh_token\": \"\"\n}")
.asString();
const data = JSON.stringify({
'3dcart_access_token': '',
'3dcart_private_key': '',
'3dcartapi_api_key': '',
amazon_access_key_id: '',
amazon_access_token: '',
amazon_marketplaces_ids: '',
amazon_secret_key: '',
amazon_seller_id: '',
amazon_sp_api_environment: '',
amazon_sp_aws_region: '',
amazon_sp_aws_role_arn: '',
amazon_sp_aws_user_key_id: '',
amazon_sp_aws_user_secret: '',
amazon_sp_client_id: '',
amazon_sp_client_secret: '',
amazon_sp_refresh_token: '',
aspdotnetstorefront_api_pass: '',
aspdotnetstorefront_api_user: '',
bigcommerceapi_access_token: '',
bigcommerceapi_admin_account: '',
bigcommerceapi_api_key: '',
bigcommerceapi_api_path: '',
bigcommerceapi_client_id: '',
bigcommerceapi_context: '',
bridge_url: '',
cart_id: '',
commercehq_api_key: '',
commercehq_api_password: '',
db_tables_prefix: '',
demandware_api_password: '',
demandware_client_id: '',
demandware_user_name: '',
demandware_user_password: '',
ebay_access_token: '',
ebay_client_id: '',
ebay_client_secret: '',
ebay_environment: '',
ebay_refresh_token: '',
ebay_runame: '',
ebay_site_id: 0,
ecwid_acess_token: '',
ecwid_store_id: '',
etsy_access_token: '',
etsy_client_id: '',
etsy_keystring: '',
etsy_refresh_token: '',
etsy_shared_secret: '',
etsy_token_secret: '',
ftp_host: '',
ftp_password: '',
ftp_port: 0,
ftp_store_dir: '',
ftp_user: '',
hybris_client_id: '',
hybris_client_secret: '',
hybris_password: '',
hybris_username: '',
hybris_websites: [
{
storeIds: [],
uid: '',
url: ''
}
],
lightspeed_api_key: '',
lightspeed_api_secret: '',
magento_access_token: '',
magento_consumer_key: '',
magento_consumer_secret: '',
magento_token_secret: '',
mercado_libre_app_id: '',
mercado_libre_app_secret_key: '',
mercado_libre_refresh_token: '',
neto_api_key: '',
neto_api_username: '',
prestashop_webservice_key: '',
shopify_access_token: '',
shopify_api_key: '',
shopify_api_password: '',
shopify_shared_secret: '',
shopware_access_key: '',
shopware_api_key: '',
shopware_api_secret: '',
squarespace_api_key: '',
store_key: '',
store_root: '',
store_url: '',
validate_version: false,
verify: false,
volusion_login: '',
volusion_password: '',
walmart_channel_type: '',
walmart_client_id: '',
walmart_client_secret: '',
walmart_environment: '',
wc_consumer_key: '',
wc_consumer_secret: '',
wix_app_id: '',
wix_app_secret_key: '',
wix_refresh_token: '',
zid_access_token: '',
zid_authorization: '',
zid_client_id: 0,
zid_client_secret: '',
zid_refresh_token: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/account.cart.add.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/account.cart.add.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {
'3dcart_access_token': '',
'3dcart_private_key': '',
'3dcartapi_api_key': '',
amazon_access_key_id: '',
amazon_access_token: '',
amazon_marketplaces_ids: '',
amazon_secret_key: '',
amazon_seller_id: '',
amazon_sp_api_environment: '',
amazon_sp_aws_region: '',
amazon_sp_aws_role_arn: '',
amazon_sp_aws_user_key_id: '',
amazon_sp_aws_user_secret: '',
amazon_sp_client_id: '',
amazon_sp_client_secret: '',
amazon_sp_refresh_token: '',
aspdotnetstorefront_api_pass: '',
aspdotnetstorefront_api_user: '',
bigcommerceapi_access_token: '',
bigcommerceapi_admin_account: '',
bigcommerceapi_api_key: '',
bigcommerceapi_api_path: '',
bigcommerceapi_client_id: '',
bigcommerceapi_context: '',
bridge_url: '',
cart_id: '',
commercehq_api_key: '',
commercehq_api_password: '',
db_tables_prefix: '',
demandware_api_password: '',
demandware_client_id: '',
demandware_user_name: '',
demandware_user_password: '',
ebay_access_token: '',
ebay_client_id: '',
ebay_client_secret: '',
ebay_environment: '',
ebay_refresh_token: '',
ebay_runame: '',
ebay_site_id: 0,
ecwid_acess_token: '',
ecwid_store_id: '',
etsy_access_token: '',
etsy_client_id: '',
etsy_keystring: '',
etsy_refresh_token: '',
etsy_shared_secret: '',
etsy_token_secret: '',
ftp_host: '',
ftp_password: '',
ftp_port: 0,
ftp_store_dir: '',
ftp_user: '',
hybris_client_id: '',
hybris_client_secret: '',
hybris_password: '',
hybris_username: '',
hybris_websites: [{storeIds: [], uid: '', url: ''}],
lightspeed_api_key: '',
lightspeed_api_secret: '',
magento_access_token: '',
magento_consumer_key: '',
magento_consumer_secret: '',
magento_token_secret: '',
mercado_libre_app_id: '',
mercado_libre_app_secret_key: '',
mercado_libre_refresh_token: '',
neto_api_key: '',
neto_api_username: '',
prestashop_webservice_key: '',
shopify_access_token: '',
shopify_api_key: '',
shopify_api_password: '',
shopify_shared_secret: '',
shopware_access_key: '',
shopware_api_key: '',
shopware_api_secret: '',
squarespace_api_key: '',
store_key: '',
store_root: '',
store_url: '',
validate_version: false,
verify: false,
volusion_login: '',
volusion_password: '',
walmart_channel_type: '',
walmart_client_id: '',
walmart_client_secret: '',
walmart_environment: '',
wc_consumer_key: '',
wc_consumer_secret: '',
wix_app_id: '',
wix_app_secret_key: '',
wix_refresh_token: '',
zid_access_token: '',
zid_authorization: '',
zid_client_id: 0,
zid_client_secret: '',
zid_refresh_token: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/account.cart.add.json';
const options = {
method: 'POST',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"3dcart_access_token":"","3dcart_private_key":"","3dcartapi_api_key":"","amazon_access_key_id":"","amazon_access_token":"","amazon_marketplaces_ids":"","amazon_secret_key":"","amazon_seller_id":"","amazon_sp_api_environment":"","amazon_sp_aws_region":"","amazon_sp_aws_role_arn":"","amazon_sp_aws_user_key_id":"","amazon_sp_aws_user_secret":"","amazon_sp_client_id":"","amazon_sp_client_secret":"","amazon_sp_refresh_token":"","aspdotnetstorefront_api_pass":"","aspdotnetstorefront_api_user":"","bigcommerceapi_access_token":"","bigcommerceapi_admin_account":"","bigcommerceapi_api_key":"","bigcommerceapi_api_path":"","bigcommerceapi_client_id":"","bigcommerceapi_context":"","bridge_url":"","cart_id":"","commercehq_api_key":"","commercehq_api_password":"","db_tables_prefix":"","demandware_api_password":"","demandware_client_id":"","demandware_user_name":"","demandware_user_password":"","ebay_access_token":"","ebay_client_id":"","ebay_client_secret":"","ebay_environment":"","ebay_refresh_token":"","ebay_runame":"","ebay_site_id":0,"ecwid_acess_token":"","ecwid_store_id":"","etsy_access_token":"","etsy_client_id":"","etsy_keystring":"","etsy_refresh_token":"","etsy_shared_secret":"","etsy_token_secret":"","ftp_host":"","ftp_password":"","ftp_port":0,"ftp_store_dir":"","ftp_user":"","hybris_client_id":"","hybris_client_secret":"","hybris_password":"","hybris_username":"","hybris_websites":[{"storeIds":[],"uid":"","url":""}],"lightspeed_api_key":"","lightspeed_api_secret":"","magento_access_token":"","magento_consumer_key":"","magento_consumer_secret":"","magento_token_secret":"","mercado_libre_app_id":"","mercado_libre_app_secret_key":"","mercado_libre_refresh_token":"","neto_api_key":"","neto_api_username":"","prestashop_webservice_key":"","shopify_access_token":"","shopify_api_key":"","shopify_api_password":"","shopify_shared_secret":"","shopware_access_key":"","shopware_api_key":"","shopware_api_secret":"","squarespace_api_key":"","store_key":"","store_root":"","store_url":"","validate_version":false,"verify":false,"volusion_login":"","volusion_password":"","walmart_channel_type":"","walmart_client_id":"","walmart_client_secret":"","walmart_environment":"","wc_consumer_key":"","wc_consumer_secret":"","wix_app_id":"","wix_app_secret_key":"","wix_refresh_token":"","zid_access_token":"","zid_authorization":"","zid_client_id":0,"zid_client_secret":"","zid_refresh_token":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/account.cart.add.json',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "3dcart_access_token": "",\n "3dcart_private_key": "",\n "3dcartapi_api_key": "",\n "amazon_access_key_id": "",\n "amazon_access_token": "",\n "amazon_marketplaces_ids": "",\n "amazon_secret_key": "",\n "amazon_seller_id": "",\n "amazon_sp_api_environment": "",\n "amazon_sp_aws_region": "",\n "amazon_sp_aws_role_arn": "",\n "amazon_sp_aws_user_key_id": "",\n "amazon_sp_aws_user_secret": "",\n "amazon_sp_client_id": "",\n "amazon_sp_client_secret": "",\n "amazon_sp_refresh_token": "",\n "aspdotnetstorefront_api_pass": "",\n "aspdotnetstorefront_api_user": "",\n "bigcommerceapi_access_token": "",\n "bigcommerceapi_admin_account": "",\n "bigcommerceapi_api_key": "",\n "bigcommerceapi_api_path": "",\n "bigcommerceapi_client_id": "",\n "bigcommerceapi_context": "",\n "bridge_url": "",\n "cart_id": "",\n "commercehq_api_key": "",\n "commercehq_api_password": "",\n "db_tables_prefix": "",\n "demandware_api_password": "",\n "demandware_client_id": "",\n "demandware_user_name": "",\n "demandware_user_password": "",\n "ebay_access_token": "",\n "ebay_client_id": "",\n "ebay_client_secret": "",\n "ebay_environment": "",\n "ebay_refresh_token": "",\n "ebay_runame": "",\n "ebay_site_id": 0,\n "ecwid_acess_token": "",\n "ecwid_store_id": "",\n "etsy_access_token": "",\n "etsy_client_id": "",\n "etsy_keystring": "",\n "etsy_refresh_token": "",\n "etsy_shared_secret": "",\n "etsy_token_secret": "",\n "ftp_host": "",\n "ftp_password": "",\n "ftp_port": 0,\n "ftp_store_dir": "",\n "ftp_user": "",\n "hybris_client_id": "",\n "hybris_client_secret": "",\n "hybris_password": "",\n "hybris_username": "",\n "hybris_websites": [\n {\n "storeIds": [],\n "uid": "",\n "url": ""\n }\n ],\n "lightspeed_api_key": "",\n "lightspeed_api_secret": "",\n "magento_access_token": "",\n "magento_consumer_key": "",\n "magento_consumer_secret": "",\n "magento_token_secret": "",\n "mercado_libre_app_id": "",\n "mercado_libre_app_secret_key": "",\n "mercado_libre_refresh_token": "",\n "neto_api_key": "",\n "neto_api_username": "",\n "prestashop_webservice_key": "",\n "shopify_access_token": "",\n "shopify_api_key": "",\n "shopify_api_password": "",\n "shopify_shared_secret": "",\n "shopware_access_key": "",\n "shopware_api_key": "",\n "shopware_api_secret": "",\n "squarespace_api_key": "",\n "store_key": "",\n "store_root": "",\n "store_url": "",\n "validate_version": false,\n "verify": false,\n "volusion_login": "",\n "volusion_password": "",\n "walmart_channel_type": "",\n "walmart_client_id": "",\n "walmart_client_secret": "",\n "walmart_environment": "",\n "wc_consumer_key": "",\n "wc_consumer_secret": "",\n "wix_app_id": "",\n "wix_app_secret_key": "",\n "wix_refresh_token": "",\n "zid_access_token": "",\n "zid_authorization": "",\n "zid_client_id": 0,\n "zid_client_secret": "",\n "zid_refresh_token": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"3dcart_access_token\": \"\",\n \"3dcart_private_key\": \"\",\n \"3dcartapi_api_key\": \"\",\n \"amazon_access_key_id\": \"\",\n \"amazon_access_token\": \"\",\n \"amazon_marketplaces_ids\": \"\",\n \"amazon_secret_key\": \"\",\n \"amazon_seller_id\": \"\",\n \"amazon_sp_api_environment\": \"\",\n \"amazon_sp_aws_region\": \"\",\n \"amazon_sp_aws_role_arn\": \"\",\n \"amazon_sp_aws_user_key_id\": \"\",\n \"amazon_sp_aws_user_secret\": \"\",\n \"amazon_sp_client_id\": \"\",\n \"amazon_sp_client_secret\": \"\",\n \"amazon_sp_refresh_token\": \"\",\n \"aspdotnetstorefront_api_pass\": \"\",\n \"aspdotnetstorefront_api_user\": \"\",\n \"bigcommerceapi_access_token\": \"\",\n \"bigcommerceapi_admin_account\": \"\",\n \"bigcommerceapi_api_key\": \"\",\n \"bigcommerceapi_api_path\": \"\",\n \"bigcommerceapi_client_id\": \"\",\n \"bigcommerceapi_context\": \"\",\n \"bridge_url\": \"\",\n \"cart_id\": \"\",\n \"commercehq_api_key\": \"\",\n \"commercehq_api_password\": \"\",\n \"db_tables_prefix\": \"\",\n \"demandware_api_password\": \"\",\n \"demandware_client_id\": \"\",\n \"demandware_user_name\": \"\",\n \"demandware_user_password\": \"\",\n \"ebay_access_token\": \"\",\n \"ebay_client_id\": \"\",\n \"ebay_client_secret\": \"\",\n \"ebay_environment\": \"\",\n \"ebay_refresh_token\": \"\",\n \"ebay_runame\": \"\",\n \"ebay_site_id\": 0,\n \"ecwid_acess_token\": \"\",\n \"ecwid_store_id\": \"\",\n \"etsy_access_token\": \"\",\n \"etsy_client_id\": \"\",\n \"etsy_keystring\": \"\",\n \"etsy_refresh_token\": \"\",\n \"etsy_shared_secret\": \"\",\n \"etsy_token_secret\": \"\",\n \"ftp_host\": \"\",\n \"ftp_password\": \"\",\n \"ftp_port\": 0,\n \"ftp_store_dir\": \"\",\n \"ftp_user\": \"\",\n \"hybris_client_id\": \"\",\n \"hybris_client_secret\": \"\",\n \"hybris_password\": \"\",\n \"hybris_username\": \"\",\n \"hybris_websites\": [\n {\n \"storeIds\": [],\n \"uid\": \"\",\n \"url\": \"\"\n }\n ],\n \"lightspeed_api_key\": \"\",\n \"lightspeed_api_secret\": \"\",\n \"magento_access_token\": \"\",\n \"magento_consumer_key\": \"\",\n \"magento_consumer_secret\": \"\",\n \"magento_token_secret\": \"\",\n \"mercado_libre_app_id\": \"\",\n \"mercado_libre_app_secret_key\": \"\",\n \"mercado_libre_refresh_token\": \"\",\n \"neto_api_key\": \"\",\n \"neto_api_username\": \"\",\n \"prestashop_webservice_key\": \"\",\n \"shopify_access_token\": \"\",\n \"shopify_api_key\": \"\",\n \"shopify_api_password\": \"\",\n \"shopify_shared_secret\": \"\",\n \"shopware_access_key\": \"\",\n \"shopware_api_key\": \"\",\n \"shopware_api_secret\": \"\",\n \"squarespace_api_key\": \"\",\n \"store_key\": \"\",\n \"store_root\": \"\",\n \"store_url\": \"\",\n \"validate_version\": false,\n \"verify\": false,\n \"volusion_login\": \"\",\n \"volusion_password\": \"\",\n \"walmart_channel_type\": \"\",\n \"walmart_client_id\": \"\",\n \"walmart_client_secret\": \"\",\n \"walmart_environment\": \"\",\n \"wc_consumer_key\": \"\",\n \"wc_consumer_secret\": \"\",\n \"wix_app_id\": \"\",\n \"wix_app_secret_key\": \"\",\n \"wix_refresh_token\": \"\",\n \"zid_access_token\": \"\",\n \"zid_authorization\": \"\",\n \"zid_client_id\": 0,\n \"zid_client_secret\": \"\",\n \"zid_refresh_token\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/account.cart.add.json")
.post(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/account.cart.add.json',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
'3dcart_access_token': '',
'3dcart_private_key': '',
'3dcartapi_api_key': '',
amazon_access_key_id: '',
amazon_access_token: '',
amazon_marketplaces_ids: '',
amazon_secret_key: '',
amazon_seller_id: '',
amazon_sp_api_environment: '',
amazon_sp_aws_region: '',
amazon_sp_aws_role_arn: '',
amazon_sp_aws_user_key_id: '',
amazon_sp_aws_user_secret: '',
amazon_sp_client_id: '',
amazon_sp_client_secret: '',
amazon_sp_refresh_token: '',
aspdotnetstorefront_api_pass: '',
aspdotnetstorefront_api_user: '',
bigcommerceapi_access_token: '',
bigcommerceapi_admin_account: '',
bigcommerceapi_api_key: '',
bigcommerceapi_api_path: '',
bigcommerceapi_client_id: '',
bigcommerceapi_context: '',
bridge_url: '',
cart_id: '',
commercehq_api_key: '',
commercehq_api_password: '',
db_tables_prefix: '',
demandware_api_password: '',
demandware_client_id: '',
demandware_user_name: '',
demandware_user_password: '',
ebay_access_token: '',
ebay_client_id: '',
ebay_client_secret: '',
ebay_environment: '',
ebay_refresh_token: '',
ebay_runame: '',
ebay_site_id: 0,
ecwid_acess_token: '',
ecwid_store_id: '',
etsy_access_token: '',
etsy_client_id: '',
etsy_keystring: '',
etsy_refresh_token: '',
etsy_shared_secret: '',
etsy_token_secret: '',
ftp_host: '',
ftp_password: '',
ftp_port: 0,
ftp_store_dir: '',
ftp_user: '',
hybris_client_id: '',
hybris_client_secret: '',
hybris_password: '',
hybris_username: '',
hybris_websites: [{storeIds: [], uid: '', url: ''}],
lightspeed_api_key: '',
lightspeed_api_secret: '',
magento_access_token: '',
magento_consumer_key: '',
magento_consumer_secret: '',
magento_token_secret: '',
mercado_libre_app_id: '',
mercado_libre_app_secret_key: '',
mercado_libre_refresh_token: '',
neto_api_key: '',
neto_api_username: '',
prestashop_webservice_key: '',
shopify_access_token: '',
shopify_api_key: '',
shopify_api_password: '',
shopify_shared_secret: '',
shopware_access_key: '',
shopware_api_key: '',
shopware_api_secret: '',
squarespace_api_key: '',
store_key: '',
store_root: '',
store_url: '',
validate_version: false,
verify: false,
volusion_login: '',
volusion_password: '',
walmart_channel_type: '',
walmart_client_id: '',
walmart_client_secret: '',
walmart_environment: '',
wc_consumer_key: '',
wc_consumer_secret: '',
wix_app_id: '',
wix_app_secret_key: '',
wix_refresh_token: '',
zid_access_token: '',
zid_authorization: '',
zid_client_id: 0,
zid_client_secret: '',
zid_refresh_token: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/account.cart.add.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: {
'3dcart_access_token': '',
'3dcart_private_key': '',
'3dcartapi_api_key': '',
amazon_access_key_id: '',
amazon_access_token: '',
amazon_marketplaces_ids: '',
amazon_secret_key: '',
amazon_seller_id: '',
amazon_sp_api_environment: '',
amazon_sp_aws_region: '',
amazon_sp_aws_role_arn: '',
amazon_sp_aws_user_key_id: '',
amazon_sp_aws_user_secret: '',
amazon_sp_client_id: '',
amazon_sp_client_secret: '',
amazon_sp_refresh_token: '',
aspdotnetstorefront_api_pass: '',
aspdotnetstorefront_api_user: '',
bigcommerceapi_access_token: '',
bigcommerceapi_admin_account: '',
bigcommerceapi_api_key: '',
bigcommerceapi_api_path: '',
bigcommerceapi_client_id: '',
bigcommerceapi_context: '',
bridge_url: '',
cart_id: '',
commercehq_api_key: '',
commercehq_api_password: '',
db_tables_prefix: '',
demandware_api_password: '',
demandware_client_id: '',
demandware_user_name: '',
demandware_user_password: '',
ebay_access_token: '',
ebay_client_id: '',
ebay_client_secret: '',
ebay_environment: '',
ebay_refresh_token: '',
ebay_runame: '',
ebay_site_id: 0,
ecwid_acess_token: '',
ecwid_store_id: '',
etsy_access_token: '',
etsy_client_id: '',
etsy_keystring: '',
etsy_refresh_token: '',
etsy_shared_secret: '',
etsy_token_secret: '',
ftp_host: '',
ftp_password: '',
ftp_port: 0,
ftp_store_dir: '',
ftp_user: '',
hybris_client_id: '',
hybris_client_secret: '',
hybris_password: '',
hybris_username: '',
hybris_websites: [{storeIds: [], uid: '', url: ''}],
lightspeed_api_key: '',
lightspeed_api_secret: '',
magento_access_token: '',
magento_consumer_key: '',
magento_consumer_secret: '',
magento_token_secret: '',
mercado_libre_app_id: '',
mercado_libre_app_secret_key: '',
mercado_libre_refresh_token: '',
neto_api_key: '',
neto_api_username: '',
prestashop_webservice_key: '',
shopify_access_token: '',
shopify_api_key: '',
shopify_api_password: '',
shopify_shared_secret: '',
shopware_access_key: '',
shopware_api_key: '',
shopware_api_secret: '',
squarespace_api_key: '',
store_key: '',
store_root: '',
store_url: '',
validate_version: false,
verify: false,
volusion_login: '',
volusion_password: '',
walmart_channel_type: '',
walmart_client_id: '',
walmart_client_secret: '',
walmart_environment: '',
wc_consumer_key: '',
wc_consumer_secret: '',
wix_app_id: '',
wix_app_secret_key: '',
wix_refresh_token: '',
zid_access_token: '',
zid_authorization: '',
zid_client_id: 0,
zid_client_secret: '',
zid_refresh_token: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/account.cart.add.json');
req.headers({
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
'3dcart_access_token': '',
'3dcart_private_key': '',
'3dcartapi_api_key': '',
amazon_access_key_id: '',
amazon_access_token: '',
amazon_marketplaces_ids: '',
amazon_secret_key: '',
amazon_seller_id: '',
amazon_sp_api_environment: '',
amazon_sp_aws_region: '',
amazon_sp_aws_role_arn: '',
amazon_sp_aws_user_key_id: '',
amazon_sp_aws_user_secret: '',
amazon_sp_client_id: '',
amazon_sp_client_secret: '',
amazon_sp_refresh_token: '',
aspdotnetstorefront_api_pass: '',
aspdotnetstorefront_api_user: '',
bigcommerceapi_access_token: '',
bigcommerceapi_admin_account: '',
bigcommerceapi_api_key: '',
bigcommerceapi_api_path: '',
bigcommerceapi_client_id: '',
bigcommerceapi_context: '',
bridge_url: '',
cart_id: '',
commercehq_api_key: '',
commercehq_api_password: '',
db_tables_prefix: '',
demandware_api_password: '',
demandware_client_id: '',
demandware_user_name: '',
demandware_user_password: '',
ebay_access_token: '',
ebay_client_id: '',
ebay_client_secret: '',
ebay_environment: '',
ebay_refresh_token: '',
ebay_runame: '',
ebay_site_id: 0,
ecwid_acess_token: '',
ecwid_store_id: '',
etsy_access_token: '',
etsy_client_id: '',
etsy_keystring: '',
etsy_refresh_token: '',
etsy_shared_secret: '',
etsy_token_secret: '',
ftp_host: '',
ftp_password: '',
ftp_port: 0,
ftp_store_dir: '',
ftp_user: '',
hybris_client_id: '',
hybris_client_secret: '',
hybris_password: '',
hybris_username: '',
hybris_websites: [
{
storeIds: [],
uid: '',
url: ''
}
],
lightspeed_api_key: '',
lightspeed_api_secret: '',
magento_access_token: '',
magento_consumer_key: '',
magento_consumer_secret: '',
magento_token_secret: '',
mercado_libre_app_id: '',
mercado_libre_app_secret_key: '',
mercado_libre_refresh_token: '',
neto_api_key: '',
neto_api_username: '',
prestashop_webservice_key: '',
shopify_access_token: '',
shopify_api_key: '',
shopify_api_password: '',
shopify_shared_secret: '',
shopware_access_key: '',
shopware_api_key: '',
shopware_api_secret: '',
squarespace_api_key: '',
store_key: '',
store_root: '',
store_url: '',
validate_version: false,
verify: false,
volusion_login: '',
volusion_password: '',
walmart_channel_type: '',
walmart_client_id: '',
walmart_client_secret: '',
walmart_environment: '',
wc_consumer_key: '',
wc_consumer_secret: '',
wix_app_id: '',
wix_app_secret_key: '',
wix_refresh_token: '',
zid_access_token: '',
zid_authorization: '',
zid_client_id: 0,
zid_client_secret: '',
zid_refresh_token: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/account.cart.add.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {
'3dcart_access_token': '',
'3dcart_private_key': '',
'3dcartapi_api_key': '',
amazon_access_key_id: '',
amazon_access_token: '',
amazon_marketplaces_ids: '',
amazon_secret_key: '',
amazon_seller_id: '',
amazon_sp_api_environment: '',
amazon_sp_aws_region: '',
amazon_sp_aws_role_arn: '',
amazon_sp_aws_user_key_id: '',
amazon_sp_aws_user_secret: '',
amazon_sp_client_id: '',
amazon_sp_client_secret: '',
amazon_sp_refresh_token: '',
aspdotnetstorefront_api_pass: '',
aspdotnetstorefront_api_user: '',
bigcommerceapi_access_token: '',
bigcommerceapi_admin_account: '',
bigcommerceapi_api_key: '',
bigcommerceapi_api_path: '',
bigcommerceapi_client_id: '',
bigcommerceapi_context: '',
bridge_url: '',
cart_id: '',
commercehq_api_key: '',
commercehq_api_password: '',
db_tables_prefix: '',
demandware_api_password: '',
demandware_client_id: '',
demandware_user_name: '',
demandware_user_password: '',
ebay_access_token: '',
ebay_client_id: '',
ebay_client_secret: '',
ebay_environment: '',
ebay_refresh_token: '',
ebay_runame: '',
ebay_site_id: 0,
ecwid_acess_token: '',
ecwid_store_id: '',
etsy_access_token: '',
etsy_client_id: '',
etsy_keystring: '',
etsy_refresh_token: '',
etsy_shared_secret: '',
etsy_token_secret: '',
ftp_host: '',
ftp_password: '',
ftp_port: 0,
ftp_store_dir: '',
ftp_user: '',
hybris_client_id: '',
hybris_client_secret: '',
hybris_password: '',
hybris_username: '',
hybris_websites: [{storeIds: [], uid: '', url: ''}],
lightspeed_api_key: '',
lightspeed_api_secret: '',
magento_access_token: '',
magento_consumer_key: '',
magento_consumer_secret: '',
magento_token_secret: '',
mercado_libre_app_id: '',
mercado_libre_app_secret_key: '',
mercado_libre_refresh_token: '',
neto_api_key: '',
neto_api_username: '',
prestashop_webservice_key: '',
shopify_access_token: '',
shopify_api_key: '',
shopify_api_password: '',
shopify_shared_secret: '',
shopware_access_key: '',
shopware_api_key: '',
shopware_api_secret: '',
squarespace_api_key: '',
store_key: '',
store_root: '',
store_url: '',
validate_version: false,
verify: false,
volusion_login: '',
volusion_password: '',
walmart_channel_type: '',
walmart_client_id: '',
walmart_client_secret: '',
walmart_environment: '',
wc_consumer_key: '',
wc_consumer_secret: '',
wix_app_id: '',
wix_app_secret_key: '',
wix_refresh_token: '',
zid_access_token: '',
zid_authorization: '',
zid_client_id: 0,
zid_client_secret: '',
zid_refresh_token: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/account.cart.add.json';
const options = {
method: 'POST',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"3dcart_access_token":"","3dcart_private_key":"","3dcartapi_api_key":"","amazon_access_key_id":"","amazon_access_token":"","amazon_marketplaces_ids":"","amazon_secret_key":"","amazon_seller_id":"","amazon_sp_api_environment":"","amazon_sp_aws_region":"","amazon_sp_aws_role_arn":"","amazon_sp_aws_user_key_id":"","amazon_sp_aws_user_secret":"","amazon_sp_client_id":"","amazon_sp_client_secret":"","amazon_sp_refresh_token":"","aspdotnetstorefront_api_pass":"","aspdotnetstorefront_api_user":"","bigcommerceapi_access_token":"","bigcommerceapi_admin_account":"","bigcommerceapi_api_key":"","bigcommerceapi_api_path":"","bigcommerceapi_client_id":"","bigcommerceapi_context":"","bridge_url":"","cart_id":"","commercehq_api_key":"","commercehq_api_password":"","db_tables_prefix":"","demandware_api_password":"","demandware_client_id":"","demandware_user_name":"","demandware_user_password":"","ebay_access_token":"","ebay_client_id":"","ebay_client_secret":"","ebay_environment":"","ebay_refresh_token":"","ebay_runame":"","ebay_site_id":0,"ecwid_acess_token":"","ecwid_store_id":"","etsy_access_token":"","etsy_client_id":"","etsy_keystring":"","etsy_refresh_token":"","etsy_shared_secret":"","etsy_token_secret":"","ftp_host":"","ftp_password":"","ftp_port":0,"ftp_store_dir":"","ftp_user":"","hybris_client_id":"","hybris_client_secret":"","hybris_password":"","hybris_username":"","hybris_websites":[{"storeIds":[],"uid":"","url":""}],"lightspeed_api_key":"","lightspeed_api_secret":"","magento_access_token":"","magento_consumer_key":"","magento_consumer_secret":"","magento_token_secret":"","mercado_libre_app_id":"","mercado_libre_app_secret_key":"","mercado_libre_refresh_token":"","neto_api_key":"","neto_api_username":"","prestashop_webservice_key":"","shopify_access_token":"","shopify_api_key":"","shopify_api_password":"","shopify_shared_secret":"","shopware_access_key":"","shopware_api_key":"","shopware_api_secret":"","squarespace_api_key":"","store_key":"","store_root":"","store_url":"","validate_version":false,"verify":false,"volusion_login":"","volusion_password":"","walmart_channel_type":"","walmart_client_id":"","walmart_client_secret":"","walmart_environment":"","wc_consumer_key":"","wc_consumer_secret":"","wix_app_id":"","wix_app_secret_key":"","wix_refresh_token":"","zid_access_token":"","zid_authorization":"","zid_client_id":0,"zid_client_secret":"","zid_refresh_token":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"3dcart_access_token": @"",
@"3dcart_private_key": @"",
@"3dcartapi_api_key": @"",
@"amazon_access_key_id": @"",
@"amazon_access_token": @"",
@"amazon_marketplaces_ids": @"",
@"amazon_secret_key": @"",
@"amazon_seller_id": @"",
@"amazon_sp_api_environment": @"",
@"amazon_sp_aws_region": @"",
@"amazon_sp_aws_role_arn": @"",
@"amazon_sp_aws_user_key_id": @"",
@"amazon_sp_aws_user_secret": @"",
@"amazon_sp_client_id": @"",
@"amazon_sp_client_secret": @"",
@"amazon_sp_refresh_token": @"",
@"aspdotnetstorefront_api_pass": @"",
@"aspdotnetstorefront_api_user": @"",
@"bigcommerceapi_access_token": @"",
@"bigcommerceapi_admin_account": @"",
@"bigcommerceapi_api_key": @"",
@"bigcommerceapi_api_path": @"",
@"bigcommerceapi_client_id": @"",
@"bigcommerceapi_context": @"",
@"bridge_url": @"",
@"cart_id": @"",
@"commercehq_api_key": @"",
@"commercehq_api_password": @"",
@"db_tables_prefix": @"",
@"demandware_api_password": @"",
@"demandware_client_id": @"",
@"demandware_user_name": @"",
@"demandware_user_password": @"",
@"ebay_access_token": @"",
@"ebay_client_id": @"",
@"ebay_client_secret": @"",
@"ebay_environment": @"",
@"ebay_refresh_token": @"",
@"ebay_runame": @"",
@"ebay_site_id": @0,
@"ecwid_acess_token": @"",
@"ecwid_store_id": @"",
@"etsy_access_token": @"",
@"etsy_client_id": @"",
@"etsy_keystring": @"",
@"etsy_refresh_token": @"",
@"etsy_shared_secret": @"",
@"etsy_token_secret": @"",
@"ftp_host": @"",
@"ftp_password": @"",
@"ftp_port": @0,
@"ftp_store_dir": @"",
@"ftp_user": @"",
@"hybris_client_id": @"",
@"hybris_client_secret": @"",
@"hybris_password": @"",
@"hybris_username": @"",
@"hybris_websites": @[ @{ @"storeIds": @[ ], @"uid": @"", @"url": @"" } ],
@"lightspeed_api_key": @"",
@"lightspeed_api_secret": @"",
@"magento_access_token": @"",
@"magento_consumer_key": @"",
@"magento_consumer_secret": @"",
@"magento_token_secret": @"",
@"mercado_libre_app_id": @"",
@"mercado_libre_app_secret_key": @"",
@"mercado_libre_refresh_token": @"",
@"neto_api_key": @"",
@"neto_api_username": @"",
@"prestashop_webservice_key": @"",
@"shopify_access_token": @"",
@"shopify_api_key": @"",
@"shopify_api_password": @"",
@"shopify_shared_secret": @"",
@"shopware_access_key": @"",
@"shopware_api_key": @"",
@"shopware_api_secret": @"",
@"squarespace_api_key": @"",
@"store_key": @"",
@"store_root": @"",
@"store_url": @"",
@"validate_version": @NO,
@"verify": @NO,
@"volusion_login": @"",
@"volusion_password": @"",
@"walmart_channel_type": @"",
@"walmart_client_id": @"",
@"walmart_client_secret": @"",
@"walmart_environment": @"",
@"wc_consumer_key": @"",
@"wc_consumer_secret": @"",
@"wix_app_id": @"",
@"wix_app_secret_key": @"",
@"wix_refresh_token": @"",
@"zid_access_token": @"",
@"zid_authorization": @"",
@"zid_client_id": @0,
@"zid_client_secret": @"",
@"zid_refresh_token": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/account.cart.add.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/account.cart.add.json" in
let headers = Header.add_list (Header.init ()) [
("x-api-key", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"3dcart_access_token\": \"\",\n \"3dcart_private_key\": \"\",\n \"3dcartapi_api_key\": \"\",\n \"amazon_access_key_id\": \"\",\n \"amazon_access_token\": \"\",\n \"amazon_marketplaces_ids\": \"\",\n \"amazon_secret_key\": \"\",\n \"amazon_seller_id\": \"\",\n \"amazon_sp_api_environment\": \"\",\n \"amazon_sp_aws_region\": \"\",\n \"amazon_sp_aws_role_arn\": \"\",\n \"amazon_sp_aws_user_key_id\": \"\",\n \"amazon_sp_aws_user_secret\": \"\",\n \"amazon_sp_client_id\": \"\",\n \"amazon_sp_client_secret\": \"\",\n \"amazon_sp_refresh_token\": \"\",\n \"aspdotnetstorefront_api_pass\": \"\",\n \"aspdotnetstorefront_api_user\": \"\",\n \"bigcommerceapi_access_token\": \"\",\n \"bigcommerceapi_admin_account\": \"\",\n \"bigcommerceapi_api_key\": \"\",\n \"bigcommerceapi_api_path\": \"\",\n \"bigcommerceapi_client_id\": \"\",\n \"bigcommerceapi_context\": \"\",\n \"bridge_url\": \"\",\n \"cart_id\": \"\",\n \"commercehq_api_key\": \"\",\n \"commercehq_api_password\": \"\",\n \"db_tables_prefix\": \"\",\n \"demandware_api_password\": \"\",\n \"demandware_client_id\": \"\",\n \"demandware_user_name\": \"\",\n \"demandware_user_password\": \"\",\n \"ebay_access_token\": \"\",\n \"ebay_client_id\": \"\",\n \"ebay_client_secret\": \"\",\n \"ebay_environment\": \"\",\n \"ebay_refresh_token\": \"\",\n \"ebay_runame\": \"\",\n \"ebay_site_id\": 0,\n \"ecwid_acess_token\": \"\",\n \"ecwid_store_id\": \"\",\n \"etsy_access_token\": \"\",\n \"etsy_client_id\": \"\",\n \"etsy_keystring\": \"\",\n \"etsy_refresh_token\": \"\",\n \"etsy_shared_secret\": \"\",\n \"etsy_token_secret\": \"\",\n \"ftp_host\": \"\",\n \"ftp_password\": \"\",\n \"ftp_port\": 0,\n \"ftp_store_dir\": \"\",\n \"ftp_user\": \"\",\n \"hybris_client_id\": \"\",\n \"hybris_client_secret\": \"\",\n \"hybris_password\": \"\",\n \"hybris_username\": \"\",\n \"hybris_websites\": [\n {\n \"storeIds\": [],\n \"uid\": \"\",\n \"url\": \"\"\n }\n ],\n \"lightspeed_api_key\": \"\",\n \"lightspeed_api_secret\": \"\",\n \"magento_access_token\": \"\",\n \"magento_consumer_key\": \"\",\n \"magento_consumer_secret\": \"\",\n \"magento_token_secret\": \"\",\n \"mercado_libre_app_id\": \"\",\n \"mercado_libre_app_secret_key\": \"\",\n \"mercado_libre_refresh_token\": \"\",\n \"neto_api_key\": \"\",\n \"neto_api_username\": \"\",\n \"prestashop_webservice_key\": \"\",\n \"shopify_access_token\": \"\",\n \"shopify_api_key\": \"\",\n \"shopify_api_password\": \"\",\n \"shopify_shared_secret\": \"\",\n \"shopware_access_key\": \"\",\n \"shopware_api_key\": \"\",\n \"shopware_api_secret\": \"\",\n \"squarespace_api_key\": \"\",\n \"store_key\": \"\",\n \"store_root\": \"\",\n \"store_url\": \"\",\n \"validate_version\": false,\n \"verify\": false,\n \"volusion_login\": \"\",\n \"volusion_password\": \"\",\n \"walmart_channel_type\": \"\",\n \"walmart_client_id\": \"\",\n \"walmart_client_secret\": \"\",\n \"walmart_environment\": \"\",\n \"wc_consumer_key\": \"\",\n \"wc_consumer_secret\": \"\",\n \"wix_app_id\": \"\",\n \"wix_app_secret_key\": \"\",\n \"wix_refresh_token\": \"\",\n \"zid_access_token\": \"\",\n \"zid_authorization\": \"\",\n \"zid_client_id\": 0,\n \"zid_client_secret\": \"\",\n \"zid_refresh_token\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/account.cart.add.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'3dcart_access_token' => '',
'3dcart_private_key' => '',
'3dcartapi_api_key' => '',
'amazon_access_key_id' => '',
'amazon_access_token' => '',
'amazon_marketplaces_ids' => '',
'amazon_secret_key' => '',
'amazon_seller_id' => '',
'amazon_sp_api_environment' => '',
'amazon_sp_aws_region' => '',
'amazon_sp_aws_role_arn' => '',
'amazon_sp_aws_user_key_id' => '',
'amazon_sp_aws_user_secret' => '',
'amazon_sp_client_id' => '',
'amazon_sp_client_secret' => '',
'amazon_sp_refresh_token' => '',
'aspdotnetstorefront_api_pass' => '',
'aspdotnetstorefront_api_user' => '',
'bigcommerceapi_access_token' => '',
'bigcommerceapi_admin_account' => '',
'bigcommerceapi_api_key' => '',
'bigcommerceapi_api_path' => '',
'bigcommerceapi_client_id' => '',
'bigcommerceapi_context' => '',
'bridge_url' => '',
'cart_id' => '',
'commercehq_api_key' => '',
'commercehq_api_password' => '',
'db_tables_prefix' => '',
'demandware_api_password' => '',
'demandware_client_id' => '',
'demandware_user_name' => '',
'demandware_user_password' => '',
'ebay_access_token' => '',
'ebay_client_id' => '',
'ebay_client_secret' => '',
'ebay_environment' => '',
'ebay_refresh_token' => '',
'ebay_runame' => '',
'ebay_site_id' => 0,
'ecwid_acess_token' => '',
'ecwid_store_id' => '',
'etsy_access_token' => '',
'etsy_client_id' => '',
'etsy_keystring' => '',
'etsy_refresh_token' => '',
'etsy_shared_secret' => '',
'etsy_token_secret' => '',
'ftp_host' => '',
'ftp_password' => '',
'ftp_port' => 0,
'ftp_store_dir' => '',
'ftp_user' => '',
'hybris_client_id' => '',
'hybris_client_secret' => '',
'hybris_password' => '',
'hybris_username' => '',
'hybris_websites' => [
[
'storeIds' => [
],
'uid' => '',
'url' => ''
]
],
'lightspeed_api_key' => '',
'lightspeed_api_secret' => '',
'magento_access_token' => '',
'magento_consumer_key' => '',
'magento_consumer_secret' => '',
'magento_token_secret' => '',
'mercado_libre_app_id' => '',
'mercado_libre_app_secret_key' => '',
'mercado_libre_refresh_token' => '',
'neto_api_key' => '',
'neto_api_username' => '',
'prestashop_webservice_key' => '',
'shopify_access_token' => '',
'shopify_api_key' => '',
'shopify_api_password' => '',
'shopify_shared_secret' => '',
'shopware_access_key' => '',
'shopware_api_key' => '',
'shopware_api_secret' => '',
'squarespace_api_key' => '',
'store_key' => '',
'store_root' => '',
'store_url' => '',
'validate_version' => null,
'verify' => null,
'volusion_login' => '',
'volusion_password' => '',
'walmart_channel_type' => '',
'walmart_client_id' => '',
'walmart_client_secret' => '',
'walmart_environment' => '',
'wc_consumer_key' => '',
'wc_consumer_secret' => '',
'wix_app_id' => '',
'wix_app_secret_key' => '',
'wix_refresh_token' => '',
'zid_access_token' => '',
'zid_authorization' => '',
'zid_client_id' => 0,
'zid_client_secret' => '',
'zid_refresh_token' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/account.cart.add.json', [
'body' => '{
"3dcart_access_token": "",
"3dcart_private_key": "",
"3dcartapi_api_key": "",
"amazon_access_key_id": "",
"amazon_access_token": "",
"amazon_marketplaces_ids": "",
"amazon_secret_key": "",
"amazon_seller_id": "",
"amazon_sp_api_environment": "",
"amazon_sp_aws_region": "",
"amazon_sp_aws_role_arn": "",
"amazon_sp_aws_user_key_id": "",
"amazon_sp_aws_user_secret": "",
"amazon_sp_client_id": "",
"amazon_sp_client_secret": "",
"amazon_sp_refresh_token": "",
"aspdotnetstorefront_api_pass": "",
"aspdotnetstorefront_api_user": "",
"bigcommerceapi_access_token": "",
"bigcommerceapi_admin_account": "",
"bigcommerceapi_api_key": "",
"bigcommerceapi_api_path": "",
"bigcommerceapi_client_id": "",
"bigcommerceapi_context": "",
"bridge_url": "",
"cart_id": "",
"commercehq_api_key": "",
"commercehq_api_password": "",
"db_tables_prefix": "",
"demandware_api_password": "",
"demandware_client_id": "",
"demandware_user_name": "",
"demandware_user_password": "",
"ebay_access_token": "",
"ebay_client_id": "",
"ebay_client_secret": "",
"ebay_environment": "",
"ebay_refresh_token": "",
"ebay_runame": "",
"ebay_site_id": 0,
"ecwid_acess_token": "",
"ecwid_store_id": "",
"etsy_access_token": "",
"etsy_client_id": "",
"etsy_keystring": "",
"etsy_refresh_token": "",
"etsy_shared_secret": "",
"etsy_token_secret": "",
"ftp_host": "",
"ftp_password": "",
"ftp_port": 0,
"ftp_store_dir": "",
"ftp_user": "",
"hybris_client_id": "",
"hybris_client_secret": "",
"hybris_password": "",
"hybris_username": "",
"hybris_websites": [
{
"storeIds": [],
"uid": "",
"url": ""
}
],
"lightspeed_api_key": "",
"lightspeed_api_secret": "",
"magento_access_token": "",
"magento_consumer_key": "",
"magento_consumer_secret": "",
"magento_token_secret": "",
"mercado_libre_app_id": "",
"mercado_libre_app_secret_key": "",
"mercado_libre_refresh_token": "",
"neto_api_key": "",
"neto_api_username": "",
"prestashop_webservice_key": "",
"shopify_access_token": "",
"shopify_api_key": "",
"shopify_api_password": "",
"shopify_shared_secret": "",
"shopware_access_key": "",
"shopware_api_key": "",
"shopware_api_secret": "",
"squarespace_api_key": "",
"store_key": "",
"store_root": "",
"store_url": "",
"validate_version": false,
"verify": false,
"volusion_login": "",
"volusion_password": "",
"walmart_channel_type": "",
"walmart_client_id": "",
"walmart_client_secret": "",
"walmart_environment": "",
"wc_consumer_key": "",
"wc_consumer_secret": "",
"wix_app_id": "",
"wix_app_secret_key": "",
"wix_refresh_token": "",
"zid_access_token": "",
"zid_authorization": "",
"zid_client_id": 0,
"zid_client_secret": "",
"zid_refresh_token": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/account.cart.add.json');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'3dcart_access_token' => '',
'3dcart_private_key' => '',
'3dcartapi_api_key' => '',
'amazon_access_key_id' => '',
'amazon_access_token' => '',
'amazon_marketplaces_ids' => '',
'amazon_secret_key' => '',
'amazon_seller_id' => '',
'amazon_sp_api_environment' => '',
'amazon_sp_aws_region' => '',
'amazon_sp_aws_role_arn' => '',
'amazon_sp_aws_user_key_id' => '',
'amazon_sp_aws_user_secret' => '',
'amazon_sp_client_id' => '',
'amazon_sp_client_secret' => '',
'amazon_sp_refresh_token' => '',
'aspdotnetstorefront_api_pass' => '',
'aspdotnetstorefront_api_user' => '',
'bigcommerceapi_access_token' => '',
'bigcommerceapi_admin_account' => '',
'bigcommerceapi_api_key' => '',
'bigcommerceapi_api_path' => '',
'bigcommerceapi_client_id' => '',
'bigcommerceapi_context' => '',
'bridge_url' => '',
'cart_id' => '',
'commercehq_api_key' => '',
'commercehq_api_password' => '',
'db_tables_prefix' => '',
'demandware_api_password' => '',
'demandware_client_id' => '',
'demandware_user_name' => '',
'demandware_user_password' => '',
'ebay_access_token' => '',
'ebay_client_id' => '',
'ebay_client_secret' => '',
'ebay_environment' => '',
'ebay_refresh_token' => '',
'ebay_runame' => '',
'ebay_site_id' => 0,
'ecwid_acess_token' => '',
'ecwid_store_id' => '',
'etsy_access_token' => '',
'etsy_client_id' => '',
'etsy_keystring' => '',
'etsy_refresh_token' => '',
'etsy_shared_secret' => '',
'etsy_token_secret' => '',
'ftp_host' => '',
'ftp_password' => '',
'ftp_port' => 0,
'ftp_store_dir' => '',
'ftp_user' => '',
'hybris_client_id' => '',
'hybris_client_secret' => '',
'hybris_password' => '',
'hybris_username' => '',
'hybris_websites' => [
[
'storeIds' => [
],
'uid' => '',
'url' => ''
]
],
'lightspeed_api_key' => '',
'lightspeed_api_secret' => '',
'magento_access_token' => '',
'magento_consumer_key' => '',
'magento_consumer_secret' => '',
'magento_token_secret' => '',
'mercado_libre_app_id' => '',
'mercado_libre_app_secret_key' => '',
'mercado_libre_refresh_token' => '',
'neto_api_key' => '',
'neto_api_username' => '',
'prestashop_webservice_key' => '',
'shopify_access_token' => '',
'shopify_api_key' => '',
'shopify_api_password' => '',
'shopify_shared_secret' => '',
'shopware_access_key' => '',
'shopware_api_key' => '',
'shopware_api_secret' => '',
'squarespace_api_key' => '',
'store_key' => '',
'store_root' => '',
'store_url' => '',
'validate_version' => null,
'verify' => null,
'volusion_login' => '',
'volusion_password' => '',
'walmart_channel_type' => '',
'walmart_client_id' => '',
'walmart_client_secret' => '',
'walmart_environment' => '',
'wc_consumer_key' => '',
'wc_consumer_secret' => '',
'wix_app_id' => '',
'wix_app_secret_key' => '',
'wix_refresh_token' => '',
'zid_access_token' => '',
'zid_authorization' => '',
'zid_client_id' => 0,
'zid_client_secret' => '',
'zid_refresh_token' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'3dcart_access_token' => '',
'3dcart_private_key' => '',
'3dcartapi_api_key' => '',
'amazon_access_key_id' => '',
'amazon_access_token' => '',
'amazon_marketplaces_ids' => '',
'amazon_secret_key' => '',
'amazon_seller_id' => '',
'amazon_sp_api_environment' => '',
'amazon_sp_aws_region' => '',
'amazon_sp_aws_role_arn' => '',
'amazon_sp_aws_user_key_id' => '',
'amazon_sp_aws_user_secret' => '',
'amazon_sp_client_id' => '',
'amazon_sp_client_secret' => '',
'amazon_sp_refresh_token' => '',
'aspdotnetstorefront_api_pass' => '',
'aspdotnetstorefront_api_user' => '',
'bigcommerceapi_access_token' => '',
'bigcommerceapi_admin_account' => '',
'bigcommerceapi_api_key' => '',
'bigcommerceapi_api_path' => '',
'bigcommerceapi_client_id' => '',
'bigcommerceapi_context' => '',
'bridge_url' => '',
'cart_id' => '',
'commercehq_api_key' => '',
'commercehq_api_password' => '',
'db_tables_prefix' => '',
'demandware_api_password' => '',
'demandware_client_id' => '',
'demandware_user_name' => '',
'demandware_user_password' => '',
'ebay_access_token' => '',
'ebay_client_id' => '',
'ebay_client_secret' => '',
'ebay_environment' => '',
'ebay_refresh_token' => '',
'ebay_runame' => '',
'ebay_site_id' => 0,
'ecwid_acess_token' => '',
'ecwid_store_id' => '',
'etsy_access_token' => '',
'etsy_client_id' => '',
'etsy_keystring' => '',
'etsy_refresh_token' => '',
'etsy_shared_secret' => '',
'etsy_token_secret' => '',
'ftp_host' => '',
'ftp_password' => '',
'ftp_port' => 0,
'ftp_store_dir' => '',
'ftp_user' => '',
'hybris_client_id' => '',
'hybris_client_secret' => '',
'hybris_password' => '',
'hybris_username' => '',
'hybris_websites' => [
[
'storeIds' => [
],
'uid' => '',
'url' => ''
]
],
'lightspeed_api_key' => '',
'lightspeed_api_secret' => '',
'magento_access_token' => '',
'magento_consumer_key' => '',
'magento_consumer_secret' => '',
'magento_token_secret' => '',
'mercado_libre_app_id' => '',
'mercado_libre_app_secret_key' => '',
'mercado_libre_refresh_token' => '',
'neto_api_key' => '',
'neto_api_username' => '',
'prestashop_webservice_key' => '',
'shopify_access_token' => '',
'shopify_api_key' => '',
'shopify_api_password' => '',
'shopify_shared_secret' => '',
'shopware_access_key' => '',
'shopware_api_key' => '',
'shopware_api_secret' => '',
'squarespace_api_key' => '',
'store_key' => '',
'store_root' => '',
'store_url' => '',
'validate_version' => null,
'verify' => null,
'volusion_login' => '',
'volusion_password' => '',
'walmart_channel_type' => '',
'walmart_client_id' => '',
'walmart_client_secret' => '',
'walmart_environment' => '',
'wc_consumer_key' => '',
'wc_consumer_secret' => '',
'wix_app_id' => '',
'wix_app_secret_key' => '',
'wix_refresh_token' => '',
'zid_access_token' => '',
'zid_authorization' => '',
'zid_client_id' => 0,
'zid_client_secret' => '',
'zid_refresh_token' => ''
]));
$request->setRequestUrl('{{baseUrl}}/account.cart.add.json');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/account.cart.add.json' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"3dcart_access_token": "",
"3dcart_private_key": "",
"3dcartapi_api_key": "",
"amazon_access_key_id": "",
"amazon_access_token": "",
"amazon_marketplaces_ids": "",
"amazon_secret_key": "",
"amazon_seller_id": "",
"amazon_sp_api_environment": "",
"amazon_sp_aws_region": "",
"amazon_sp_aws_role_arn": "",
"amazon_sp_aws_user_key_id": "",
"amazon_sp_aws_user_secret": "",
"amazon_sp_client_id": "",
"amazon_sp_client_secret": "",
"amazon_sp_refresh_token": "",
"aspdotnetstorefront_api_pass": "",
"aspdotnetstorefront_api_user": "",
"bigcommerceapi_access_token": "",
"bigcommerceapi_admin_account": "",
"bigcommerceapi_api_key": "",
"bigcommerceapi_api_path": "",
"bigcommerceapi_client_id": "",
"bigcommerceapi_context": "",
"bridge_url": "",
"cart_id": "",
"commercehq_api_key": "",
"commercehq_api_password": "",
"db_tables_prefix": "",
"demandware_api_password": "",
"demandware_client_id": "",
"demandware_user_name": "",
"demandware_user_password": "",
"ebay_access_token": "",
"ebay_client_id": "",
"ebay_client_secret": "",
"ebay_environment": "",
"ebay_refresh_token": "",
"ebay_runame": "",
"ebay_site_id": 0,
"ecwid_acess_token": "",
"ecwid_store_id": "",
"etsy_access_token": "",
"etsy_client_id": "",
"etsy_keystring": "",
"etsy_refresh_token": "",
"etsy_shared_secret": "",
"etsy_token_secret": "",
"ftp_host": "",
"ftp_password": "",
"ftp_port": 0,
"ftp_store_dir": "",
"ftp_user": "",
"hybris_client_id": "",
"hybris_client_secret": "",
"hybris_password": "",
"hybris_username": "",
"hybris_websites": [
{
"storeIds": [],
"uid": "",
"url": ""
}
],
"lightspeed_api_key": "",
"lightspeed_api_secret": "",
"magento_access_token": "",
"magento_consumer_key": "",
"magento_consumer_secret": "",
"magento_token_secret": "",
"mercado_libre_app_id": "",
"mercado_libre_app_secret_key": "",
"mercado_libre_refresh_token": "",
"neto_api_key": "",
"neto_api_username": "",
"prestashop_webservice_key": "",
"shopify_access_token": "",
"shopify_api_key": "",
"shopify_api_password": "",
"shopify_shared_secret": "",
"shopware_access_key": "",
"shopware_api_key": "",
"shopware_api_secret": "",
"squarespace_api_key": "",
"store_key": "",
"store_root": "",
"store_url": "",
"validate_version": false,
"verify": false,
"volusion_login": "",
"volusion_password": "",
"walmart_channel_type": "",
"walmart_client_id": "",
"walmart_client_secret": "",
"walmart_environment": "",
"wc_consumer_key": "",
"wc_consumer_secret": "",
"wix_app_id": "",
"wix_app_secret_key": "",
"wix_refresh_token": "",
"zid_access_token": "",
"zid_authorization": "",
"zid_client_id": 0,
"zid_client_secret": "",
"zid_refresh_token": ""
}'
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/account.cart.add.json' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"3dcart_access_token": "",
"3dcart_private_key": "",
"3dcartapi_api_key": "",
"amazon_access_key_id": "",
"amazon_access_token": "",
"amazon_marketplaces_ids": "",
"amazon_secret_key": "",
"amazon_seller_id": "",
"amazon_sp_api_environment": "",
"amazon_sp_aws_region": "",
"amazon_sp_aws_role_arn": "",
"amazon_sp_aws_user_key_id": "",
"amazon_sp_aws_user_secret": "",
"amazon_sp_client_id": "",
"amazon_sp_client_secret": "",
"amazon_sp_refresh_token": "",
"aspdotnetstorefront_api_pass": "",
"aspdotnetstorefront_api_user": "",
"bigcommerceapi_access_token": "",
"bigcommerceapi_admin_account": "",
"bigcommerceapi_api_key": "",
"bigcommerceapi_api_path": "",
"bigcommerceapi_client_id": "",
"bigcommerceapi_context": "",
"bridge_url": "",
"cart_id": "",
"commercehq_api_key": "",
"commercehq_api_password": "",
"db_tables_prefix": "",
"demandware_api_password": "",
"demandware_client_id": "",
"demandware_user_name": "",
"demandware_user_password": "",
"ebay_access_token": "",
"ebay_client_id": "",
"ebay_client_secret": "",
"ebay_environment": "",
"ebay_refresh_token": "",
"ebay_runame": "",
"ebay_site_id": 0,
"ecwid_acess_token": "",
"ecwid_store_id": "",
"etsy_access_token": "",
"etsy_client_id": "",
"etsy_keystring": "",
"etsy_refresh_token": "",
"etsy_shared_secret": "",
"etsy_token_secret": "",
"ftp_host": "",
"ftp_password": "",
"ftp_port": 0,
"ftp_store_dir": "",
"ftp_user": "",
"hybris_client_id": "",
"hybris_client_secret": "",
"hybris_password": "",
"hybris_username": "",
"hybris_websites": [
{
"storeIds": [],
"uid": "",
"url": ""
}
],
"lightspeed_api_key": "",
"lightspeed_api_secret": "",
"magento_access_token": "",
"magento_consumer_key": "",
"magento_consumer_secret": "",
"magento_token_secret": "",
"mercado_libre_app_id": "",
"mercado_libre_app_secret_key": "",
"mercado_libre_refresh_token": "",
"neto_api_key": "",
"neto_api_username": "",
"prestashop_webservice_key": "",
"shopify_access_token": "",
"shopify_api_key": "",
"shopify_api_password": "",
"shopify_shared_secret": "",
"shopware_access_key": "",
"shopware_api_key": "",
"shopware_api_secret": "",
"squarespace_api_key": "",
"store_key": "",
"store_root": "",
"store_url": "",
"validate_version": false,
"verify": false,
"volusion_login": "",
"volusion_password": "",
"walmart_channel_type": "",
"walmart_client_id": "",
"walmart_client_secret": "",
"walmart_environment": "",
"wc_consumer_key": "",
"wc_consumer_secret": "",
"wix_app_id": "",
"wix_app_secret_key": "",
"wix_refresh_token": "",
"zid_access_token": "",
"zid_authorization": "",
"zid_client_id": 0,
"zid_client_secret": "",
"zid_refresh_token": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"3dcart_access_token\": \"\",\n \"3dcart_private_key\": \"\",\n \"3dcartapi_api_key\": \"\",\n \"amazon_access_key_id\": \"\",\n \"amazon_access_token\": \"\",\n \"amazon_marketplaces_ids\": \"\",\n \"amazon_secret_key\": \"\",\n \"amazon_seller_id\": \"\",\n \"amazon_sp_api_environment\": \"\",\n \"amazon_sp_aws_region\": \"\",\n \"amazon_sp_aws_role_arn\": \"\",\n \"amazon_sp_aws_user_key_id\": \"\",\n \"amazon_sp_aws_user_secret\": \"\",\n \"amazon_sp_client_id\": \"\",\n \"amazon_sp_client_secret\": \"\",\n \"amazon_sp_refresh_token\": \"\",\n \"aspdotnetstorefront_api_pass\": \"\",\n \"aspdotnetstorefront_api_user\": \"\",\n \"bigcommerceapi_access_token\": \"\",\n \"bigcommerceapi_admin_account\": \"\",\n \"bigcommerceapi_api_key\": \"\",\n \"bigcommerceapi_api_path\": \"\",\n \"bigcommerceapi_client_id\": \"\",\n \"bigcommerceapi_context\": \"\",\n \"bridge_url\": \"\",\n \"cart_id\": \"\",\n \"commercehq_api_key\": \"\",\n \"commercehq_api_password\": \"\",\n \"db_tables_prefix\": \"\",\n \"demandware_api_password\": \"\",\n \"demandware_client_id\": \"\",\n \"demandware_user_name\": \"\",\n \"demandware_user_password\": \"\",\n \"ebay_access_token\": \"\",\n \"ebay_client_id\": \"\",\n \"ebay_client_secret\": \"\",\n \"ebay_environment\": \"\",\n \"ebay_refresh_token\": \"\",\n \"ebay_runame\": \"\",\n \"ebay_site_id\": 0,\n \"ecwid_acess_token\": \"\",\n \"ecwid_store_id\": \"\",\n \"etsy_access_token\": \"\",\n \"etsy_client_id\": \"\",\n \"etsy_keystring\": \"\",\n \"etsy_refresh_token\": \"\",\n \"etsy_shared_secret\": \"\",\n \"etsy_token_secret\": \"\",\n \"ftp_host\": \"\",\n \"ftp_password\": \"\",\n \"ftp_port\": 0,\n \"ftp_store_dir\": \"\",\n \"ftp_user\": \"\",\n \"hybris_client_id\": \"\",\n \"hybris_client_secret\": \"\",\n \"hybris_password\": \"\",\n \"hybris_username\": \"\",\n \"hybris_websites\": [\n {\n \"storeIds\": [],\n \"uid\": \"\",\n \"url\": \"\"\n }\n ],\n \"lightspeed_api_key\": \"\",\n \"lightspeed_api_secret\": \"\",\n \"magento_access_token\": \"\",\n \"magento_consumer_key\": \"\",\n \"magento_consumer_secret\": \"\",\n \"magento_token_secret\": \"\",\n \"mercado_libre_app_id\": \"\",\n \"mercado_libre_app_secret_key\": \"\",\n \"mercado_libre_refresh_token\": \"\",\n \"neto_api_key\": \"\",\n \"neto_api_username\": \"\",\n \"prestashop_webservice_key\": \"\",\n \"shopify_access_token\": \"\",\n \"shopify_api_key\": \"\",\n \"shopify_api_password\": \"\",\n \"shopify_shared_secret\": \"\",\n \"shopware_access_key\": \"\",\n \"shopware_api_key\": \"\",\n \"shopware_api_secret\": \"\",\n \"squarespace_api_key\": \"\",\n \"store_key\": \"\",\n \"store_root\": \"\",\n \"store_url\": \"\",\n \"validate_version\": false,\n \"verify\": false,\n \"volusion_login\": \"\",\n \"volusion_password\": \"\",\n \"walmart_channel_type\": \"\",\n \"walmart_client_id\": \"\",\n \"walmart_client_secret\": \"\",\n \"walmart_environment\": \"\",\n \"wc_consumer_key\": \"\",\n \"wc_consumer_secret\": \"\",\n \"wix_app_id\": \"\",\n \"wix_app_secret_key\": \"\",\n \"wix_refresh_token\": \"\",\n \"zid_access_token\": \"\",\n \"zid_authorization\": \"\",\n \"zid_client_id\": 0,\n \"zid_client_secret\": \"\",\n \"zid_refresh_token\": \"\"\n}"
headers = {
'x-api-key': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/account.cart.add.json", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/account.cart.add.json"
payload = {
"3dcart_access_token": "",
"3dcart_private_key": "",
"3dcartapi_api_key": "",
"amazon_access_key_id": "",
"amazon_access_token": "",
"amazon_marketplaces_ids": "",
"amazon_secret_key": "",
"amazon_seller_id": "",
"amazon_sp_api_environment": "",
"amazon_sp_aws_region": "",
"amazon_sp_aws_role_arn": "",
"amazon_sp_aws_user_key_id": "",
"amazon_sp_aws_user_secret": "",
"amazon_sp_client_id": "",
"amazon_sp_client_secret": "",
"amazon_sp_refresh_token": "",
"aspdotnetstorefront_api_pass": "",
"aspdotnetstorefront_api_user": "",
"bigcommerceapi_access_token": "",
"bigcommerceapi_admin_account": "",
"bigcommerceapi_api_key": "",
"bigcommerceapi_api_path": "",
"bigcommerceapi_client_id": "",
"bigcommerceapi_context": "",
"bridge_url": "",
"cart_id": "",
"commercehq_api_key": "",
"commercehq_api_password": "",
"db_tables_prefix": "",
"demandware_api_password": "",
"demandware_client_id": "",
"demandware_user_name": "",
"demandware_user_password": "",
"ebay_access_token": "",
"ebay_client_id": "",
"ebay_client_secret": "",
"ebay_environment": "",
"ebay_refresh_token": "",
"ebay_runame": "",
"ebay_site_id": 0,
"ecwid_acess_token": "",
"ecwid_store_id": "",
"etsy_access_token": "",
"etsy_client_id": "",
"etsy_keystring": "",
"etsy_refresh_token": "",
"etsy_shared_secret": "",
"etsy_token_secret": "",
"ftp_host": "",
"ftp_password": "",
"ftp_port": 0,
"ftp_store_dir": "",
"ftp_user": "",
"hybris_client_id": "",
"hybris_client_secret": "",
"hybris_password": "",
"hybris_username": "",
"hybris_websites": [
{
"storeIds": [],
"uid": "",
"url": ""
}
],
"lightspeed_api_key": "",
"lightspeed_api_secret": "",
"magento_access_token": "",
"magento_consumer_key": "",
"magento_consumer_secret": "",
"magento_token_secret": "",
"mercado_libre_app_id": "",
"mercado_libre_app_secret_key": "",
"mercado_libre_refresh_token": "",
"neto_api_key": "",
"neto_api_username": "",
"prestashop_webservice_key": "",
"shopify_access_token": "",
"shopify_api_key": "",
"shopify_api_password": "",
"shopify_shared_secret": "",
"shopware_access_key": "",
"shopware_api_key": "",
"shopware_api_secret": "",
"squarespace_api_key": "",
"store_key": "",
"store_root": "",
"store_url": "",
"validate_version": False,
"verify": False,
"volusion_login": "",
"volusion_password": "",
"walmart_channel_type": "",
"walmart_client_id": "",
"walmart_client_secret": "",
"walmart_environment": "",
"wc_consumer_key": "",
"wc_consumer_secret": "",
"wix_app_id": "",
"wix_app_secret_key": "",
"wix_refresh_token": "",
"zid_access_token": "",
"zid_authorization": "",
"zid_client_id": 0,
"zid_client_secret": "",
"zid_refresh_token": ""
}
headers = {
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/account.cart.add.json"
payload <- "{\n \"3dcart_access_token\": \"\",\n \"3dcart_private_key\": \"\",\n \"3dcartapi_api_key\": \"\",\n \"amazon_access_key_id\": \"\",\n \"amazon_access_token\": \"\",\n \"amazon_marketplaces_ids\": \"\",\n \"amazon_secret_key\": \"\",\n \"amazon_seller_id\": \"\",\n \"amazon_sp_api_environment\": \"\",\n \"amazon_sp_aws_region\": \"\",\n \"amazon_sp_aws_role_arn\": \"\",\n \"amazon_sp_aws_user_key_id\": \"\",\n \"amazon_sp_aws_user_secret\": \"\",\n \"amazon_sp_client_id\": \"\",\n \"amazon_sp_client_secret\": \"\",\n \"amazon_sp_refresh_token\": \"\",\n \"aspdotnetstorefront_api_pass\": \"\",\n \"aspdotnetstorefront_api_user\": \"\",\n \"bigcommerceapi_access_token\": \"\",\n \"bigcommerceapi_admin_account\": \"\",\n \"bigcommerceapi_api_key\": \"\",\n \"bigcommerceapi_api_path\": \"\",\n \"bigcommerceapi_client_id\": \"\",\n \"bigcommerceapi_context\": \"\",\n \"bridge_url\": \"\",\n \"cart_id\": \"\",\n \"commercehq_api_key\": \"\",\n \"commercehq_api_password\": \"\",\n \"db_tables_prefix\": \"\",\n \"demandware_api_password\": \"\",\n \"demandware_client_id\": \"\",\n \"demandware_user_name\": \"\",\n \"demandware_user_password\": \"\",\n \"ebay_access_token\": \"\",\n \"ebay_client_id\": \"\",\n \"ebay_client_secret\": \"\",\n \"ebay_environment\": \"\",\n \"ebay_refresh_token\": \"\",\n \"ebay_runame\": \"\",\n \"ebay_site_id\": 0,\n \"ecwid_acess_token\": \"\",\n \"ecwid_store_id\": \"\",\n \"etsy_access_token\": \"\",\n \"etsy_client_id\": \"\",\n \"etsy_keystring\": \"\",\n \"etsy_refresh_token\": \"\",\n \"etsy_shared_secret\": \"\",\n \"etsy_token_secret\": \"\",\n \"ftp_host\": \"\",\n \"ftp_password\": \"\",\n \"ftp_port\": 0,\n \"ftp_store_dir\": \"\",\n \"ftp_user\": \"\",\n \"hybris_client_id\": \"\",\n \"hybris_client_secret\": \"\",\n \"hybris_password\": \"\",\n \"hybris_username\": \"\",\n \"hybris_websites\": [\n {\n \"storeIds\": [],\n \"uid\": \"\",\n \"url\": \"\"\n }\n ],\n \"lightspeed_api_key\": \"\",\n \"lightspeed_api_secret\": \"\",\n \"magento_access_token\": \"\",\n \"magento_consumer_key\": \"\",\n \"magento_consumer_secret\": \"\",\n \"magento_token_secret\": \"\",\n \"mercado_libre_app_id\": \"\",\n \"mercado_libre_app_secret_key\": \"\",\n \"mercado_libre_refresh_token\": \"\",\n \"neto_api_key\": \"\",\n \"neto_api_username\": \"\",\n \"prestashop_webservice_key\": \"\",\n \"shopify_access_token\": \"\",\n \"shopify_api_key\": \"\",\n \"shopify_api_password\": \"\",\n \"shopify_shared_secret\": \"\",\n \"shopware_access_key\": \"\",\n \"shopware_api_key\": \"\",\n \"shopware_api_secret\": \"\",\n \"squarespace_api_key\": \"\",\n \"store_key\": \"\",\n \"store_root\": \"\",\n \"store_url\": \"\",\n \"validate_version\": false,\n \"verify\": false,\n \"volusion_login\": \"\",\n \"volusion_password\": \"\",\n \"walmart_channel_type\": \"\",\n \"walmart_client_id\": \"\",\n \"walmart_client_secret\": \"\",\n \"walmart_environment\": \"\",\n \"wc_consumer_key\": \"\",\n \"wc_consumer_secret\": \"\",\n \"wix_app_id\": \"\",\n \"wix_app_secret_key\": \"\",\n \"wix_refresh_token\": \"\",\n \"zid_access_token\": \"\",\n \"zid_authorization\": \"\",\n \"zid_client_id\": 0,\n \"zid_client_secret\": \"\",\n \"zid_refresh_token\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/account.cart.add.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"3dcart_access_token\": \"\",\n \"3dcart_private_key\": \"\",\n \"3dcartapi_api_key\": \"\",\n \"amazon_access_key_id\": \"\",\n \"amazon_access_token\": \"\",\n \"amazon_marketplaces_ids\": \"\",\n \"amazon_secret_key\": \"\",\n \"amazon_seller_id\": \"\",\n \"amazon_sp_api_environment\": \"\",\n \"amazon_sp_aws_region\": \"\",\n \"amazon_sp_aws_role_arn\": \"\",\n \"amazon_sp_aws_user_key_id\": \"\",\n \"amazon_sp_aws_user_secret\": \"\",\n \"amazon_sp_client_id\": \"\",\n \"amazon_sp_client_secret\": \"\",\n \"amazon_sp_refresh_token\": \"\",\n \"aspdotnetstorefront_api_pass\": \"\",\n \"aspdotnetstorefront_api_user\": \"\",\n \"bigcommerceapi_access_token\": \"\",\n \"bigcommerceapi_admin_account\": \"\",\n \"bigcommerceapi_api_key\": \"\",\n \"bigcommerceapi_api_path\": \"\",\n \"bigcommerceapi_client_id\": \"\",\n \"bigcommerceapi_context\": \"\",\n \"bridge_url\": \"\",\n \"cart_id\": \"\",\n \"commercehq_api_key\": \"\",\n \"commercehq_api_password\": \"\",\n \"db_tables_prefix\": \"\",\n \"demandware_api_password\": \"\",\n \"demandware_client_id\": \"\",\n \"demandware_user_name\": \"\",\n \"demandware_user_password\": \"\",\n \"ebay_access_token\": \"\",\n \"ebay_client_id\": \"\",\n \"ebay_client_secret\": \"\",\n \"ebay_environment\": \"\",\n \"ebay_refresh_token\": \"\",\n \"ebay_runame\": \"\",\n \"ebay_site_id\": 0,\n \"ecwid_acess_token\": \"\",\n \"ecwid_store_id\": \"\",\n \"etsy_access_token\": \"\",\n \"etsy_client_id\": \"\",\n \"etsy_keystring\": \"\",\n \"etsy_refresh_token\": \"\",\n \"etsy_shared_secret\": \"\",\n \"etsy_token_secret\": \"\",\n \"ftp_host\": \"\",\n \"ftp_password\": \"\",\n \"ftp_port\": 0,\n \"ftp_store_dir\": \"\",\n \"ftp_user\": \"\",\n \"hybris_client_id\": \"\",\n \"hybris_client_secret\": \"\",\n \"hybris_password\": \"\",\n \"hybris_username\": \"\",\n \"hybris_websites\": [\n {\n \"storeIds\": [],\n \"uid\": \"\",\n \"url\": \"\"\n }\n ],\n \"lightspeed_api_key\": \"\",\n \"lightspeed_api_secret\": \"\",\n \"magento_access_token\": \"\",\n \"magento_consumer_key\": \"\",\n \"magento_consumer_secret\": \"\",\n \"magento_token_secret\": \"\",\n \"mercado_libre_app_id\": \"\",\n \"mercado_libre_app_secret_key\": \"\",\n \"mercado_libre_refresh_token\": \"\",\n \"neto_api_key\": \"\",\n \"neto_api_username\": \"\",\n \"prestashop_webservice_key\": \"\",\n \"shopify_access_token\": \"\",\n \"shopify_api_key\": \"\",\n \"shopify_api_password\": \"\",\n \"shopify_shared_secret\": \"\",\n \"shopware_access_key\": \"\",\n \"shopware_api_key\": \"\",\n \"shopware_api_secret\": \"\",\n \"squarespace_api_key\": \"\",\n \"store_key\": \"\",\n \"store_root\": \"\",\n \"store_url\": \"\",\n \"validate_version\": false,\n \"verify\": false,\n \"volusion_login\": \"\",\n \"volusion_password\": \"\",\n \"walmart_channel_type\": \"\",\n \"walmart_client_id\": \"\",\n \"walmart_client_secret\": \"\",\n \"walmart_environment\": \"\",\n \"wc_consumer_key\": \"\",\n \"wc_consumer_secret\": \"\",\n \"wix_app_id\": \"\",\n \"wix_app_secret_key\": \"\",\n \"wix_refresh_token\": \"\",\n \"zid_access_token\": \"\",\n \"zid_authorization\": \"\",\n \"zid_client_id\": 0,\n \"zid_client_secret\": \"\",\n \"zid_refresh_token\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/account.cart.add.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.body = "{\n \"3dcart_access_token\": \"\",\n \"3dcart_private_key\": \"\",\n \"3dcartapi_api_key\": \"\",\n \"amazon_access_key_id\": \"\",\n \"amazon_access_token\": \"\",\n \"amazon_marketplaces_ids\": \"\",\n \"amazon_secret_key\": \"\",\n \"amazon_seller_id\": \"\",\n \"amazon_sp_api_environment\": \"\",\n \"amazon_sp_aws_region\": \"\",\n \"amazon_sp_aws_role_arn\": \"\",\n \"amazon_sp_aws_user_key_id\": \"\",\n \"amazon_sp_aws_user_secret\": \"\",\n \"amazon_sp_client_id\": \"\",\n \"amazon_sp_client_secret\": \"\",\n \"amazon_sp_refresh_token\": \"\",\n \"aspdotnetstorefront_api_pass\": \"\",\n \"aspdotnetstorefront_api_user\": \"\",\n \"bigcommerceapi_access_token\": \"\",\n \"bigcommerceapi_admin_account\": \"\",\n \"bigcommerceapi_api_key\": \"\",\n \"bigcommerceapi_api_path\": \"\",\n \"bigcommerceapi_client_id\": \"\",\n \"bigcommerceapi_context\": \"\",\n \"bridge_url\": \"\",\n \"cart_id\": \"\",\n \"commercehq_api_key\": \"\",\n \"commercehq_api_password\": \"\",\n \"db_tables_prefix\": \"\",\n \"demandware_api_password\": \"\",\n \"demandware_client_id\": \"\",\n \"demandware_user_name\": \"\",\n \"demandware_user_password\": \"\",\n \"ebay_access_token\": \"\",\n \"ebay_client_id\": \"\",\n \"ebay_client_secret\": \"\",\n \"ebay_environment\": \"\",\n \"ebay_refresh_token\": \"\",\n \"ebay_runame\": \"\",\n \"ebay_site_id\": 0,\n \"ecwid_acess_token\": \"\",\n \"ecwid_store_id\": \"\",\n \"etsy_access_token\": \"\",\n \"etsy_client_id\": \"\",\n \"etsy_keystring\": \"\",\n \"etsy_refresh_token\": \"\",\n \"etsy_shared_secret\": \"\",\n \"etsy_token_secret\": \"\",\n \"ftp_host\": \"\",\n \"ftp_password\": \"\",\n \"ftp_port\": 0,\n \"ftp_store_dir\": \"\",\n \"ftp_user\": \"\",\n \"hybris_client_id\": \"\",\n \"hybris_client_secret\": \"\",\n \"hybris_password\": \"\",\n \"hybris_username\": \"\",\n \"hybris_websites\": [\n {\n \"storeIds\": [],\n \"uid\": \"\",\n \"url\": \"\"\n }\n ],\n \"lightspeed_api_key\": \"\",\n \"lightspeed_api_secret\": \"\",\n \"magento_access_token\": \"\",\n \"magento_consumer_key\": \"\",\n \"magento_consumer_secret\": \"\",\n \"magento_token_secret\": \"\",\n \"mercado_libre_app_id\": \"\",\n \"mercado_libre_app_secret_key\": \"\",\n \"mercado_libre_refresh_token\": \"\",\n \"neto_api_key\": \"\",\n \"neto_api_username\": \"\",\n \"prestashop_webservice_key\": \"\",\n \"shopify_access_token\": \"\",\n \"shopify_api_key\": \"\",\n \"shopify_api_password\": \"\",\n \"shopify_shared_secret\": \"\",\n \"shopware_access_key\": \"\",\n \"shopware_api_key\": \"\",\n \"shopware_api_secret\": \"\",\n \"squarespace_api_key\": \"\",\n \"store_key\": \"\",\n \"store_root\": \"\",\n \"store_url\": \"\",\n \"validate_version\": false,\n \"verify\": false,\n \"volusion_login\": \"\",\n \"volusion_password\": \"\",\n \"walmart_channel_type\": \"\",\n \"walmart_client_id\": \"\",\n \"walmart_client_secret\": \"\",\n \"walmart_environment\": \"\",\n \"wc_consumer_key\": \"\",\n \"wc_consumer_secret\": \"\",\n \"wix_app_id\": \"\",\n \"wix_app_secret_key\": \"\",\n \"wix_refresh_token\": \"\",\n \"zid_access_token\": \"\",\n \"zid_authorization\": \"\",\n \"zid_client_id\": 0,\n \"zid_client_secret\": \"\",\n \"zid_refresh_token\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/account.cart.add.json";
let payload = json!({
"3dcart_access_token": "",
"3dcart_private_key": "",
"3dcartapi_api_key": "",
"amazon_access_key_id": "",
"amazon_access_token": "",
"amazon_marketplaces_ids": "",
"amazon_secret_key": "",
"amazon_seller_id": "",
"amazon_sp_api_environment": "",
"amazon_sp_aws_region": "",
"amazon_sp_aws_role_arn": "",
"amazon_sp_aws_user_key_id": "",
"amazon_sp_aws_user_secret": "",
"amazon_sp_client_id": "",
"amazon_sp_client_secret": "",
"amazon_sp_refresh_token": "",
"aspdotnetstorefront_api_pass": "",
"aspdotnetstorefront_api_user": "",
"bigcommerceapi_access_token": "",
"bigcommerceapi_admin_account": "",
"bigcommerceapi_api_key": "",
"bigcommerceapi_api_path": "",
"bigcommerceapi_client_id": "",
"bigcommerceapi_context": "",
"bridge_url": "",
"cart_id": "",
"commercehq_api_key": "",
"commercehq_api_password": "",
"db_tables_prefix": "",
"demandware_api_password": "",
"demandware_client_id": "",
"demandware_user_name": "",
"demandware_user_password": "",
"ebay_access_token": "",
"ebay_client_id": "",
"ebay_client_secret": "",
"ebay_environment": "",
"ebay_refresh_token": "",
"ebay_runame": "",
"ebay_site_id": 0,
"ecwid_acess_token": "",
"ecwid_store_id": "",
"etsy_access_token": "",
"etsy_client_id": "",
"etsy_keystring": "",
"etsy_refresh_token": "",
"etsy_shared_secret": "",
"etsy_token_secret": "",
"ftp_host": "",
"ftp_password": "",
"ftp_port": 0,
"ftp_store_dir": "",
"ftp_user": "",
"hybris_client_id": "",
"hybris_client_secret": "",
"hybris_password": "",
"hybris_username": "",
"hybris_websites": (
json!({
"storeIds": (),
"uid": "",
"url": ""
})
),
"lightspeed_api_key": "",
"lightspeed_api_secret": "",
"magento_access_token": "",
"magento_consumer_key": "",
"magento_consumer_secret": "",
"magento_token_secret": "",
"mercado_libre_app_id": "",
"mercado_libre_app_secret_key": "",
"mercado_libre_refresh_token": "",
"neto_api_key": "",
"neto_api_username": "",
"prestashop_webservice_key": "",
"shopify_access_token": "",
"shopify_api_key": "",
"shopify_api_password": "",
"shopify_shared_secret": "",
"shopware_access_key": "",
"shopware_api_key": "",
"shopware_api_secret": "",
"squarespace_api_key": "",
"store_key": "",
"store_root": "",
"store_url": "",
"validate_version": false,
"verify": false,
"volusion_login": "",
"volusion_password": "",
"walmart_channel_type": "",
"walmart_client_id": "",
"walmart_client_secret": "",
"walmart_environment": "",
"wc_consumer_key": "",
"wc_consumer_secret": "",
"wix_app_id": "",
"wix_app_secret_key": "",
"wix_refresh_token": "",
"zid_access_token": "",
"zid_authorization": "",
"zid_client_id": 0,
"zid_client_secret": "",
"zid_refresh_token": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/account.cart.add.json \
--header 'content-type: application/json' \
--header 'x-api-key: {{apiKey}}' \
--data '{
"3dcart_access_token": "",
"3dcart_private_key": "",
"3dcartapi_api_key": "",
"amazon_access_key_id": "",
"amazon_access_token": "",
"amazon_marketplaces_ids": "",
"amazon_secret_key": "",
"amazon_seller_id": "",
"amazon_sp_api_environment": "",
"amazon_sp_aws_region": "",
"amazon_sp_aws_role_arn": "",
"amazon_sp_aws_user_key_id": "",
"amazon_sp_aws_user_secret": "",
"amazon_sp_client_id": "",
"amazon_sp_client_secret": "",
"amazon_sp_refresh_token": "",
"aspdotnetstorefront_api_pass": "",
"aspdotnetstorefront_api_user": "",
"bigcommerceapi_access_token": "",
"bigcommerceapi_admin_account": "",
"bigcommerceapi_api_key": "",
"bigcommerceapi_api_path": "",
"bigcommerceapi_client_id": "",
"bigcommerceapi_context": "",
"bridge_url": "",
"cart_id": "",
"commercehq_api_key": "",
"commercehq_api_password": "",
"db_tables_prefix": "",
"demandware_api_password": "",
"demandware_client_id": "",
"demandware_user_name": "",
"demandware_user_password": "",
"ebay_access_token": "",
"ebay_client_id": "",
"ebay_client_secret": "",
"ebay_environment": "",
"ebay_refresh_token": "",
"ebay_runame": "",
"ebay_site_id": 0,
"ecwid_acess_token": "",
"ecwid_store_id": "",
"etsy_access_token": "",
"etsy_client_id": "",
"etsy_keystring": "",
"etsy_refresh_token": "",
"etsy_shared_secret": "",
"etsy_token_secret": "",
"ftp_host": "",
"ftp_password": "",
"ftp_port": 0,
"ftp_store_dir": "",
"ftp_user": "",
"hybris_client_id": "",
"hybris_client_secret": "",
"hybris_password": "",
"hybris_username": "",
"hybris_websites": [
{
"storeIds": [],
"uid": "",
"url": ""
}
],
"lightspeed_api_key": "",
"lightspeed_api_secret": "",
"magento_access_token": "",
"magento_consumer_key": "",
"magento_consumer_secret": "",
"magento_token_secret": "",
"mercado_libre_app_id": "",
"mercado_libre_app_secret_key": "",
"mercado_libre_refresh_token": "",
"neto_api_key": "",
"neto_api_username": "",
"prestashop_webservice_key": "",
"shopify_access_token": "",
"shopify_api_key": "",
"shopify_api_password": "",
"shopify_shared_secret": "",
"shopware_access_key": "",
"shopware_api_key": "",
"shopware_api_secret": "",
"squarespace_api_key": "",
"store_key": "",
"store_root": "",
"store_url": "",
"validate_version": false,
"verify": false,
"volusion_login": "",
"volusion_password": "",
"walmart_channel_type": "",
"walmart_client_id": "",
"walmart_client_secret": "",
"walmart_environment": "",
"wc_consumer_key": "",
"wc_consumer_secret": "",
"wix_app_id": "",
"wix_app_secret_key": "",
"wix_refresh_token": "",
"zid_access_token": "",
"zid_authorization": "",
"zid_client_id": 0,
"zid_client_secret": "",
"zid_refresh_token": ""
}'
echo '{
"3dcart_access_token": "",
"3dcart_private_key": "",
"3dcartapi_api_key": "",
"amazon_access_key_id": "",
"amazon_access_token": "",
"amazon_marketplaces_ids": "",
"amazon_secret_key": "",
"amazon_seller_id": "",
"amazon_sp_api_environment": "",
"amazon_sp_aws_region": "",
"amazon_sp_aws_role_arn": "",
"amazon_sp_aws_user_key_id": "",
"amazon_sp_aws_user_secret": "",
"amazon_sp_client_id": "",
"amazon_sp_client_secret": "",
"amazon_sp_refresh_token": "",
"aspdotnetstorefront_api_pass": "",
"aspdotnetstorefront_api_user": "",
"bigcommerceapi_access_token": "",
"bigcommerceapi_admin_account": "",
"bigcommerceapi_api_key": "",
"bigcommerceapi_api_path": "",
"bigcommerceapi_client_id": "",
"bigcommerceapi_context": "",
"bridge_url": "",
"cart_id": "",
"commercehq_api_key": "",
"commercehq_api_password": "",
"db_tables_prefix": "",
"demandware_api_password": "",
"demandware_client_id": "",
"demandware_user_name": "",
"demandware_user_password": "",
"ebay_access_token": "",
"ebay_client_id": "",
"ebay_client_secret": "",
"ebay_environment": "",
"ebay_refresh_token": "",
"ebay_runame": "",
"ebay_site_id": 0,
"ecwid_acess_token": "",
"ecwid_store_id": "",
"etsy_access_token": "",
"etsy_client_id": "",
"etsy_keystring": "",
"etsy_refresh_token": "",
"etsy_shared_secret": "",
"etsy_token_secret": "",
"ftp_host": "",
"ftp_password": "",
"ftp_port": 0,
"ftp_store_dir": "",
"ftp_user": "",
"hybris_client_id": "",
"hybris_client_secret": "",
"hybris_password": "",
"hybris_username": "",
"hybris_websites": [
{
"storeIds": [],
"uid": "",
"url": ""
}
],
"lightspeed_api_key": "",
"lightspeed_api_secret": "",
"magento_access_token": "",
"magento_consumer_key": "",
"magento_consumer_secret": "",
"magento_token_secret": "",
"mercado_libre_app_id": "",
"mercado_libre_app_secret_key": "",
"mercado_libre_refresh_token": "",
"neto_api_key": "",
"neto_api_username": "",
"prestashop_webservice_key": "",
"shopify_access_token": "",
"shopify_api_key": "",
"shopify_api_password": "",
"shopify_shared_secret": "",
"shopware_access_key": "",
"shopware_api_key": "",
"shopware_api_secret": "",
"squarespace_api_key": "",
"store_key": "",
"store_root": "",
"store_url": "",
"validate_version": false,
"verify": false,
"volusion_login": "",
"volusion_password": "",
"walmart_channel_type": "",
"walmart_client_id": "",
"walmart_client_secret": "",
"walmart_environment": "",
"wc_consumer_key": "",
"wc_consumer_secret": "",
"wix_app_id": "",
"wix_app_secret_key": "",
"wix_refresh_token": "",
"zid_access_token": "",
"zid_authorization": "",
"zid_client_id": 0,
"zid_client_secret": "",
"zid_refresh_token": ""
}' | \
http POST {{baseUrl}}/account.cart.add.json \
content-type:application/json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "3dcart_access_token": "",\n "3dcart_private_key": "",\n "3dcartapi_api_key": "",\n "amazon_access_key_id": "",\n "amazon_access_token": "",\n "amazon_marketplaces_ids": "",\n "amazon_secret_key": "",\n "amazon_seller_id": "",\n "amazon_sp_api_environment": "",\n "amazon_sp_aws_region": "",\n "amazon_sp_aws_role_arn": "",\n "amazon_sp_aws_user_key_id": "",\n "amazon_sp_aws_user_secret": "",\n "amazon_sp_client_id": "",\n "amazon_sp_client_secret": "",\n "amazon_sp_refresh_token": "",\n "aspdotnetstorefront_api_pass": "",\n "aspdotnetstorefront_api_user": "",\n "bigcommerceapi_access_token": "",\n "bigcommerceapi_admin_account": "",\n "bigcommerceapi_api_key": "",\n "bigcommerceapi_api_path": "",\n "bigcommerceapi_client_id": "",\n "bigcommerceapi_context": "",\n "bridge_url": "",\n "cart_id": "",\n "commercehq_api_key": "",\n "commercehq_api_password": "",\n "db_tables_prefix": "",\n "demandware_api_password": "",\n "demandware_client_id": "",\n "demandware_user_name": "",\n "demandware_user_password": "",\n "ebay_access_token": "",\n "ebay_client_id": "",\n "ebay_client_secret": "",\n "ebay_environment": "",\n "ebay_refresh_token": "",\n "ebay_runame": "",\n "ebay_site_id": 0,\n "ecwid_acess_token": "",\n "ecwid_store_id": "",\n "etsy_access_token": "",\n "etsy_client_id": "",\n "etsy_keystring": "",\n "etsy_refresh_token": "",\n "etsy_shared_secret": "",\n "etsy_token_secret": "",\n "ftp_host": "",\n "ftp_password": "",\n "ftp_port": 0,\n "ftp_store_dir": "",\n "ftp_user": "",\n "hybris_client_id": "",\n "hybris_client_secret": "",\n "hybris_password": "",\n "hybris_username": "",\n "hybris_websites": [\n {\n "storeIds": [],\n "uid": "",\n "url": ""\n }\n ],\n "lightspeed_api_key": "",\n "lightspeed_api_secret": "",\n "magento_access_token": "",\n "magento_consumer_key": "",\n "magento_consumer_secret": "",\n "magento_token_secret": "",\n "mercado_libre_app_id": "",\n "mercado_libre_app_secret_key": "",\n "mercado_libre_refresh_token": "",\n "neto_api_key": "",\n "neto_api_username": "",\n "prestashop_webservice_key": "",\n "shopify_access_token": "",\n "shopify_api_key": "",\n "shopify_api_password": "",\n "shopify_shared_secret": "",\n "shopware_access_key": "",\n "shopware_api_key": "",\n "shopware_api_secret": "",\n "squarespace_api_key": "",\n "store_key": "",\n "store_root": "",\n "store_url": "",\n "validate_version": false,\n "verify": false,\n "volusion_login": "",\n "volusion_password": "",\n "walmart_channel_type": "",\n "walmart_client_id": "",\n "walmart_client_secret": "",\n "walmart_environment": "",\n "wc_consumer_key": "",\n "wc_consumer_secret": "",\n "wix_app_id": "",\n "wix_app_secret_key": "",\n "wix_refresh_token": "",\n "zid_access_token": "",\n "zid_authorization": "",\n "zid_client_id": 0,\n "zid_client_secret": "",\n "zid_refresh_token": ""\n}' \
--output-document \
- {{baseUrl}}/account.cart.add.json
import Foundation
let headers = [
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"3dcart_access_token": "",
"3dcart_private_key": "",
"3dcartapi_api_key": "",
"amazon_access_key_id": "",
"amazon_access_token": "",
"amazon_marketplaces_ids": "",
"amazon_secret_key": "",
"amazon_seller_id": "",
"amazon_sp_api_environment": "",
"amazon_sp_aws_region": "",
"amazon_sp_aws_role_arn": "",
"amazon_sp_aws_user_key_id": "",
"amazon_sp_aws_user_secret": "",
"amazon_sp_client_id": "",
"amazon_sp_client_secret": "",
"amazon_sp_refresh_token": "",
"aspdotnetstorefront_api_pass": "",
"aspdotnetstorefront_api_user": "",
"bigcommerceapi_access_token": "",
"bigcommerceapi_admin_account": "",
"bigcommerceapi_api_key": "",
"bigcommerceapi_api_path": "",
"bigcommerceapi_client_id": "",
"bigcommerceapi_context": "",
"bridge_url": "",
"cart_id": "",
"commercehq_api_key": "",
"commercehq_api_password": "",
"db_tables_prefix": "",
"demandware_api_password": "",
"demandware_client_id": "",
"demandware_user_name": "",
"demandware_user_password": "",
"ebay_access_token": "",
"ebay_client_id": "",
"ebay_client_secret": "",
"ebay_environment": "",
"ebay_refresh_token": "",
"ebay_runame": "",
"ebay_site_id": 0,
"ecwid_acess_token": "",
"ecwid_store_id": "",
"etsy_access_token": "",
"etsy_client_id": "",
"etsy_keystring": "",
"etsy_refresh_token": "",
"etsy_shared_secret": "",
"etsy_token_secret": "",
"ftp_host": "",
"ftp_password": "",
"ftp_port": 0,
"ftp_store_dir": "",
"ftp_user": "",
"hybris_client_id": "",
"hybris_client_secret": "",
"hybris_password": "",
"hybris_username": "",
"hybris_websites": [
[
"storeIds": [],
"uid": "",
"url": ""
]
],
"lightspeed_api_key": "",
"lightspeed_api_secret": "",
"magento_access_token": "",
"magento_consumer_key": "",
"magento_consumer_secret": "",
"magento_token_secret": "",
"mercado_libre_app_id": "",
"mercado_libre_app_secret_key": "",
"mercado_libre_refresh_token": "",
"neto_api_key": "",
"neto_api_username": "",
"prestashop_webservice_key": "",
"shopify_access_token": "",
"shopify_api_key": "",
"shopify_api_password": "",
"shopify_shared_secret": "",
"shopware_access_key": "",
"shopware_api_key": "",
"shopware_api_secret": "",
"squarespace_api_key": "",
"store_key": "",
"store_root": "",
"store_url": "",
"validate_version": false,
"verify": false,
"volusion_login": "",
"volusion_password": "",
"walmart_channel_type": "",
"walmart_client_id": "",
"walmart_client_secret": "",
"walmart_environment": "",
"wc_consumer_key": "",
"wc_consumer_secret": "",
"wix_app_id": "",
"wix_app_secret_key": "",
"wix_refresh_token": "",
"zid_access_token": "",
"zid_authorization": "",
"zid_client_id": 0,
"zid_client_secret": "",
"zid_refresh_token": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/account.cart.add.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
AccountCartList
{{baseUrl}}/account.cart.list.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/account.cart.list.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/account.cart.list.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/account.cart.list.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/account.cart.list.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/account.cart.list.json");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/account.cart.list.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/account.cart.list.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/account.cart.list.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/account.cart.list.json"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/account.cart.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/account.cart.list.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/account.cart.list.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/account.cart.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/account.cart.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/account.cart.list.json',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/account.cart.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/account.cart.list.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/account.cart.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/account.cart.list.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/account.cart.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/account.cart.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/account.cart.list.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/account.cart.list.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/account.cart.list.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/account.cart.list.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/account.cart.list.json');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/account.cart.list.json');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/account.cart.list.json' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/account.cart.list.json' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/account.cart.list.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/account.cart.list.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/account.cart.list.json"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/account.cart.list.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/account.cart.list.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/account.cart.list.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/account.cart.list.json \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/account.cart.list.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/account.cart.list.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/account.cart.list.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PUT
AccountConfigUpdate
{{baseUrl}}/account.config.update.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/account.config.update.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/account.config.update.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/account.config.update.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.put url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/account.config.update.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/account.config.update.json");
var request = new RestRequest("", Method.Put);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/account.config.update.json"
req, _ := http.NewRequest("PUT", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/account.config.update.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/account.config.update.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/account.config.update.json"))
.header("x-api-key", "{{apiKey}}")
.method("PUT", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/account.config.update.json")
.put(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/account.config.update.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/account.config.update.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/account.config.update.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/account.config.update.json';
const options = {method: 'PUT', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/account.config.update.json',
method: 'PUT',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/account.config.update.json")
.put(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/account.config.update.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/account.config.update.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/account.config.update.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/account.config.update.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/account.config.update.json';
const options = {method: 'PUT', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/account.config.update.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/account.config.update.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/account.config.update.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/account.config.update.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/account.config.update.json');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/account.config.update.json');
$request->setRequestMethod('PUT');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/account.config.update.json' -Method PUT -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/account.config.update.json' -Method PUT -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("PUT", "/baseUrl/account.config.update.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/account.config.update.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.put(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/account.config.update.json"
response <- VERB("PUT", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/account.config.update.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.put('/baseUrl/account.config.update.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/account.config.update.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/account.config.update.json \
--header 'x-api-key: {{apiKey}}'
http PUT {{baseUrl}}/account.config.update.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method PUT \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/account.config.update.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/account.config.update.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
AccountFailedWebhooks
{{baseUrl}}/account.failed_webhooks.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/account.failed_webhooks.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/account.failed_webhooks.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/account.failed_webhooks.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/account.failed_webhooks.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/account.failed_webhooks.json");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/account.failed_webhooks.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/account.failed_webhooks.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/account.failed_webhooks.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/account.failed_webhooks.json"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/account.failed_webhooks.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/account.failed_webhooks.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/account.failed_webhooks.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/account.failed_webhooks.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/account.failed_webhooks.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/account.failed_webhooks.json',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/account.failed_webhooks.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/account.failed_webhooks.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/account.failed_webhooks.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/account.failed_webhooks.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/account.failed_webhooks.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/account.failed_webhooks.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/account.failed_webhooks.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/account.failed_webhooks.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/account.failed_webhooks.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/account.failed_webhooks.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/account.failed_webhooks.json');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/account.failed_webhooks.json');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/account.failed_webhooks.json' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/account.failed_webhooks.json' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/account.failed_webhooks.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/account.failed_webhooks.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/account.failed_webhooks.json"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/account.failed_webhooks.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/account.failed_webhooks.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/account.failed_webhooks.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/account.failed_webhooks.json \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/account.failed_webhooks.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/account.failed_webhooks.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/account.failed_webhooks.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
AccountSupportedPlatforms
{{baseUrl}}/account.supported_platforms.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/account.supported_platforms.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/account.supported_platforms.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/account.supported_platforms.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/account.supported_platforms.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/account.supported_platforms.json");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/account.supported_platforms.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/account.supported_platforms.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/account.supported_platforms.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/account.supported_platforms.json"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/account.supported_platforms.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/account.supported_platforms.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/account.supported_platforms.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/account.supported_platforms.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/account.supported_platforms.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/account.supported_platforms.json',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/account.supported_platforms.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/account.supported_platforms.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/account.supported_platforms.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/account.supported_platforms.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/account.supported_platforms.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/account.supported_platforms.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/account.supported_platforms.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/account.supported_platforms.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/account.supported_platforms.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/account.supported_platforms.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/account.supported_platforms.json');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/account.supported_platforms.json');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/account.supported_platforms.json' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/account.supported_platforms.json' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/account.supported_platforms.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/account.supported_platforms.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/account.supported_platforms.json"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/account.supported_platforms.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/account.supported_platforms.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/account.supported_platforms.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/account.supported_platforms.json \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/account.supported_platforms.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/account.supported_platforms.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/account.supported_platforms.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
AttributeAdd
{{baseUrl}}/attribute.add.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
type
name
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/attribute.add.json?type=&name=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/attribute.add.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:type ""
:name ""}})
require "http/client"
url = "{{baseUrl}}/attribute.add.json?type=&name="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.post url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/attribute.add.json?type=&name="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/attribute.add.json?type=&name=");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/attribute.add.json?type=&name="
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/attribute.add.json?type=&name= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/attribute.add.json?type=&name=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/attribute.add.json?type=&name="))
.header("x-api-key", "{{apiKey}}")
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/attribute.add.json?type=&name=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/attribute.add.json?type=&name=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/attribute.add.json?type=&name=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/attribute.add.json',
params: {type: '', name: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/attribute.add.json?type=&name=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/attribute.add.json?type=&name=',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/attribute.add.json?type=&name=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/attribute.add.json?type=&name=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/attribute.add.json',
qs: {type: '', name: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/attribute.add.json');
req.query({
type: '',
name: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/attribute.add.json',
params: {type: '', name: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/attribute.add.json?type=&name=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/attribute.add.json?type=&name="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/attribute.add.json?type=&name=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/attribute.add.json?type=&name=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/attribute.add.json?type=&name=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/attribute.add.json');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'type' => '',
'name' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/attribute.add.json');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'type' => '',
'name' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/attribute.add.json?type=&name=' -Method POST -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/attribute.add.json?type=&name=' -Method POST -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("POST", "/baseUrl/attribute.add.json?type=&name=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/attribute.add.json"
querystring = {"type":"","name":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.post(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/attribute.add.json"
queryString <- list(
type = "",
name = ""
)
response <- VERB("POST", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/attribute.add.json?type=&name=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/attribute.add.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['type'] = ''
req.params['name'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/attribute.add.json";
let querystring = [
("type", ""),
("name", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/attribute.add.json?type=&name=' \
--header 'x-api-key: {{apiKey}}'
http POST '{{baseUrl}}/attribute.add.json?type=&name=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/attribute.add.json?type=&name='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/attribute.add.json?type=&name=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
AttributeAssignGroup
{{baseUrl}}/attribute.assign.group.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
id
group_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/attribute.assign.group.json?id=&group_id=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/attribute.assign.group.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:id ""
:group_id ""}})
require "http/client"
url = "{{baseUrl}}/attribute.assign.group.json?id=&group_id="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.post url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/attribute.assign.group.json?id=&group_id="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/attribute.assign.group.json?id=&group_id=");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/attribute.assign.group.json?id=&group_id="
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/attribute.assign.group.json?id=&group_id= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/attribute.assign.group.json?id=&group_id=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/attribute.assign.group.json?id=&group_id="))
.header("x-api-key", "{{apiKey}}")
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/attribute.assign.group.json?id=&group_id=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/attribute.assign.group.json?id=&group_id=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/attribute.assign.group.json?id=&group_id=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/attribute.assign.group.json',
params: {id: '', group_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/attribute.assign.group.json?id=&group_id=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/attribute.assign.group.json?id=&group_id=',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/attribute.assign.group.json?id=&group_id=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/attribute.assign.group.json?id=&group_id=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/attribute.assign.group.json',
qs: {id: '', group_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/attribute.assign.group.json');
req.query({
id: '',
group_id: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/attribute.assign.group.json',
params: {id: '', group_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/attribute.assign.group.json?id=&group_id=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/attribute.assign.group.json?id=&group_id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/attribute.assign.group.json?id=&group_id=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/attribute.assign.group.json?id=&group_id=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/attribute.assign.group.json?id=&group_id=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/attribute.assign.group.json');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'id' => '',
'group_id' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/attribute.assign.group.json');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'id' => '',
'group_id' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/attribute.assign.group.json?id=&group_id=' -Method POST -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/attribute.assign.group.json?id=&group_id=' -Method POST -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("POST", "/baseUrl/attribute.assign.group.json?id=&group_id=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/attribute.assign.group.json"
querystring = {"id":"","group_id":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.post(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/attribute.assign.group.json"
queryString <- list(
id = "",
group_id = ""
)
response <- VERB("POST", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/attribute.assign.group.json?id=&group_id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/attribute.assign.group.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['id'] = ''
req.params['group_id'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/attribute.assign.group.json";
let querystring = [
("id", ""),
("group_id", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/attribute.assign.group.json?id=&group_id=' \
--header 'x-api-key: {{apiKey}}'
http POST '{{baseUrl}}/attribute.assign.group.json?id=&group_id=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/attribute.assign.group.json?id=&group_id='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/attribute.assign.group.json?id=&group_id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
AttributeAssignSet
{{baseUrl}}/attribute.assign.set.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
id
attribute_set_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/attribute.assign.set.json?id=&attribute_set_id=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/attribute.assign.set.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:id ""
:attribute_set_id ""}})
require "http/client"
url = "{{baseUrl}}/attribute.assign.set.json?id=&attribute_set_id="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.post url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/attribute.assign.set.json?id=&attribute_set_id="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/attribute.assign.set.json?id=&attribute_set_id=");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/attribute.assign.set.json?id=&attribute_set_id="
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/attribute.assign.set.json?id=&attribute_set_id= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/attribute.assign.set.json?id=&attribute_set_id=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/attribute.assign.set.json?id=&attribute_set_id="))
.header("x-api-key", "{{apiKey}}")
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/attribute.assign.set.json?id=&attribute_set_id=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/attribute.assign.set.json?id=&attribute_set_id=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/attribute.assign.set.json?id=&attribute_set_id=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/attribute.assign.set.json',
params: {id: '', attribute_set_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/attribute.assign.set.json?id=&attribute_set_id=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/attribute.assign.set.json?id=&attribute_set_id=',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/attribute.assign.set.json?id=&attribute_set_id=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/attribute.assign.set.json?id=&attribute_set_id=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/attribute.assign.set.json',
qs: {id: '', attribute_set_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/attribute.assign.set.json');
req.query({
id: '',
attribute_set_id: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/attribute.assign.set.json',
params: {id: '', attribute_set_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/attribute.assign.set.json?id=&attribute_set_id=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/attribute.assign.set.json?id=&attribute_set_id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/attribute.assign.set.json?id=&attribute_set_id=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/attribute.assign.set.json?id=&attribute_set_id=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/attribute.assign.set.json?id=&attribute_set_id=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/attribute.assign.set.json');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'id' => '',
'attribute_set_id' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/attribute.assign.set.json');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'id' => '',
'attribute_set_id' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/attribute.assign.set.json?id=&attribute_set_id=' -Method POST -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/attribute.assign.set.json?id=&attribute_set_id=' -Method POST -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("POST", "/baseUrl/attribute.assign.set.json?id=&attribute_set_id=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/attribute.assign.set.json"
querystring = {"id":"","attribute_set_id":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.post(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/attribute.assign.set.json"
queryString <- list(
id = "",
attribute_set_id = ""
)
response <- VERB("POST", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/attribute.assign.set.json?id=&attribute_set_id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/attribute.assign.set.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['id'] = ''
req.params['attribute_set_id'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/attribute.assign.set.json";
let querystring = [
("id", ""),
("attribute_set_id", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/attribute.assign.set.json?id=&attribute_set_id=' \
--header 'x-api-key: {{apiKey}}'
http POST '{{baseUrl}}/attribute.assign.set.json?id=&attribute_set_id=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/attribute.assign.set.json?id=&attribute_set_id='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/attribute.assign.set.json?id=&attribute_set_id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
AttributeAttributesetList
{{baseUrl}}/attribute.attributeset.list.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/attribute.attributeset.list.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/attribute.attributeset.list.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/attribute.attributeset.list.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/attribute.attributeset.list.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/attribute.attributeset.list.json");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/attribute.attributeset.list.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/attribute.attributeset.list.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/attribute.attributeset.list.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/attribute.attributeset.list.json"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/attribute.attributeset.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/attribute.attributeset.list.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/attribute.attributeset.list.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/attribute.attributeset.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/attribute.attributeset.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/attribute.attributeset.list.json',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/attribute.attributeset.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/attribute.attributeset.list.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/attribute.attributeset.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/attribute.attributeset.list.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/attribute.attributeset.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/attribute.attributeset.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/attribute.attributeset.list.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/attribute.attributeset.list.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/attribute.attributeset.list.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/attribute.attributeset.list.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/attribute.attributeset.list.json');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/attribute.attributeset.list.json');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/attribute.attributeset.list.json' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/attribute.attributeset.list.json' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/attribute.attributeset.list.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/attribute.attributeset.list.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/attribute.attributeset.list.json"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/attribute.attributeset.list.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/attribute.attributeset.list.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/attribute.attributeset.list.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/attribute.attributeset.list.json \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/attribute.attributeset.list.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/attribute.attributeset.list.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/attribute.attributeset.list.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
AttributeCount
{{baseUrl}}/attribute.count.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/attribute.count.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/attribute.count.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/attribute.count.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/attribute.count.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/attribute.count.json");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/attribute.count.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/attribute.count.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/attribute.count.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/attribute.count.json"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/attribute.count.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/attribute.count.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/attribute.count.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/attribute.count.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/attribute.count.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/attribute.count.json',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/attribute.count.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/attribute.count.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/attribute.count.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/attribute.count.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/attribute.count.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/attribute.count.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/attribute.count.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/attribute.count.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/attribute.count.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/attribute.count.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/attribute.count.json');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/attribute.count.json');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/attribute.count.json' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/attribute.count.json' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/attribute.count.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/attribute.count.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/attribute.count.json"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/attribute.count.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/attribute.count.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/attribute.count.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/attribute.count.json \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/attribute.count.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/attribute.count.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/attribute.count.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
DELETE
AttributeDelete
{{baseUrl}}/attribute.delete.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/attribute.delete.json?id=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/attribute.delete.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:id ""}})
require "http/client"
url = "{{baseUrl}}/attribute.delete.json?id="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.delete url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/attribute.delete.json?id="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/attribute.delete.json?id=");
var request = new RestRequest("", Method.Delete);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/attribute.delete.json?id="
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/attribute.delete.json?id= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/attribute.delete.json?id=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/attribute.delete.json?id="))
.header("x-api-key", "{{apiKey}}")
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/attribute.delete.json?id=")
.delete(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/attribute.delete.json?id=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/attribute.delete.json?id=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/attribute.delete.json',
params: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/attribute.delete.json?id=';
const options = {method: 'DELETE', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/attribute.delete.json?id=',
method: 'DELETE',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/attribute.delete.json?id=")
.delete(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/attribute.delete.json?id=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/attribute.delete.json',
qs: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/attribute.delete.json');
req.query({
id: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/attribute.delete.json',
params: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/attribute.delete.json?id=';
const options = {method: 'DELETE', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/attribute.delete.json?id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/attribute.delete.json?id=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/attribute.delete.json?id=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/attribute.delete.json?id=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/attribute.delete.json');
$request->setMethod(HTTP_METH_DELETE);
$request->setQueryData([
'id' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/attribute.delete.json');
$request->setRequestMethod('DELETE');
$request->setQuery(new http\QueryString([
'id' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/attribute.delete.json?id=' -Method DELETE -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/attribute.delete.json?id=' -Method DELETE -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("DELETE", "/baseUrl/attribute.delete.json?id=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/attribute.delete.json"
querystring = {"id":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.delete(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/attribute.delete.json"
queryString <- list(id = "")
response <- VERB("DELETE", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/attribute.delete.json?id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/attribute.delete.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['id'] = ''
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/attribute.delete.json";
let querystring = [
("id", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url '{{baseUrl}}/attribute.delete.json?id=' \
--header 'x-api-key: {{apiKey}}'
http DELETE '{{baseUrl}}/attribute.delete.json?id=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method DELETE \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/attribute.delete.json?id='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/attribute.delete.json?id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
AttributeGroupList
{{baseUrl}}/attribute.group.list.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/attribute.group.list.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/attribute.group.list.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/attribute.group.list.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/attribute.group.list.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/attribute.group.list.json");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/attribute.group.list.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/attribute.group.list.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/attribute.group.list.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/attribute.group.list.json"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/attribute.group.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/attribute.group.list.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/attribute.group.list.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/attribute.group.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/attribute.group.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/attribute.group.list.json',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/attribute.group.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/attribute.group.list.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/attribute.group.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/attribute.group.list.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/attribute.group.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/attribute.group.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/attribute.group.list.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/attribute.group.list.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/attribute.group.list.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/attribute.group.list.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/attribute.group.list.json');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/attribute.group.list.json');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/attribute.group.list.json' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/attribute.group.list.json' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/attribute.group.list.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/attribute.group.list.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/attribute.group.list.json"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/attribute.group.list.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/attribute.group.list.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/attribute.group.list.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/attribute.group.list.json \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/attribute.group.list.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/attribute.group.list.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/attribute.group.list.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
AttributeInfo
{{baseUrl}}/attribute.info.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/attribute.info.json?id=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/attribute.info.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:id ""}})
require "http/client"
url = "{{baseUrl}}/attribute.info.json?id="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/attribute.info.json?id="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/attribute.info.json?id=");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/attribute.info.json?id="
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/attribute.info.json?id= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/attribute.info.json?id=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/attribute.info.json?id="))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/attribute.info.json?id=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/attribute.info.json?id=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/attribute.info.json?id=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/attribute.info.json',
params: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/attribute.info.json?id=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/attribute.info.json?id=',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/attribute.info.json?id=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/attribute.info.json?id=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/attribute.info.json',
qs: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/attribute.info.json');
req.query({
id: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/attribute.info.json',
params: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/attribute.info.json?id=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/attribute.info.json?id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/attribute.info.json?id=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/attribute.info.json?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 => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/attribute.info.json?id=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/attribute.info.json');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'id' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/attribute.info.json');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'id' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/attribute.info.json?id=' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/attribute.info.json?id=' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/attribute.info.json?id=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/attribute.info.json"
querystring = {"id":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/attribute.info.json"
queryString <- list(id = "")
response <- VERB("GET", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/attribute.info.json?id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/attribute.info.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['id'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/attribute.info.json";
let querystring = [
("id", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/attribute.info.json?id=' \
--header 'x-api-key: {{apiKey}}'
http GET '{{baseUrl}}/attribute.info.json?id=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/attribute.info.json?id='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/attribute.info.json?id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
AttributeList
{{baseUrl}}/attribute.list.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/attribute.list.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/attribute.list.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/attribute.list.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/attribute.list.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/attribute.list.json");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/attribute.list.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/attribute.list.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/attribute.list.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/attribute.list.json"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/attribute.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/attribute.list.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/attribute.list.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/attribute.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/attribute.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/attribute.list.json',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/attribute.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/attribute.list.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/attribute.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/attribute.list.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/attribute.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/attribute.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/attribute.list.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/attribute.list.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/attribute.list.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/attribute.list.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/attribute.list.json');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/attribute.list.json');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/attribute.list.json' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/attribute.list.json' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/attribute.list.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/attribute.list.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/attribute.list.json"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/attribute.list.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/attribute.list.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/attribute.list.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/attribute.list.json \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/attribute.list.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/attribute.list.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/attribute.list.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
AttributeTypeList
{{baseUrl}}/attribute.type.list.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/attribute.type.list.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/attribute.type.list.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/attribute.type.list.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/attribute.type.list.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/attribute.type.list.json");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/attribute.type.list.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/attribute.type.list.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/attribute.type.list.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/attribute.type.list.json"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/attribute.type.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/attribute.type.list.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/attribute.type.list.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/attribute.type.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/attribute.type.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/attribute.type.list.json',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/attribute.type.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/attribute.type.list.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/attribute.type.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/attribute.type.list.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/attribute.type.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/attribute.type.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/attribute.type.list.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/attribute.type.list.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/attribute.type.list.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/attribute.type.list.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/attribute.type.list.json');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/attribute.type.list.json');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/attribute.type.list.json' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/attribute.type.list.json' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/attribute.type.list.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/attribute.type.list.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/attribute.type.list.json"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/attribute.type.list.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/attribute.type.list.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/attribute.type.list.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/attribute.type.list.json \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/attribute.type.list.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/attribute.type.list.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/attribute.type.list.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
AttributeUnassignGroup
{{baseUrl}}/attribute.unassign.group.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
id
group_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/attribute.unassign.group.json?id=&group_id=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/attribute.unassign.group.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:id ""
:group_id ""}})
require "http/client"
url = "{{baseUrl}}/attribute.unassign.group.json?id=&group_id="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.post url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/attribute.unassign.group.json?id=&group_id="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/attribute.unassign.group.json?id=&group_id=");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/attribute.unassign.group.json?id=&group_id="
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/attribute.unassign.group.json?id=&group_id= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/attribute.unassign.group.json?id=&group_id=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/attribute.unassign.group.json?id=&group_id="))
.header("x-api-key", "{{apiKey}}")
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/attribute.unassign.group.json?id=&group_id=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/attribute.unassign.group.json?id=&group_id=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/attribute.unassign.group.json?id=&group_id=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/attribute.unassign.group.json',
params: {id: '', group_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/attribute.unassign.group.json?id=&group_id=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/attribute.unassign.group.json?id=&group_id=',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/attribute.unassign.group.json?id=&group_id=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/attribute.unassign.group.json?id=&group_id=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/attribute.unassign.group.json',
qs: {id: '', group_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/attribute.unassign.group.json');
req.query({
id: '',
group_id: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/attribute.unassign.group.json',
params: {id: '', group_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/attribute.unassign.group.json?id=&group_id=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/attribute.unassign.group.json?id=&group_id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/attribute.unassign.group.json?id=&group_id=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/attribute.unassign.group.json?id=&group_id=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/attribute.unassign.group.json?id=&group_id=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/attribute.unassign.group.json');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'id' => '',
'group_id' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/attribute.unassign.group.json');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'id' => '',
'group_id' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/attribute.unassign.group.json?id=&group_id=' -Method POST -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/attribute.unassign.group.json?id=&group_id=' -Method POST -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("POST", "/baseUrl/attribute.unassign.group.json?id=&group_id=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/attribute.unassign.group.json"
querystring = {"id":"","group_id":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.post(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/attribute.unassign.group.json"
queryString <- list(
id = "",
group_id = ""
)
response <- VERB("POST", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/attribute.unassign.group.json?id=&group_id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/attribute.unassign.group.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['id'] = ''
req.params['group_id'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/attribute.unassign.group.json";
let querystring = [
("id", ""),
("group_id", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/attribute.unassign.group.json?id=&group_id=' \
--header 'x-api-key: {{apiKey}}'
http POST '{{baseUrl}}/attribute.unassign.group.json?id=&group_id=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/attribute.unassign.group.json?id=&group_id='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/attribute.unassign.group.json?id=&group_id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
AttributeUnassignSet
{{baseUrl}}/attribute.unassign.set.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
id
attribute_set_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/attribute.unassign.set.json?id=&attribute_set_id=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/attribute.unassign.set.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:id ""
:attribute_set_id ""}})
require "http/client"
url = "{{baseUrl}}/attribute.unassign.set.json?id=&attribute_set_id="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.post url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/attribute.unassign.set.json?id=&attribute_set_id="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/attribute.unassign.set.json?id=&attribute_set_id=");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/attribute.unassign.set.json?id=&attribute_set_id="
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/attribute.unassign.set.json?id=&attribute_set_id= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/attribute.unassign.set.json?id=&attribute_set_id=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/attribute.unassign.set.json?id=&attribute_set_id="))
.header("x-api-key", "{{apiKey}}")
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/attribute.unassign.set.json?id=&attribute_set_id=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/attribute.unassign.set.json?id=&attribute_set_id=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/attribute.unassign.set.json?id=&attribute_set_id=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/attribute.unassign.set.json',
params: {id: '', attribute_set_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/attribute.unassign.set.json?id=&attribute_set_id=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/attribute.unassign.set.json?id=&attribute_set_id=',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/attribute.unassign.set.json?id=&attribute_set_id=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/attribute.unassign.set.json?id=&attribute_set_id=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/attribute.unassign.set.json',
qs: {id: '', attribute_set_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/attribute.unassign.set.json');
req.query({
id: '',
attribute_set_id: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/attribute.unassign.set.json',
params: {id: '', attribute_set_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/attribute.unassign.set.json?id=&attribute_set_id=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/attribute.unassign.set.json?id=&attribute_set_id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/attribute.unassign.set.json?id=&attribute_set_id=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/attribute.unassign.set.json?id=&attribute_set_id=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/attribute.unassign.set.json?id=&attribute_set_id=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/attribute.unassign.set.json');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'id' => '',
'attribute_set_id' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/attribute.unassign.set.json');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'id' => '',
'attribute_set_id' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/attribute.unassign.set.json?id=&attribute_set_id=' -Method POST -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/attribute.unassign.set.json?id=&attribute_set_id=' -Method POST -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("POST", "/baseUrl/attribute.unassign.set.json?id=&attribute_set_id=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/attribute.unassign.set.json"
querystring = {"id":"","attribute_set_id":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.post(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/attribute.unassign.set.json"
queryString <- list(
id = "",
attribute_set_id = ""
)
response <- VERB("POST", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/attribute.unassign.set.json?id=&attribute_set_id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/attribute.unassign.set.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['id'] = ''
req.params['attribute_set_id'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/attribute.unassign.set.json";
let querystring = [
("id", ""),
("attribute_set_id", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/attribute.unassign.set.json?id=&attribute_set_id=' \
--header 'x-api-key: {{apiKey}}'
http POST '{{baseUrl}}/attribute.unassign.set.json?id=&attribute_set_id=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/attribute.unassign.set.json?id=&attribute_set_id='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/attribute.unassign.set.json?id=&attribute_set_id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
AttributeUpdate
{{baseUrl}}/attribute.update.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
id
name
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/attribute.update.json?id=&name=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/attribute.update.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:id ""
:name ""}})
require "http/client"
url = "{{baseUrl}}/attribute.update.json?id=&name="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.post url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/attribute.update.json?id=&name="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/attribute.update.json?id=&name=");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/attribute.update.json?id=&name="
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/attribute.update.json?id=&name= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/attribute.update.json?id=&name=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/attribute.update.json?id=&name="))
.header("x-api-key", "{{apiKey}}")
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/attribute.update.json?id=&name=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/attribute.update.json?id=&name=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/attribute.update.json?id=&name=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/attribute.update.json',
params: {id: '', name: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/attribute.update.json?id=&name=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/attribute.update.json?id=&name=',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/attribute.update.json?id=&name=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/attribute.update.json?id=&name=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/attribute.update.json',
qs: {id: '', name: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/attribute.update.json');
req.query({
id: '',
name: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/attribute.update.json',
params: {id: '', name: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/attribute.update.json?id=&name=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/attribute.update.json?id=&name="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/attribute.update.json?id=&name=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/attribute.update.json?id=&name=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/attribute.update.json?id=&name=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/attribute.update.json');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'id' => '',
'name' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/attribute.update.json');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'id' => '',
'name' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/attribute.update.json?id=&name=' -Method POST -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/attribute.update.json?id=&name=' -Method POST -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("POST", "/baseUrl/attribute.update.json?id=&name=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/attribute.update.json"
querystring = {"id":"","name":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.post(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/attribute.update.json"
queryString <- list(
id = "",
name = ""
)
response <- VERB("POST", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/attribute.update.json?id=&name=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/attribute.update.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['id'] = ''
req.params['name'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/attribute.update.json";
let querystring = [
("id", ""),
("name", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/attribute.update.json?id=&name=' \
--header 'x-api-key: {{apiKey}}'
http POST '{{baseUrl}}/attribute.update.json?id=&name=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/attribute.update.json?id=&name='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/attribute.update.json?id=&name=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
BasketInfo
{{baseUrl}}/basket.info.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/basket.info.json?id=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/basket.info.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:id ""}})
require "http/client"
url = "{{baseUrl}}/basket.info.json?id="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/basket.info.json?id="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/basket.info.json?id=");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/basket.info.json?id="
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/basket.info.json?id= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/basket.info.json?id=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/basket.info.json?id="))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/basket.info.json?id=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/basket.info.json?id=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/basket.info.json?id=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/basket.info.json',
params: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/basket.info.json?id=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/basket.info.json?id=',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/basket.info.json?id=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/basket.info.json?id=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/basket.info.json',
qs: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/basket.info.json');
req.query({
id: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/basket.info.json',
params: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/basket.info.json?id=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/basket.info.json?id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/basket.info.json?id=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/basket.info.json?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 => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/basket.info.json?id=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/basket.info.json');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'id' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/basket.info.json');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'id' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/basket.info.json?id=' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/basket.info.json?id=' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/basket.info.json?id=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/basket.info.json"
querystring = {"id":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/basket.info.json"
queryString <- list(id = "")
response <- VERB("GET", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/basket.info.json?id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/basket.info.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['id'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/basket.info.json";
let querystring = [
("id", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/basket.info.json?id=' \
--header 'x-api-key: {{apiKey}}'
http GET '{{baseUrl}}/basket.info.json?id=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/basket.info.json?id='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/basket.info.json?id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
BasketItemAdd
{{baseUrl}}/basket.item.add.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
customer_id
product_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/basket.item.add.json?customer_id=&product_id=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/basket.item.add.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:customer_id ""
:product_id ""}})
require "http/client"
url = "{{baseUrl}}/basket.item.add.json?customer_id=&product_id="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.post url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/basket.item.add.json?customer_id=&product_id="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/basket.item.add.json?customer_id=&product_id=");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/basket.item.add.json?customer_id=&product_id="
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/basket.item.add.json?customer_id=&product_id= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/basket.item.add.json?customer_id=&product_id=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/basket.item.add.json?customer_id=&product_id="))
.header("x-api-key", "{{apiKey}}")
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/basket.item.add.json?customer_id=&product_id=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/basket.item.add.json?customer_id=&product_id=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/basket.item.add.json?customer_id=&product_id=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/basket.item.add.json',
params: {customer_id: '', product_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/basket.item.add.json?customer_id=&product_id=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/basket.item.add.json?customer_id=&product_id=',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/basket.item.add.json?customer_id=&product_id=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/basket.item.add.json?customer_id=&product_id=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/basket.item.add.json',
qs: {customer_id: '', product_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/basket.item.add.json');
req.query({
customer_id: '',
product_id: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/basket.item.add.json',
params: {customer_id: '', product_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/basket.item.add.json?customer_id=&product_id=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/basket.item.add.json?customer_id=&product_id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/basket.item.add.json?customer_id=&product_id=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/basket.item.add.json?customer_id=&product_id=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/basket.item.add.json?customer_id=&product_id=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/basket.item.add.json');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'customer_id' => '',
'product_id' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/basket.item.add.json');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'customer_id' => '',
'product_id' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/basket.item.add.json?customer_id=&product_id=' -Method POST -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/basket.item.add.json?customer_id=&product_id=' -Method POST -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("POST", "/baseUrl/basket.item.add.json?customer_id=&product_id=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/basket.item.add.json"
querystring = {"customer_id":"","product_id":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.post(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/basket.item.add.json"
queryString <- list(
customer_id = "",
product_id = ""
)
response <- VERB("POST", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/basket.item.add.json?customer_id=&product_id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/basket.item.add.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['customer_id'] = ''
req.params['product_id'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/basket.item.add.json";
let querystring = [
("customer_id", ""),
("product_id", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/basket.item.add.json?customer_id=&product_id=' \
--header 'x-api-key: {{apiKey}}'
http POST '{{baseUrl}}/basket.item.add.json?customer_id=&product_id=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/basket.item.add.json?customer_id=&product_id='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/basket.item.add.json?customer_id=&product_id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
BasketLiveShippingServiceCreate
{{baseUrl}}/basket.live_shipping_service.create.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
name
callback
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/basket.live_shipping_service.create.json?name=&callback=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/basket.live_shipping_service.create.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:name ""
:callback ""}})
require "http/client"
url = "{{baseUrl}}/basket.live_shipping_service.create.json?name=&callback="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.post url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/basket.live_shipping_service.create.json?name=&callback="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/basket.live_shipping_service.create.json?name=&callback=");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/basket.live_shipping_service.create.json?name=&callback="
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/basket.live_shipping_service.create.json?name=&callback= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/basket.live_shipping_service.create.json?name=&callback=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/basket.live_shipping_service.create.json?name=&callback="))
.header("x-api-key", "{{apiKey}}")
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/basket.live_shipping_service.create.json?name=&callback=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/basket.live_shipping_service.create.json?name=&callback=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/basket.live_shipping_service.create.json?name=&callback=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/basket.live_shipping_service.create.json',
params: {name: '', callback: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/basket.live_shipping_service.create.json?name=&callback=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/basket.live_shipping_service.create.json?name=&callback=',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/basket.live_shipping_service.create.json?name=&callback=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/basket.live_shipping_service.create.json?name=&callback=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/basket.live_shipping_service.create.json',
qs: {name: '', callback: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/basket.live_shipping_service.create.json');
req.query({
name: '',
callback: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/basket.live_shipping_service.create.json',
params: {name: '', callback: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/basket.live_shipping_service.create.json?name=&callback=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/basket.live_shipping_service.create.json?name=&callback="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/basket.live_shipping_service.create.json?name=&callback=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/basket.live_shipping_service.create.json?name=&callback=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/basket.live_shipping_service.create.json?name=&callback=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/basket.live_shipping_service.create.json');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'name' => '',
'callback' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/basket.live_shipping_service.create.json');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'name' => '',
'callback' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/basket.live_shipping_service.create.json?name=&callback=' -Method POST -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/basket.live_shipping_service.create.json?name=&callback=' -Method POST -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("POST", "/baseUrl/basket.live_shipping_service.create.json?name=&callback=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/basket.live_shipping_service.create.json"
querystring = {"name":"","callback":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.post(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/basket.live_shipping_service.create.json"
queryString <- list(
name = "",
callback = ""
)
response <- VERB("POST", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/basket.live_shipping_service.create.json?name=&callback=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/basket.live_shipping_service.create.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['name'] = ''
req.params['callback'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/basket.live_shipping_service.create.json";
let querystring = [
("name", ""),
("callback", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/basket.live_shipping_service.create.json?name=&callback=' \
--header 'x-api-key: {{apiKey}}'
http POST '{{baseUrl}}/basket.live_shipping_service.create.json?name=&callback=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/basket.live_shipping_service.create.json?name=&callback='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/basket.live_shipping_service.create.json?name=&callback=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
DELETE
BasketLiveShippingServiceDelete
{{baseUrl}}/basket.live_shipping_service.delete.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/basket.live_shipping_service.delete.json?id=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/basket.live_shipping_service.delete.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:id ""}})
require "http/client"
url = "{{baseUrl}}/basket.live_shipping_service.delete.json?id="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.delete url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/basket.live_shipping_service.delete.json?id="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/basket.live_shipping_service.delete.json?id=");
var request = new RestRequest("", Method.Delete);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/basket.live_shipping_service.delete.json?id="
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/basket.live_shipping_service.delete.json?id= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/basket.live_shipping_service.delete.json?id=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/basket.live_shipping_service.delete.json?id="))
.header("x-api-key", "{{apiKey}}")
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/basket.live_shipping_service.delete.json?id=")
.delete(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/basket.live_shipping_service.delete.json?id=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/basket.live_shipping_service.delete.json?id=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/basket.live_shipping_service.delete.json',
params: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/basket.live_shipping_service.delete.json?id=';
const options = {method: 'DELETE', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/basket.live_shipping_service.delete.json?id=',
method: 'DELETE',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/basket.live_shipping_service.delete.json?id=")
.delete(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/basket.live_shipping_service.delete.json?id=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/basket.live_shipping_service.delete.json',
qs: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/basket.live_shipping_service.delete.json');
req.query({
id: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/basket.live_shipping_service.delete.json',
params: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/basket.live_shipping_service.delete.json?id=';
const options = {method: 'DELETE', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/basket.live_shipping_service.delete.json?id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/basket.live_shipping_service.delete.json?id=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/basket.live_shipping_service.delete.json?id=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/basket.live_shipping_service.delete.json?id=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/basket.live_shipping_service.delete.json');
$request->setMethod(HTTP_METH_DELETE);
$request->setQueryData([
'id' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/basket.live_shipping_service.delete.json');
$request->setRequestMethod('DELETE');
$request->setQuery(new http\QueryString([
'id' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/basket.live_shipping_service.delete.json?id=' -Method DELETE -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/basket.live_shipping_service.delete.json?id=' -Method DELETE -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("DELETE", "/baseUrl/basket.live_shipping_service.delete.json?id=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/basket.live_shipping_service.delete.json"
querystring = {"id":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.delete(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/basket.live_shipping_service.delete.json"
queryString <- list(id = "")
response <- VERB("DELETE", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/basket.live_shipping_service.delete.json?id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/basket.live_shipping_service.delete.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['id'] = ''
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/basket.live_shipping_service.delete.json";
let querystring = [
("id", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url '{{baseUrl}}/basket.live_shipping_service.delete.json?id=' \
--header 'x-api-key: {{apiKey}}'
http DELETE '{{baseUrl}}/basket.live_shipping_service.delete.json?id=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method DELETE \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/basket.live_shipping_service.delete.json?id='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/basket.live_shipping_service.delete.json?id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
BasketLiveShippingServiceList
{{baseUrl}}/basket.live_shipping_service.list.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/basket.live_shipping_service.list.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/basket.live_shipping_service.list.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/basket.live_shipping_service.list.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/basket.live_shipping_service.list.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/basket.live_shipping_service.list.json");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/basket.live_shipping_service.list.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/basket.live_shipping_service.list.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/basket.live_shipping_service.list.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/basket.live_shipping_service.list.json"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/basket.live_shipping_service.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/basket.live_shipping_service.list.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/basket.live_shipping_service.list.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/basket.live_shipping_service.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/basket.live_shipping_service.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/basket.live_shipping_service.list.json',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/basket.live_shipping_service.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/basket.live_shipping_service.list.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/basket.live_shipping_service.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/basket.live_shipping_service.list.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/basket.live_shipping_service.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/basket.live_shipping_service.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/basket.live_shipping_service.list.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/basket.live_shipping_service.list.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/basket.live_shipping_service.list.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/basket.live_shipping_service.list.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/basket.live_shipping_service.list.json');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/basket.live_shipping_service.list.json');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/basket.live_shipping_service.list.json' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/basket.live_shipping_service.list.json' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/basket.live_shipping_service.list.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/basket.live_shipping_service.list.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/basket.live_shipping_service.list.json"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/basket.live_shipping_service.list.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/basket.live_shipping_service.list.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/basket.live_shipping_service.list.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/basket.live_shipping_service.list.json \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/basket.live_shipping_service.list.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/basket.live_shipping_service.list.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/basket.live_shipping_service.list.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
BridgeDelete
{{baseUrl}}/bridge.delete.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/bridge.delete.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/bridge.delete.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/bridge.delete.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.post url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/bridge.delete.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/bridge.delete.json");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/bridge.delete.json"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/bridge.delete.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/bridge.delete.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/bridge.delete.json"))
.header("x-api-key", "{{apiKey}}")
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/bridge.delete.json")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/bridge.delete.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/bridge.delete.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/bridge.delete.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/bridge.delete.json';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/bridge.delete.json',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/bridge.delete.json")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/bridge.delete.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/bridge.delete.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/bridge.delete.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/bridge.delete.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/bridge.delete.json';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/bridge.delete.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/bridge.delete.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/bridge.delete.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/bridge.delete.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/bridge.delete.json');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/bridge.delete.json');
$request->setRequestMethod('POST');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/bridge.delete.json' -Method POST -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/bridge.delete.json' -Method POST -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("POST", "/baseUrl/bridge.delete.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/bridge.delete.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.post(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/bridge.delete.json"
response <- VERB("POST", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/bridge.delete.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/bridge.delete.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/bridge.delete.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/bridge.delete.json \
--header 'x-api-key: {{apiKey}}'
http POST {{baseUrl}}/bridge.delete.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/bridge.delete.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/bridge.delete.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
BridgeUpdate
{{baseUrl}}/bridge.update.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/bridge.update.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/bridge.update.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/bridge.update.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.post url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/bridge.update.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/bridge.update.json");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/bridge.update.json"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/bridge.update.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/bridge.update.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/bridge.update.json"))
.header("x-api-key", "{{apiKey}}")
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/bridge.update.json")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/bridge.update.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/bridge.update.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/bridge.update.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/bridge.update.json';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/bridge.update.json',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/bridge.update.json")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/bridge.update.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/bridge.update.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/bridge.update.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/bridge.update.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/bridge.update.json';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/bridge.update.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/bridge.update.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/bridge.update.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/bridge.update.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/bridge.update.json');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/bridge.update.json');
$request->setRequestMethod('POST');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/bridge.update.json' -Method POST -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/bridge.update.json' -Method POST -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("POST", "/baseUrl/bridge.update.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/bridge.update.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.post(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/bridge.update.json"
response <- VERB("POST", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/bridge.update.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/bridge.update.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/bridge.update.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/bridge.update.json \
--header 'x-api-key: {{apiKey}}'
http POST {{baseUrl}}/bridge.update.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/bridge.update.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/bridge.update.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
BridgeDownload
{{baseUrl}}/bridge.download.file
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/bridge.download.file");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/bridge.download.file" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/bridge.download.file"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/bridge.download.file"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/bridge.download.file");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/bridge.download.file"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/bridge.download.file HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/bridge.download.file")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/bridge.download.file"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/bridge.download.file")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/bridge.download.file")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/bridge.download.file');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/bridge.download.file',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/bridge.download.file';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/bridge.download.file',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/bridge.download.file")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/bridge.download.file',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/bridge.download.file',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/bridge.download.file');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/bridge.download.file',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/bridge.download.file';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/bridge.download.file"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/bridge.download.file" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/bridge.download.file",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/bridge.download.file', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/bridge.download.file');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/bridge.download.file');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/bridge.download.file' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/bridge.download.file' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/bridge.download.file", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/bridge.download.file"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/bridge.download.file"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/bridge.download.file")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/bridge.download.file') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/bridge.download.file";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/bridge.download.file \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/bridge.download.file \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/bridge.download.file
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/bridge.download.file")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
CartBridge
{{baseUrl}}/cart.bridge.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cart.bridge.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/cart.bridge.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/cart.bridge.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/cart.bridge.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cart.bridge.json");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cart.bridge.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/cart.bridge.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/cart.bridge.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cart.bridge.json"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/cart.bridge.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/cart.bridge.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/cart.bridge.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/cart.bridge.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cart.bridge.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cart.bridge.json',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cart.bridge.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/cart.bridge.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/cart.bridge.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/cart.bridge.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/cart.bridge.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cart.bridge.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cart.bridge.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cart.bridge.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cart.bridge.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/cart.bridge.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cart.bridge.json');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cart.bridge.json');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cart.bridge.json' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cart.bridge.json' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/cart.bridge.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cart.bridge.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cart.bridge.json"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cart.bridge.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/cart.bridge.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cart.bridge.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/cart.bridge.json \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/cart.bridge.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/cart.bridge.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cart.bridge.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
CartCatalogPriceRulesCount
{{baseUrl}}/cart.catalog_price_rules.count.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cart.catalog_price_rules.count.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/cart.catalog_price_rules.count.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/cart.catalog_price_rules.count.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/cart.catalog_price_rules.count.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cart.catalog_price_rules.count.json");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cart.catalog_price_rules.count.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/cart.catalog_price_rules.count.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/cart.catalog_price_rules.count.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cart.catalog_price_rules.count.json"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/cart.catalog_price_rules.count.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/cart.catalog_price_rules.count.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/cart.catalog_price_rules.count.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/cart.catalog_price_rules.count.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cart.catalog_price_rules.count.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cart.catalog_price_rules.count.json',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cart.catalog_price_rules.count.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/cart.catalog_price_rules.count.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/cart.catalog_price_rules.count.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/cart.catalog_price_rules.count.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/cart.catalog_price_rules.count.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cart.catalog_price_rules.count.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cart.catalog_price_rules.count.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cart.catalog_price_rules.count.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cart.catalog_price_rules.count.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/cart.catalog_price_rules.count.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cart.catalog_price_rules.count.json');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cart.catalog_price_rules.count.json');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cart.catalog_price_rules.count.json' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cart.catalog_price_rules.count.json' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/cart.catalog_price_rules.count.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cart.catalog_price_rules.count.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cart.catalog_price_rules.count.json"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cart.catalog_price_rules.count.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/cart.catalog_price_rules.count.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cart.catalog_price_rules.count.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/cart.catalog_price_rules.count.json \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/cart.catalog_price_rules.count.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/cart.catalog_price_rules.count.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cart.catalog_price_rules.count.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
CartCatalogPriceRulesList
{{baseUrl}}/cart.catalog_price_rules.list.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cart.catalog_price_rules.list.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/cart.catalog_price_rules.list.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/cart.catalog_price_rules.list.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/cart.catalog_price_rules.list.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cart.catalog_price_rules.list.json");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cart.catalog_price_rules.list.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/cart.catalog_price_rules.list.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/cart.catalog_price_rules.list.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cart.catalog_price_rules.list.json"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/cart.catalog_price_rules.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/cart.catalog_price_rules.list.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/cart.catalog_price_rules.list.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/cart.catalog_price_rules.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cart.catalog_price_rules.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cart.catalog_price_rules.list.json',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cart.catalog_price_rules.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/cart.catalog_price_rules.list.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/cart.catalog_price_rules.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/cart.catalog_price_rules.list.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/cart.catalog_price_rules.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cart.catalog_price_rules.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cart.catalog_price_rules.list.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cart.catalog_price_rules.list.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cart.catalog_price_rules.list.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/cart.catalog_price_rules.list.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cart.catalog_price_rules.list.json');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cart.catalog_price_rules.list.json');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cart.catalog_price_rules.list.json' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cart.catalog_price_rules.list.json' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/cart.catalog_price_rules.list.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cart.catalog_price_rules.list.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cart.catalog_price_rules.list.json"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cart.catalog_price_rules.list.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/cart.catalog_price_rules.list.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cart.catalog_price_rules.list.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/cart.catalog_price_rules.list.json \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/cart.catalog_price_rules.list.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/cart.catalog_price_rules.list.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cart.catalog_price_rules.list.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
CartClearCache
{{baseUrl}}/cart.clear_cache.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
cache_type
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cart.clear_cache.json?cache_type=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cart.clear_cache.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:cache_type ""}})
require "http/client"
url = "{{baseUrl}}/cart.clear_cache.json?cache_type="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.post url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/cart.clear_cache.json?cache_type="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cart.clear_cache.json?cache_type=");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cart.clear_cache.json?cache_type="
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/cart.clear_cache.json?cache_type= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cart.clear_cache.json?cache_type=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cart.clear_cache.json?cache_type="))
.header("x-api-key", "{{apiKey}}")
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/cart.clear_cache.json?cache_type=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cart.clear_cache.json?cache_type=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cart.clear_cache.json?cache_type=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cart.clear_cache.json',
params: {cache_type: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cart.clear_cache.json?cache_type=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cart.clear_cache.json?cache_type=',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cart.clear_cache.json?cache_type=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/cart.clear_cache.json?cache_type=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cart.clear_cache.json',
qs: {cache_type: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/cart.clear_cache.json');
req.query({
cache_type: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/cart.clear_cache.json',
params: {cache_type: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cart.clear_cache.json?cache_type=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cart.clear_cache.json?cache_type="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cart.clear_cache.json?cache_type=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cart.clear_cache.json?cache_type=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/cart.clear_cache.json?cache_type=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cart.clear_cache.json');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'cache_type' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cart.clear_cache.json');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'cache_type' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cart.clear_cache.json?cache_type=' -Method POST -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cart.clear_cache.json?cache_type=' -Method POST -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("POST", "/baseUrl/cart.clear_cache.json?cache_type=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cart.clear_cache.json"
querystring = {"cache_type":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.post(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cart.clear_cache.json"
queryString <- list(cache_type = "")
response <- VERB("POST", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cart.clear_cache.json?cache_type=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/cart.clear_cache.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['cache_type'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cart.clear_cache.json";
let querystring = [
("cache_type", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/cart.clear_cache.json?cache_type=' \
--header 'x-api-key: {{apiKey}}'
http POST '{{baseUrl}}/cart.clear_cache.json?cache_type=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/cart.clear_cache.json?cache_type='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cart.clear_cache.json?cache_type=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
CartConfig
{{baseUrl}}/cart.config.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cart.config.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/cart.config.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/cart.config.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/cart.config.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cart.config.json");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cart.config.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/cart.config.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/cart.config.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cart.config.json"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/cart.config.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/cart.config.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/cart.config.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/cart.config.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cart.config.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cart.config.json',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cart.config.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/cart.config.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/cart.config.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/cart.config.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/cart.config.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cart.config.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cart.config.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cart.config.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cart.config.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/cart.config.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cart.config.json');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cart.config.json');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cart.config.json' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cart.config.json' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/cart.config.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cart.config.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cart.config.json"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cart.config.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/cart.config.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cart.config.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/cart.config.json \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/cart.config.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/cart.config.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cart.config.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PUT
CartConfigUpdate
{{baseUrl}}/cart.config.update.json
HEADERS
x-api-key
{{apiKey}}
BODY json
{
"custom_fields": {},
"db_tables_prefix": "",
"store_id": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cart.config.update.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"custom_fields\": {},\n \"db_tables_prefix\": \"\",\n \"store_id\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/cart.config.update.json" {:headers {:x-api-key "{{apiKey}}"}
:content-type :json
:form-params {:custom_fields {}
:db_tables_prefix ""
:store_id ""}})
require "http/client"
url = "{{baseUrl}}/cart.config.update.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"custom_fields\": {},\n \"db_tables_prefix\": \"\",\n \"store_id\": \"\"\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/cart.config.update.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
Content = new StringContent("{\n \"custom_fields\": {},\n \"db_tables_prefix\": \"\",\n \"store_id\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cart.config.update.json");
var request = new RestRequest("", Method.Put);
request.AddHeader("x-api-key", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"custom_fields\": {},\n \"db_tables_prefix\": \"\",\n \"store_id\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cart.config.update.json"
payload := strings.NewReader("{\n \"custom_fields\": {},\n \"db_tables_prefix\": \"\",\n \"store_id\": \"\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/cart.config.update.json HTTP/1.1
X-Api-Key: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 69
{
"custom_fields": {},
"db_tables_prefix": "",
"store_id": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/cart.config.update.json")
.setHeader("x-api-key", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"custom_fields\": {},\n \"db_tables_prefix\": \"\",\n \"store_id\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cart.config.update.json"))
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"custom_fields\": {},\n \"db_tables_prefix\": \"\",\n \"store_id\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"custom_fields\": {},\n \"db_tables_prefix\": \"\",\n \"store_id\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/cart.config.update.json")
.put(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/cart.config.update.json")
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"custom_fields\": {},\n \"db_tables_prefix\": \"\",\n \"store_id\": \"\"\n}")
.asString();
const data = JSON.stringify({
custom_fields: {},
db_tables_prefix: '',
store_id: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/cart.config.update.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/cart.config.update.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {custom_fields: {}, db_tables_prefix: '', store_id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cart.config.update.json';
const options = {
method: 'PUT',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"custom_fields":{},"db_tables_prefix":"","store_id":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cart.config.update.json',
method: 'PUT',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "custom_fields": {},\n "db_tables_prefix": "",\n "store_id": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"custom_fields\": {},\n \"db_tables_prefix\": \"\",\n \"store_id\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/cart.config.update.json")
.put(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/cart.config.update.json',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({custom_fields: {}, db_tables_prefix: '', store_id: ''}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/cart.config.update.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: {custom_fields: {}, db_tables_prefix: '', store_id: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/cart.config.update.json');
req.headers({
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
custom_fields: {},
db_tables_prefix: '',
store_id: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/cart.config.update.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {custom_fields: {}, db_tables_prefix: '', store_id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cart.config.update.json';
const options = {
method: 'PUT',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"custom_fields":{},"db_tables_prefix":"","store_id":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"custom_fields": @{ },
@"db_tables_prefix": @"",
@"store_id": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cart.config.update.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cart.config.update.json" in
let headers = Header.add_list (Header.init ()) [
("x-api-key", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"custom_fields\": {},\n \"db_tables_prefix\": \"\",\n \"store_id\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cart.config.update.json",
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([
'custom_fields' => [
],
'db_tables_prefix' => '',
'store_id' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/cart.config.update.json', [
'body' => '{
"custom_fields": {},
"db_tables_prefix": "",
"store_id": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cart.config.update.json');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'custom_fields' => [
],
'db_tables_prefix' => '',
'store_id' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'custom_fields' => [
],
'db_tables_prefix' => '',
'store_id' => ''
]));
$request->setRequestUrl('{{baseUrl}}/cart.config.update.json');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cart.config.update.json' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"custom_fields": {},
"db_tables_prefix": "",
"store_id": ""
}'
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cart.config.update.json' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"custom_fields": {},
"db_tables_prefix": "",
"store_id": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"custom_fields\": {},\n \"db_tables_prefix\": \"\",\n \"store_id\": \"\"\n}"
headers = {
'x-api-key': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("PUT", "/baseUrl/cart.config.update.json", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cart.config.update.json"
payload = {
"custom_fields": {},
"db_tables_prefix": "",
"store_id": ""
}
headers = {
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cart.config.update.json"
payload <- "{\n \"custom_fields\": {},\n \"db_tables_prefix\": \"\",\n \"store_id\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cart.config.update.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"custom_fields\": {},\n \"db_tables_prefix\": \"\",\n \"store_id\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/cart.config.update.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.body = "{\n \"custom_fields\": {},\n \"db_tables_prefix\": \"\",\n \"store_id\": \"\"\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cart.config.update.json";
let payload = json!({
"custom_fields": json!({}),
"db_tables_prefix": "",
"store_id": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/cart.config.update.json \
--header 'content-type: application/json' \
--header 'x-api-key: {{apiKey}}' \
--data '{
"custom_fields": {},
"db_tables_prefix": "",
"store_id": ""
}'
echo '{
"custom_fields": {},
"db_tables_prefix": "",
"store_id": ""
}' | \
http PUT {{baseUrl}}/cart.config.update.json \
content-type:application/json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method PUT \
--header 'x-api-key: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "custom_fields": {},\n "db_tables_prefix": "",\n "store_id": ""\n}' \
--output-document \
- {{baseUrl}}/cart.config.update.json
import Foundation
let headers = [
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"custom_fields": [],
"db_tables_prefix": "",
"store_id": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cart.config.update.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
CartCouponAdd
{{baseUrl}}/cart.coupon.add.json
HEADERS
x-api-key
{{apiKey}}
BODY json
{
"action_amount": "",
"action_apply_to": "",
"action_condition_entity": "",
"action_condition_key": "",
"action_condition_operator": "",
"action_condition_value": "",
"action_scope": "",
"action_type": "",
"code": "",
"codes": [],
"date_end": "",
"date_start": "",
"name": "",
"store_id": "",
"usage_limit": 0,
"usage_limit_per_customer": 0
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cart.coupon.add.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"action_amount\": \"\",\n \"action_apply_to\": \"\",\n \"action_condition_entity\": \"\",\n \"action_condition_key\": \"\",\n \"action_condition_operator\": \"\",\n \"action_condition_value\": \"\",\n \"action_scope\": \"\",\n \"action_type\": \"\",\n \"code\": \"\",\n \"codes\": [],\n \"date_end\": \"\",\n \"date_start\": \"\",\n \"name\": \"\",\n \"store_id\": \"\",\n \"usage_limit\": 0,\n \"usage_limit_per_customer\": 0\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cart.coupon.add.json" {:headers {:x-api-key "{{apiKey}}"}
:content-type :json
:form-params {:action_amount ""
:action_apply_to ""
:action_condition_entity ""
:action_condition_key ""
:action_condition_operator ""
:action_condition_value ""
:action_scope ""
:action_type ""
:code ""
:codes []
:date_end ""
:date_start ""
:name ""
:store_id ""
:usage_limit 0
:usage_limit_per_customer 0}})
require "http/client"
url = "{{baseUrl}}/cart.coupon.add.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"action_amount\": \"\",\n \"action_apply_to\": \"\",\n \"action_condition_entity\": \"\",\n \"action_condition_key\": \"\",\n \"action_condition_operator\": \"\",\n \"action_condition_value\": \"\",\n \"action_scope\": \"\",\n \"action_type\": \"\",\n \"code\": \"\",\n \"codes\": [],\n \"date_end\": \"\",\n \"date_start\": \"\",\n \"name\": \"\",\n \"store_id\": \"\",\n \"usage_limit\": 0,\n \"usage_limit_per_customer\": 0\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/cart.coupon.add.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
Content = new StringContent("{\n \"action_amount\": \"\",\n \"action_apply_to\": \"\",\n \"action_condition_entity\": \"\",\n \"action_condition_key\": \"\",\n \"action_condition_operator\": \"\",\n \"action_condition_value\": \"\",\n \"action_scope\": \"\",\n \"action_type\": \"\",\n \"code\": \"\",\n \"codes\": [],\n \"date_end\": \"\",\n \"date_start\": \"\",\n \"name\": \"\",\n \"store_id\": \"\",\n \"usage_limit\": 0,\n \"usage_limit_per_customer\": 0\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cart.coupon.add.json");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"action_amount\": \"\",\n \"action_apply_to\": \"\",\n \"action_condition_entity\": \"\",\n \"action_condition_key\": \"\",\n \"action_condition_operator\": \"\",\n \"action_condition_value\": \"\",\n \"action_scope\": \"\",\n \"action_type\": \"\",\n \"code\": \"\",\n \"codes\": [],\n \"date_end\": \"\",\n \"date_start\": \"\",\n \"name\": \"\",\n \"store_id\": \"\",\n \"usage_limit\": 0,\n \"usage_limit_per_customer\": 0\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cart.coupon.add.json"
payload := strings.NewReader("{\n \"action_amount\": \"\",\n \"action_apply_to\": \"\",\n \"action_condition_entity\": \"\",\n \"action_condition_key\": \"\",\n \"action_condition_operator\": \"\",\n \"action_condition_value\": \"\",\n \"action_scope\": \"\",\n \"action_type\": \"\",\n \"code\": \"\",\n \"codes\": [],\n \"date_end\": \"\",\n \"date_start\": \"\",\n \"name\": \"\",\n \"store_id\": \"\",\n \"usage_limit\": 0,\n \"usage_limit_per_customer\": 0\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/cart.coupon.add.json HTTP/1.1
X-Api-Key: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 375
{
"action_amount": "",
"action_apply_to": "",
"action_condition_entity": "",
"action_condition_key": "",
"action_condition_operator": "",
"action_condition_value": "",
"action_scope": "",
"action_type": "",
"code": "",
"codes": [],
"date_end": "",
"date_start": "",
"name": "",
"store_id": "",
"usage_limit": 0,
"usage_limit_per_customer": 0
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cart.coupon.add.json")
.setHeader("x-api-key", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"action_amount\": \"\",\n \"action_apply_to\": \"\",\n \"action_condition_entity\": \"\",\n \"action_condition_key\": \"\",\n \"action_condition_operator\": \"\",\n \"action_condition_value\": \"\",\n \"action_scope\": \"\",\n \"action_type\": \"\",\n \"code\": \"\",\n \"codes\": [],\n \"date_end\": \"\",\n \"date_start\": \"\",\n \"name\": \"\",\n \"store_id\": \"\",\n \"usage_limit\": 0,\n \"usage_limit_per_customer\": 0\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cart.coupon.add.json"))
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"action_amount\": \"\",\n \"action_apply_to\": \"\",\n \"action_condition_entity\": \"\",\n \"action_condition_key\": \"\",\n \"action_condition_operator\": \"\",\n \"action_condition_value\": \"\",\n \"action_scope\": \"\",\n \"action_type\": \"\",\n \"code\": \"\",\n \"codes\": [],\n \"date_end\": \"\",\n \"date_start\": \"\",\n \"name\": \"\",\n \"store_id\": \"\",\n \"usage_limit\": 0,\n \"usage_limit_per_customer\": 0\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"action_amount\": \"\",\n \"action_apply_to\": \"\",\n \"action_condition_entity\": \"\",\n \"action_condition_key\": \"\",\n \"action_condition_operator\": \"\",\n \"action_condition_value\": \"\",\n \"action_scope\": \"\",\n \"action_type\": \"\",\n \"code\": \"\",\n \"codes\": [],\n \"date_end\": \"\",\n \"date_start\": \"\",\n \"name\": \"\",\n \"store_id\": \"\",\n \"usage_limit\": 0,\n \"usage_limit_per_customer\": 0\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/cart.coupon.add.json")
.post(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cart.coupon.add.json")
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"action_amount\": \"\",\n \"action_apply_to\": \"\",\n \"action_condition_entity\": \"\",\n \"action_condition_key\": \"\",\n \"action_condition_operator\": \"\",\n \"action_condition_value\": \"\",\n \"action_scope\": \"\",\n \"action_type\": \"\",\n \"code\": \"\",\n \"codes\": [],\n \"date_end\": \"\",\n \"date_start\": \"\",\n \"name\": \"\",\n \"store_id\": \"\",\n \"usage_limit\": 0,\n \"usage_limit_per_customer\": 0\n}")
.asString();
const data = JSON.stringify({
action_amount: '',
action_apply_to: '',
action_condition_entity: '',
action_condition_key: '',
action_condition_operator: '',
action_condition_value: '',
action_scope: '',
action_type: '',
code: '',
codes: [],
date_end: '',
date_start: '',
name: '',
store_id: '',
usage_limit: 0,
usage_limit_per_customer: 0
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cart.coupon.add.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cart.coupon.add.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {
action_amount: '',
action_apply_to: '',
action_condition_entity: '',
action_condition_key: '',
action_condition_operator: '',
action_condition_value: '',
action_scope: '',
action_type: '',
code: '',
codes: [],
date_end: '',
date_start: '',
name: '',
store_id: '',
usage_limit: 0,
usage_limit_per_customer: 0
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cart.coupon.add.json';
const options = {
method: 'POST',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"action_amount":"","action_apply_to":"","action_condition_entity":"","action_condition_key":"","action_condition_operator":"","action_condition_value":"","action_scope":"","action_type":"","code":"","codes":[],"date_end":"","date_start":"","name":"","store_id":"","usage_limit":0,"usage_limit_per_customer":0}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cart.coupon.add.json',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "action_amount": "",\n "action_apply_to": "",\n "action_condition_entity": "",\n "action_condition_key": "",\n "action_condition_operator": "",\n "action_condition_value": "",\n "action_scope": "",\n "action_type": "",\n "code": "",\n "codes": [],\n "date_end": "",\n "date_start": "",\n "name": "",\n "store_id": "",\n "usage_limit": 0,\n "usage_limit_per_customer": 0\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"action_amount\": \"\",\n \"action_apply_to\": \"\",\n \"action_condition_entity\": \"\",\n \"action_condition_key\": \"\",\n \"action_condition_operator\": \"\",\n \"action_condition_value\": \"\",\n \"action_scope\": \"\",\n \"action_type\": \"\",\n \"code\": \"\",\n \"codes\": [],\n \"date_end\": \"\",\n \"date_start\": \"\",\n \"name\": \"\",\n \"store_id\": \"\",\n \"usage_limit\": 0,\n \"usage_limit_per_customer\": 0\n}")
val request = Request.Builder()
.url("{{baseUrl}}/cart.coupon.add.json")
.post(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/cart.coupon.add.json',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
action_amount: '',
action_apply_to: '',
action_condition_entity: '',
action_condition_key: '',
action_condition_operator: '',
action_condition_value: '',
action_scope: '',
action_type: '',
code: '',
codes: [],
date_end: '',
date_start: '',
name: '',
store_id: '',
usage_limit: 0,
usage_limit_per_customer: 0
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cart.coupon.add.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: {
action_amount: '',
action_apply_to: '',
action_condition_entity: '',
action_condition_key: '',
action_condition_operator: '',
action_condition_value: '',
action_scope: '',
action_type: '',
code: '',
codes: [],
date_end: '',
date_start: '',
name: '',
store_id: '',
usage_limit: 0,
usage_limit_per_customer: 0
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/cart.coupon.add.json');
req.headers({
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
action_amount: '',
action_apply_to: '',
action_condition_entity: '',
action_condition_key: '',
action_condition_operator: '',
action_condition_value: '',
action_scope: '',
action_type: '',
code: '',
codes: [],
date_end: '',
date_start: '',
name: '',
store_id: '',
usage_limit: 0,
usage_limit_per_customer: 0
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/cart.coupon.add.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {
action_amount: '',
action_apply_to: '',
action_condition_entity: '',
action_condition_key: '',
action_condition_operator: '',
action_condition_value: '',
action_scope: '',
action_type: '',
code: '',
codes: [],
date_end: '',
date_start: '',
name: '',
store_id: '',
usage_limit: 0,
usage_limit_per_customer: 0
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cart.coupon.add.json';
const options = {
method: 'POST',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"action_amount":"","action_apply_to":"","action_condition_entity":"","action_condition_key":"","action_condition_operator":"","action_condition_value":"","action_scope":"","action_type":"","code":"","codes":[],"date_end":"","date_start":"","name":"","store_id":"","usage_limit":0,"usage_limit_per_customer":0}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"action_amount": @"",
@"action_apply_to": @"",
@"action_condition_entity": @"",
@"action_condition_key": @"",
@"action_condition_operator": @"",
@"action_condition_value": @"",
@"action_scope": @"",
@"action_type": @"",
@"code": @"",
@"codes": @[ ],
@"date_end": @"",
@"date_start": @"",
@"name": @"",
@"store_id": @"",
@"usage_limit": @0,
@"usage_limit_per_customer": @0 };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cart.coupon.add.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cart.coupon.add.json" in
let headers = Header.add_list (Header.init ()) [
("x-api-key", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"action_amount\": \"\",\n \"action_apply_to\": \"\",\n \"action_condition_entity\": \"\",\n \"action_condition_key\": \"\",\n \"action_condition_operator\": \"\",\n \"action_condition_value\": \"\",\n \"action_scope\": \"\",\n \"action_type\": \"\",\n \"code\": \"\",\n \"codes\": [],\n \"date_end\": \"\",\n \"date_start\": \"\",\n \"name\": \"\",\n \"store_id\": \"\",\n \"usage_limit\": 0,\n \"usage_limit_per_customer\": 0\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cart.coupon.add.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'action_amount' => '',
'action_apply_to' => '',
'action_condition_entity' => '',
'action_condition_key' => '',
'action_condition_operator' => '',
'action_condition_value' => '',
'action_scope' => '',
'action_type' => '',
'code' => '',
'codes' => [
],
'date_end' => '',
'date_start' => '',
'name' => '',
'store_id' => '',
'usage_limit' => 0,
'usage_limit_per_customer' => 0
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/cart.coupon.add.json', [
'body' => '{
"action_amount": "",
"action_apply_to": "",
"action_condition_entity": "",
"action_condition_key": "",
"action_condition_operator": "",
"action_condition_value": "",
"action_scope": "",
"action_type": "",
"code": "",
"codes": [],
"date_end": "",
"date_start": "",
"name": "",
"store_id": "",
"usage_limit": 0,
"usage_limit_per_customer": 0
}',
'headers' => [
'content-type' => 'application/json',
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cart.coupon.add.json');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'action_amount' => '',
'action_apply_to' => '',
'action_condition_entity' => '',
'action_condition_key' => '',
'action_condition_operator' => '',
'action_condition_value' => '',
'action_scope' => '',
'action_type' => '',
'code' => '',
'codes' => [
],
'date_end' => '',
'date_start' => '',
'name' => '',
'store_id' => '',
'usage_limit' => 0,
'usage_limit_per_customer' => 0
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'action_amount' => '',
'action_apply_to' => '',
'action_condition_entity' => '',
'action_condition_key' => '',
'action_condition_operator' => '',
'action_condition_value' => '',
'action_scope' => '',
'action_type' => '',
'code' => '',
'codes' => [
],
'date_end' => '',
'date_start' => '',
'name' => '',
'store_id' => '',
'usage_limit' => 0,
'usage_limit_per_customer' => 0
]));
$request->setRequestUrl('{{baseUrl}}/cart.coupon.add.json');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cart.coupon.add.json' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"action_amount": "",
"action_apply_to": "",
"action_condition_entity": "",
"action_condition_key": "",
"action_condition_operator": "",
"action_condition_value": "",
"action_scope": "",
"action_type": "",
"code": "",
"codes": [],
"date_end": "",
"date_start": "",
"name": "",
"store_id": "",
"usage_limit": 0,
"usage_limit_per_customer": 0
}'
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cart.coupon.add.json' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"action_amount": "",
"action_apply_to": "",
"action_condition_entity": "",
"action_condition_key": "",
"action_condition_operator": "",
"action_condition_value": "",
"action_scope": "",
"action_type": "",
"code": "",
"codes": [],
"date_end": "",
"date_start": "",
"name": "",
"store_id": "",
"usage_limit": 0,
"usage_limit_per_customer": 0
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"action_amount\": \"\",\n \"action_apply_to\": \"\",\n \"action_condition_entity\": \"\",\n \"action_condition_key\": \"\",\n \"action_condition_operator\": \"\",\n \"action_condition_value\": \"\",\n \"action_scope\": \"\",\n \"action_type\": \"\",\n \"code\": \"\",\n \"codes\": [],\n \"date_end\": \"\",\n \"date_start\": \"\",\n \"name\": \"\",\n \"store_id\": \"\",\n \"usage_limit\": 0,\n \"usage_limit_per_customer\": 0\n}"
headers = {
'x-api-key': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/cart.coupon.add.json", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cart.coupon.add.json"
payload = {
"action_amount": "",
"action_apply_to": "",
"action_condition_entity": "",
"action_condition_key": "",
"action_condition_operator": "",
"action_condition_value": "",
"action_scope": "",
"action_type": "",
"code": "",
"codes": [],
"date_end": "",
"date_start": "",
"name": "",
"store_id": "",
"usage_limit": 0,
"usage_limit_per_customer": 0
}
headers = {
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cart.coupon.add.json"
payload <- "{\n \"action_amount\": \"\",\n \"action_apply_to\": \"\",\n \"action_condition_entity\": \"\",\n \"action_condition_key\": \"\",\n \"action_condition_operator\": \"\",\n \"action_condition_value\": \"\",\n \"action_scope\": \"\",\n \"action_type\": \"\",\n \"code\": \"\",\n \"codes\": [],\n \"date_end\": \"\",\n \"date_start\": \"\",\n \"name\": \"\",\n \"store_id\": \"\",\n \"usage_limit\": 0,\n \"usage_limit_per_customer\": 0\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cart.coupon.add.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"action_amount\": \"\",\n \"action_apply_to\": \"\",\n \"action_condition_entity\": \"\",\n \"action_condition_key\": \"\",\n \"action_condition_operator\": \"\",\n \"action_condition_value\": \"\",\n \"action_scope\": \"\",\n \"action_type\": \"\",\n \"code\": \"\",\n \"codes\": [],\n \"date_end\": \"\",\n \"date_start\": \"\",\n \"name\": \"\",\n \"store_id\": \"\",\n \"usage_limit\": 0,\n \"usage_limit_per_customer\": 0\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/cart.coupon.add.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.body = "{\n \"action_amount\": \"\",\n \"action_apply_to\": \"\",\n \"action_condition_entity\": \"\",\n \"action_condition_key\": \"\",\n \"action_condition_operator\": \"\",\n \"action_condition_value\": \"\",\n \"action_scope\": \"\",\n \"action_type\": \"\",\n \"code\": \"\",\n \"codes\": [],\n \"date_end\": \"\",\n \"date_start\": \"\",\n \"name\": \"\",\n \"store_id\": \"\",\n \"usage_limit\": 0,\n \"usage_limit_per_customer\": 0\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cart.coupon.add.json";
let payload = json!({
"action_amount": "",
"action_apply_to": "",
"action_condition_entity": "",
"action_condition_key": "",
"action_condition_operator": "",
"action_condition_value": "",
"action_scope": "",
"action_type": "",
"code": "",
"codes": (),
"date_end": "",
"date_start": "",
"name": "",
"store_id": "",
"usage_limit": 0,
"usage_limit_per_customer": 0
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/cart.coupon.add.json \
--header 'content-type: application/json' \
--header 'x-api-key: {{apiKey}}' \
--data '{
"action_amount": "",
"action_apply_to": "",
"action_condition_entity": "",
"action_condition_key": "",
"action_condition_operator": "",
"action_condition_value": "",
"action_scope": "",
"action_type": "",
"code": "",
"codes": [],
"date_end": "",
"date_start": "",
"name": "",
"store_id": "",
"usage_limit": 0,
"usage_limit_per_customer": 0
}'
echo '{
"action_amount": "",
"action_apply_to": "",
"action_condition_entity": "",
"action_condition_key": "",
"action_condition_operator": "",
"action_condition_value": "",
"action_scope": "",
"action_type": "",
"code": "",
"codes": [],
"date_end": "",
"date_start": "",
"name": "",
"store_id": "",
"usage_limit": 0,
"usage_limit_per_customer": 0
}' | \
http POST {{baseUrl}}/cart.coupon.add.json \
content-type:application/json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "action_amount": "",\n "action_apply_to": "",\n "action_condition_entity": "",\n "action_condition_key": "",\n "action_condition_operator": "",\n "action_condition_value": "",\n "action_scope": "",\n "action_type": "",\n "code": "",\n "codes": [],\n "date_end": "",\n "date_start": "",\n "name": "",\n "store_id": "",\n "usage_limit": 0,\n "usage_limit_per_customer": 0\n}' \
--output-document \
- {{baseUrl}}/cart.coupon.add.json
import Foundation
let headers = [
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"action_amount": "",
"action_apply_to": "",
"action_condition_entity": "",
"action_condition_key": "",
"action_condition_operator": "",
"action_condition_value": "",
"action_scope": "",
"action_type": "",
"code": "",
"codes": [],
"date_end": "",
"date_start": "",
"name": "",
"store_id": "",
"usage_limit": 0,
"usage_limit_per_customer": 0
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cart.coupon.add.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
CartCouponConditionAdd
{{baseUrl}}/cart.coupon.condition.add.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
coupon_id
entity
key
operator
value
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cart.coupon.condition.add.json?coupon_id=&entity=&key=&operator=&value=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cart.coupon.condition.add.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:coupon_id ""
:entity ""
:key ""
:operator ""
:value ""}})
require "http/client"
url = "{{baseUrl}}/cart.coupon.condition.add.json?coupon_id=&entity=&key=&operator=&value="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.post url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/cart.coupon.condition.add.json?coupon_id=&entity=&key=&operator=&value="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cart.coupon.condition.add.json?coupon_id=&entity=&key=&operator=&value=");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cart.coupon.condition.add.json?coupon_id=&entity=&key=&operator=&value="
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/cart.coupon.condition.add.json?coupon_id=&entity=&key=&operator=&value= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cart.coupon.condition.add.json?coupon_id=&entity=&key=&operator=&value=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cart.coupon.condition.add.json?coupon_id=&entity=&key=&operator=&value="))
.header("x-api-key", "{{apiKey}}")
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/cart.coupon.condition.add.json?coupon_id=&entity=&key=&operator=&value=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cart.coupon.condition.add.json?coupon_id=&entity=&key=&operator=&value=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cart.coupon.condition.add.json?coupon_id=&entity=&key=&operator=&value=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cart.coupon.condition.add.json',
params: {coupon_id: '', entity: '', key: '', operator: '', value: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cart.coupon.condition.add.json?coupon_id=&entity=&key=&operator=&value=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cart.coupon.condition.add.json?coupon_id=&entity=&key=&operator=&value=',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cart.coupon.condition.add.json?coupon_id=&entity=&key=&operator=&value=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/cart.coupon.condition.add.json?coupon_id=&entity=&key=&operator=&value=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cart.coupon.condition.add.json',
qs: {coupon_id: '', entity: '', key: '', operator: '', value: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/cart.coupon.condition.add.json');
req.query({
coupon_id: '',
entity: '',
key: '',
operator: '',
value: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/cart.coupon.condition.add.json',
params: {coupon_id: '', entity: '', key: '', operator: '', value: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cart.coupon.condition.add.json?coupon_id=&entity=&key=&operator=&value=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cart.coupon.condition.add.json?coupon_id=&entity=&key=&operator=&value="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cart.coupon.condition.add.json?coupon_id=&entity=&key=&operator=&value=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cart.coupon.condition.add.json?coupon_id=&entity=&key=&operator=&value=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/cart.coupon.condition.add.json?coupon_id=&entity=&key=&operator=&value=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cart.coupon.condition.add.json');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'coupon_id' => '',
'entity' => '',
'key' => '',
'operator' => '',
'value' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cart.coupon.condition.add.json');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'coupon_id' => '',
'entity' => '',
'key' => '',
'operator' => '',
'value' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cart.coupon.condition.add.json?coupon_id=&entity=&key=&operator=&value=' -Method POST -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cart.coupon.condition.add.json?coupon_id=&entity=&key=&operator=&value=' -Method POST -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("POST", "/baseUrl/cart.coupon.condition.add.json?coupon_id=&entity=&key=&operator=&value=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cart.coupon.condition.add.json"
querystring = {"coupon_id":"","entity":"","key":"","operator":"","value":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.post(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cart.coupon.condition.add.json"
queryString <- list(
coupon_id = "",
entity = "",
operator = "",
value = ""
)
response <- VERB("POST", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cart.coupon.condition.add.json?coupon_id=&entity=&key=&operator=&value=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/cart.coupon.condition.add.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['coupon_id'] = ''
req.params['entity'] = ''
req.params['key'] = ''
req.params['operator'] = ''
req.params['value'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cart.coupon.condition.add.json";
let querystring = [
("coupon_id", ""),
("entity", ""),
("key", ""),
("operator", ""),
("value", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/cart.coupon.condition.add.json?coupon_id=&entity=&key=&operator=&value=' \
--header 'x-api-key: {{apiKey}}'
http POST '{{baseUrl}}/cart.coupon.condition.add.json?coupon_id=&entity=&key=&operator=&value=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/cart.coupon.condition.add.json?coupon_id=&entity=&key=&operator=&value='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cart.coupon.condition.add.json?coupon_id=&entity=&key=&operator=&value=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
CartCouponCount
{{baseUrl}}/cart.coupon.count.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cart.coupon.count.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/cart.coupon.count.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/cart.coupon.count.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/cart.coupon.count.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cart.coupon.count.json");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cart.coupon.count.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/cart.coupon.count.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/cart.coupon.count.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cart.coupon.count.json"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/cart.coupon.count.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/cart.coupon.count.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/cart.coupon.count.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/cart.coupon.count.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cart.coupon.count.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cart.coupon.count.json',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cart.coupon.count.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/cart.coupon.count.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/cart.coupon.count.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/cart.coupon.count.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/cart.coupon.count.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cart.coupon.count.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cart.coupon.count.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cart.coupon.count.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cart.coupon.count.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/cart.coupon.count.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cart.coupon.count.json');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cart.coupon.count.json');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cart.coupon.count.json' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cart.coupon.count.json' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/cart.coupon.count.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cart.coupon.count.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cart.coupon.count.json"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cart.coupon.count.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/cart.coupon.count.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cart.coupon.count.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/cart.coupon.count.json \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/cart.coupon.count.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/cart.coupon.count.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cart.coupon.count.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
DELETE
CartCouponDelete
{{baseUrl}}/cart.coupon.delete.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cart.coupon.delete.json?id=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/cart.coupon.delete.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:id ""}})
require "http/client"
url = "{{baseUrl}}/cart.coupon.delete.json?id="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.delete url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/cart.coupon.delete.json?id="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cart.coupon.delete.json?id=");
var request = new RestRequest("", Method.Delete);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cart.coupon.delete.json?id="
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/cart.coupon.delete.json?id= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/cart.coupon.delete.json?id=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cart.coupon.delete.json?id="))
.header("x-api-key", "{{apiKey}}")
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/cart.coupon.delete.json?id=")
.delete(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/cart.coupon.delete.json?id=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/cart.coupon.delete.json?id=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/cart.coupon.delete.json',
params: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cart.coupon.delete.json?id=';
const options = {method: 'DELETE', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cart.coupon.delete.json?id=',
method: 'DELETE',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cart.coupon.delete.json?id=")
.delete(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/cart.coupon.delete.json?id=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/cart.coupon.delete.json',
qs: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/cart.coupon.delete.json');
req.query({
id: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/cart.coupon.delete.json',
params: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cart.coupon.delete.json?id=';
const options = {method: 'DELETE', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cart.coupon.delete.json?id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cart.coupon.delete.json?id=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cart.coupon.delete.json?id=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/cart.coupon.delete.json?id=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cart.coupon.delete.json');
$request->setMethod(HTTP_METH_DELETE);
$request->setQueryData([
'id' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cart.coupon.delete.json');
$request->setRequestMethod('DELETE');
$request->setQuery(new http\QueryString([
'id' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cart.coupon.delete.json?id=' -Method DELETE -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cart.coupon.delete.json?id=' -Method DELETE -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("DELETE", "/baseUrl/cart.coupon.delete.json?id=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cart.coupon.delete.json"
querystring = {"id":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.delete(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cart.coupon.delete.json"
queryString <- list(id = "")
response <- VERB("DELETE", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cart.coupon.delete.json?id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/cart.coupon.delete.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['id'] = ''
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cart.coupon.delete.json";
let querystring = [
("id", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url '{{baseUrl}}/cart.coupon.delete.json?id=' \
--header 'x-api-key: {{apiKey}}'
http DELETE '{{baseUrl}}/cart.coupon.delete.json?id=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method DELETE \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/cart.coupon.delete.json?id='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cart.coupon.delete.json?id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
CartCouponList
{{baseUrl}}/cart.coupon.list.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cart.coupon.list.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/cart.coupon.list.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/cart.coupon.list.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/cart.coupon.list.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cart.coupon.list.json");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cart.coupon.list.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/cart.coupon.list.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/cart.coupon.list.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cart.coupon.list.json"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/cart.coupon.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/cart.coupon.list.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/cart.coupon.list.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/cart.coupon.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cart.coupon.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cart.coupon.list.json',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cart.coupon.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/cart.coupon.list.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/cart.coupon.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/cart.coupon.list.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/cart.coupon.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cart.coupon.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cart.coupon.list.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cart.coupon.list.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cart.coupon.list.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/cart.coupon.list.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cart.coupon.list.json');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cart.coupon.list.json');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cart.coupon.list.json' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cart.coupon.list.json' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/cart.coupon.list.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cart.coupon.list.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cart.coupon.list.json"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cart.coupon.list.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/cart.coupon.list.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cart.coupon.list.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/cart.coupon.list.json \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/cart.coupon.list.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/cart.coupon.list.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cart.coupon.list.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
CartCreate
{{baseUrl}}/cart.create.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
cart_id
store_url
etsy_client_id
etsy_refresh_token
store_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cart.create.json?cart_id=&store_url=&etsy_client_id=&etsy_refresh_token=&store_id=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cart.create.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:cart_id ""
:store_url ""
:etsy_client_id ""
:etsy_refresh_token ""
:store_id ""}})
require "http/client"
url = "{{baseUrl}}/cart.create.json?cart_id=&store_url=&etsy_client_id=&etsy_refresh_token=&store_id="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.post url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/cart.create.json?cart_id=&store_url=&etsy_client_id=&etsy_refresh_token=&store_id="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cart.create.json?cart_id=&store_url=&etsy_client_id=&etsy_refresh_token=&store_id=");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cart.create.json?cart_id=&store_url=&etsy_client_id=&etsy_refresh_token=&store_id="
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/cart.create.json?cart_id=&store_url=&etsy_client_id=&etsy_refresh_token=&store_id= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cart.create.json?cart_id=&store_url=&etsy_client_id=&etsy_refresh_token=&store_id=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cart.create.json?cart_id=&store_url=&etsy_client_id=&etsy_refresh_token=&store_id="))
.header("x-api-key", "{{apiKey}}")
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/cart.create.json?cart_id=&store_url=&etsy_client_id=&etsy_refresh_token=&store_id=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cart.create.json?cart_id=&store_url=&etsy_client_id=&etsy_refresh_token=&store_id=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cart.create.json?cart_id=&store_url=&etsy_client_id=&etsy_refresh_token=&store_id=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cart.create.json',
params: {
cart_id: '',
store_url: '',
etsy_client_id: '',
etsy_refresh_token: '',
store_id: ''
},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cart.create.json?cart_id=&store_url=&etsy_client_id=&etsy_refresh_token=&store_id=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cart.create.json?cart_id=&store_url=&etsy_client_id=&etsy_refresh_token=&store_id=',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cart.create.json?cart_id=&store_url=&etsy_client_id=&etsy_refresh_token=&store_id=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/cart.create.json?cart_id=&store_url=&etsy_client_id=&etsy_refresh_token=&store_id=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cart.create.json',
qs: {
cart_id: '',
store_url: '',
etsy_client_id: '',
etsy_refresh_token: '',
store_id: ''
},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/cart.create.json');
req.query({
cart_id: '',
store_url: '',
etsy_client_id: '',
etsy_refresh_token: '',
store_id: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/cart.create.json',
params: {
cart_id: '',
store_url: '',
etsy_client_id: '',
etsy_refresh_token: '',
store_id: ''
},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cart.create.json?cart_id=&store_url=&etsy_client_id=&etsy_refresh_token=&store_id=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cart.create.json?cart_id=&store_url=&etsy_client_id=&etsy_refresh_token=&store_id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cart.create.json?cart_id=&store_url=&etsy_client_id=&etsy_refresh_token=&store_id=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cart.create.json?cart_id=&store_url=&etsy_client_id=&etsy_refresh_token=&store_id=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/cart.create.json?cart_id=&store_url=&etsy_client_id=&etsy_refresh_token=&store_id=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cart.create.json');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'cart_id' => '',
'store_url' => '',
'etsy_client_id' => '',
'etsy_refresh_token' => '',
'store_id' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cart.create.json');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'cart_id' => '',
'store_url' => '',
'etsy_client_id' => '',
'etsy_refresh_token' => '',
'store_id' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cart.create.json?cart_id=&store_url=&etsy_client_id=&etsy_refresh_token=&store_id=' -Method POST -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cart.create.json?cart_id=&store_url=&etsy_client_id=&etsy_refresh_token=&store_id=' -Method POST -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("POST", "/baseUrl/cart.create.json?cart_id=&store_url=&etsy_client_id=&etsy_refresh_token=&store_id=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cart.create.json"
querystring = {"cart_id":"","store_url":"","etsy_client_id":"","etsy_refresh_token":"","store_id":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.post(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cart.create.json"
queryString <- list(
cart_id = "",
store_url = "",
etsy_client_id = "",
etsy_refresh_token = "",
store_id = ""
)
response <- VERB("POST", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cart.create.json?cart_id=&store_url=&etsy_client_id=&etsy_refresh_token=&store_id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/cart.create.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['cart_id'] = ''
req.params['store_url'] = ''
req.params['etsy_client_id'] = ''
req.params['etsy_refresh_token'] = ''
req.params['store_id'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cart.create.json";
let querystring = [
("cart_id", ""),
("store_url", ""),
("etsy_client_id", ""),
("etsy_refresh_token", ""),
("store_id", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/cart.create.json?cart_id=&store_url=&etsy_client_id=&etsy_refresh_token=&store_id=' \
--header 'x-api-key: {{apiKey}}'
http POST '{{baseUrl}}/cart.create.json?cart_id=&store_url=&etsy_client_id=&etsy_refresh_token=&store_id=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/cart.create.json?cart_id=&store_url=&etsy_client_id=&etsy_refresh_token=&store_id='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cart.create.json?cart_id=&store_url=&etsy_client_id=&etsy_refresh_token=&store_id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
DELETE
CartDelete
{{baseUrl}}/cart.delete.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cart.delete.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/cart.delete.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/cart.delete.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.delete url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/cart.delete.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cart.delete.json");
var request = new RestRequest("", Method.Delete);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cart.delete.json"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/cart.delete.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/cart.delete.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cart.delete.json"))
.header("x-api-key", "{{apiKey}}")
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/cart.delete.json")
.delete(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/cart.delete.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/cart.delete.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/cart.delete.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cart.delete.json';
const options = {method: 'DELETE', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cart.delete.json',
method: 'DELETE',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cart.delete.json")
.delete(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/cart.delete.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/cart.delete.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/cart.delete.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/cart.delete.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cart.delete.json';
const options = {method: 'DELETE', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cart.delete.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cart.delete.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cart.delete.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/cart.delete.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cart.delete.json');
$request->setMethod(HTTP_METH_DELETE);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cart.delete.json');
$request->setRequestMethod('DELETE');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cart.delete.json' -Method DELETE -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cart.delete.json' -Method DELETE -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("DELETE", "/baseUrl/cart.delete.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cart.delete.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.delete(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cart.delete.json"
response <- VERB("DELETE", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cart.delete.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/cart.delete.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cart.delete.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/cart.delete.json \
--header 'x-api-key: {{apiKey}}'
http DELETE {{baseUrl}}/cart.delete.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method DELETE \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/cart.delete.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cart.delete.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
CartDisconnect
{{baseUrl}}/cart.disconnect.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cart.disconnect.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/cart.disconnect.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/cart.disconnect.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/cart.disconnect.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cart.disconnect.json");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cart.disconnect.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/cart.disconnect.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/cart.disconnect.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cart.disconnect.json"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/cart.disconnect.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/cart.disconnect.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/cart.disconnect.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/cart.disconnect.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cart.disconnect.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cart.disconnect.json',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cart.disconnect.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/cart.disconnect.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/cart.disconnect.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/cart.disconnect.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/cart.disconnect.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cart.disconnect.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cart.disconnect.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cart.disconnect.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cart.disconnect.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/cart.disconnect.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cart.disconnect.json');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cart.disconnect.json');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cart.disconnect.json' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cart.disconnect.json' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/cart.disconnect.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cart.disconnect.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cart.disconnect.json"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cart.disconnect.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/cart.disconnect.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cart.disconnect.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/cart.disconnect.json \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/cart.disconnect.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/cart.disconnect.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cart.disconnect.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
CartGiftcardAdd
{{baseUrl}}/cart.giftcard.add.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
amount
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cart.giftcard.add.json?amount=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cart.giftcard.add.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:amount ""}})
require "http/client"
url = "{{baseUrl}}/cart.giftcard.add.json?amount="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.post url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/cart.giftcard.add.json?amount="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cart.giftcard.add.json?amount=");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cart.giftcard.add.json?amount="
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/cart.giftcard.add.json?amount= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cart.giftcard.add.json?amount=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cart.giftcard.add.json?amount="))
.header("x-api-key", "{{apiKey}}")
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/cart.giftcard.add.json?amount=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cart.giftcard.add.json?amount=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cart.giftcard.add.json?amount=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cart.giftcard.add.json',
params: {amount: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cart.giftcard.add.json?amount=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cart.giftcard.add.json?amount=',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cart.giftcard.add.json?amount=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/cart.giftcard.add.json?amount=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cart.giftcard.add.json',
qs: {amount: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/cart.giftcard.add.json');
req.query({
amount: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/cart.giftcard.add.json',
params: {amount: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cart.giftcard.add.json?amount=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cart.giftcard.add.json?amount="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cart.giftcard.add.json?amount=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cart.giftcard.add.json?amount=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/cart.giftcard.add.json?amount=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cart.giftcard.add.json');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'amount' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cart.giftcard.add.json');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'amount' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cart.giftcard.add.json?amount=' -Method POST -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cart.giftcard.add.json?amount=' -Method POST -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("POST", "/baseUrl/cart.giftcard.add.json?amount=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cart.giftcard.add.json"
querystring = {"amount":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.post(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cart.giftcard.add.json"
queryString <- list(amount = "")
response <- VERB("POST", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cart.giftcard.add.json?amount=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/cart.giftcard.add.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['amount'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cart.giftcard.add.json";
let querystring = [
("amount", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/cart.giftcard.add.json?amount=' \
--header 'x-api-key: {{apiKey}}'
http POST '{{baseUrl}}/cart.giftcard.add.json?amount=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/cart.giftcard.add.json?amount='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cart.giftcard.add.json?amount=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
CartGiftcardCount
{{baseUrl}}/cart.giftcard.count.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cart.giftcard.count.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/cart.giftcard.count.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/cart.giftcard.count.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/cart.giftcard.count.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cart.giftcard.count.json");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cart.giftcard.count.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/cart.giftcard.count.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/cart.giftcard.count.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cart.giftcard.count.json"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/cart.giftcard.count.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/cart.giftcard.count.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/cart.giftcard.count.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/cart.giftcard.count.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cart.giftcard.count.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cart.giftcard.count.json',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cart.giftcard.count.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/cart.giftcard.count.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/cart.giftcard.count.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/cart.giftcard.count.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/cart.giftcard.count.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cart.giftcard.count.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cart.giftcard.count.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cart.giftcard.count.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cart.giftcard.count.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/cart.giftcard.count.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cart.giftcard.count.json');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cart.giftcard.count.json');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cart.giftcard.count.json' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cart.giftcard.count.json' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/cart.giftcard.count.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cart.giftcard.count.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cart.giftcard.count.json"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cart.giftcard.count.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/cart.giftcard.count.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cart.giftcard.count.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/cart.giftcard.count.json \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/cart.giftcard.count.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/cart.giftcard.count.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cart.giftcard.count.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
CartGiftcardList
{{baseUrl}}/cart.giftcard.list.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cart.giftcard.list.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/cart.giftcard.list.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/cart.giftcard.list.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/cart.giftcard.list.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cart.giftcard.list.json");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cart.giftcard.list.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/cart.giftcard.list.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/cart.giftcard.list.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cart.giftcard.list.json"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/cart.giftcard.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/cart.giftcard.list.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/cart.giftcard.list.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/cart.giftcard.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cart.giftcard.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cart.giftcard.list.json',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cart.giftcard.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/cart.giftcard.list.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/cart.giftcard.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/cart.giftcard.list.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/cart.giftcard.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cart.giftcard.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cart.giftcard.list.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cart.giftcard.list.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cart.giftcard.list.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/cart.giftcard.list.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cart.giftcard.list.json');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cart.giftcard.list.json');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cart.giftcard.list.json' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cart.giftcard.list.json' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/cart.giftcard.list.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cart.giftcard.list.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cart.giftcard.list.json"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cart.giftcard.list.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/cart.giftcard.list.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cart.giftcard.list.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/cart.giftcard.list.json \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/cart.giftcard.list.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/cart.giftcard.list.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cart.giftcard.list.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
CartInfo
{{baseUrl}}/cart.info.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cart.info.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/cart.info.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/cart.info.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/cart.info.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cart.info.json");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cart.info.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/cart.info.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/cart.info.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cart.info.json"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/cart.info.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/cart.info.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/cart.info.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/cart.info.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cart.info.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cart.info.json',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cart.info.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/cart.info.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/cart.info.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/cart.info.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/cart.info.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cart.info.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cart.info.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cart.info.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cart.info.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/cart.info.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cart.info.json');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cart.info.json');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cart.info.json' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cart.info.json' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/cart.info.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cart.info.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cart.info.json"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cart.info.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/cart.info.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cart.info.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/cart.info.json \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/cart.info.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/cart.info.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cart.info.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
CartList
{{baseUrl}}/cart.list.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cart.list.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/cart.list.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/cart.list.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/cart.list.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cart.list.json");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cart.list.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/cart.list.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/cart.list.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cart.list.json"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/cart.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/cart.list.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/cart.list.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/cart.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cart.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cart.list.json',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cart.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/cart.list.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/cart.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/cart.list.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/cart.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cart.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cart.list.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cart.list.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cart.list.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/cart.list.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cart.list.json');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cart.list.json');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cart.list.json' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cart.list.json' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/cart.list.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cart.list.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cart.list.json"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cart.list.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/cart.list.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cart.list.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/cart.list.json \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/cart.list.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/cart.list.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cart.list.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
CartMetaDataList
{{baseUrl}}/cart.meta_data.list.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
entity_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cart.meta_data.list.json?entity_id=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/cart.meta_data.list.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:entity_id ""}})
require "http/client"
url = "{{baseUrl}}/cart.meta_data.list.json?entity_id="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/cart.meta_data.list.json?entity_id="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cart.meta_data.list.json?entity_id=");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cart.meta_data.list.json?entity_id="
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/cart.meta_data.list.json?entity_id= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/cart.meta_data.list.json?entity_id=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cart.meta_data.list.json?entity_id="))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/cart.meta_data.list.json?entity_id=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/cart.meta_data.list.json?entity_id=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/cart.meta_data.list.json?entity_id=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/cart.meta_data.list.json',
params: {entity_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cart.meta_data.list.json?entity_id=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cart.meta_data.list.json?entity_id=',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cart.meta_data.list.json?entity_id=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/cart.meta_data.list.json?entity_id=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/cart.meta_data.list.json',
qs: {entity_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/cart.meta_data.list.json');
req.query({
entity_id: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/cart.meta_data.list.json',
params: {entity_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cart.meta_data.list.json?entity_id=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cart.meta_data.list.json?entity_id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cart.meta_data.list.json?entity_id=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cart.meta_data.list.json?entity_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 => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/cart.meta_data.list.json?entity_id=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cart.meta_data.list.json');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'entity_id' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cart.meta_data.list.json');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'entity_id' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cart.meta_data.list.json?entity_id=' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cart.meta_data.list.json?entity_id=' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/cart.meta_data.list.json?entity_id=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cart.meta_data.list.json"
querystring = {"entity_id":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cart.meta_data.list.json"
queryString <- list(entity_id = "")
response <- VERB("GET", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cart.meta_data.list.json?entity_id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/cart.meta_data.list.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['entity_id'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cart.meta_data.list.json";
let querystring = [
("entity_id", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/cart.meta_data.list.json?entity_id=' \
--header 'x-api-key: {{apiKey}}'
http GET '{{baseUrl}}/cart.meta_data.list.json?entity_id=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/cart.meta_data.list.json?entity_id='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cart.meta_data.list.json?entity_id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
CartMetaDataSet
{{baseUrl}}/cart.meta_data.set.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
entity_id
key
value
namespace
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cart.meta_data.set.json?entity_id=&key=&value=&namespace=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cart.meta_data.set.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:entity_id ""
:key ""
:value ""
:namespace ""}})
require "http/client"
url = "{{baseUrl}}/cart.meta_data.set.json?entity_id=&key=&value=&namespace="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.post url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/cart.meta_data.set.json?entity_id=&key=&value=&namespace="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cart.meta_data.set.json?entity_id=&key=&value=&namespace=");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cart.meta_data.set.json?entity_id=&key=&value=&namespace="
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/cart.meta_data.set.json?entity_id=&key=&value=&namespace= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cart.meta_data.set.json?entity_id=&key=&value=&namespace=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cart.meta_data.set.json?entity_id=&key=&value=&namespace="))
.header("x-api-key", "{{apiKey}}")
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/cart.meta_data.set.json?entity_id=&key=&value=&namespace=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cart.meta_data.set.json?entity_id=&key=&value=&namespace=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cart.meta_data.set.json?entity_id=&key=&value=&namespace=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cart.meta_data.set.json',
params: {entity_id: '', key: '', value: '', namespace: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cart.meta_data.set.json?entity_id=&key=&value=&namespace=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cart.meta_data.set.json?entity_id=&key=&value=&namespace=',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cart.meta_data.set.json?entity_id=&key=&value=&namespace=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/cart.meta_data.set.json?entity_id=&key=&value=&namespace=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cart.meta_data.set.json',
qs: {entity_id: '', key: '', value: '', namespace: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/cart.meta_data.set.json');
req.query({
entity_id: '',
key: '',
value: '',
namespace: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/cart.meta_data.set.json',
params: {entity_id: '', key: '', value: '', namespace: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cart.meta_data.set.json?entity_id=&key=&value=&namespace=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cart.meta_data.set.json?entity_id=&key=&value=&namespace="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cart.meta_data.set.json?entity_id=&key=&value=&namespace=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cart.meta_data.set.json?entity_id=&key=&value=&namespace=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/cart.meta_data.set.json?entity_id=&key=&value=&namespace=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cart.meta_data.set.json');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'entity_id' => '',
'key' => '',
'value' => '',
'namespace' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cart.meta_data.set.json');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'entity_id' => '',
'key' => '',
'value' => '',
'namespace' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cart.meta_data.set.json?entity_id=&key=&value=&namespace=' -Method POST -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cart.meta_data.set.json?entity_id=&key=&value=&namespace=' -Method POST -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("POST", "/baseUrl/cart.meta_data.set.json?entity_id=&key=&value=&namespace=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cart.meta_data.set.json"
querystring = {"entity_id":"","key":"","value":"","namespace":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.post(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cart.meta_data.set.json"
queryString <- list(
entity_id = "",
value = "",
namespace = ""
)
response <- VERB("POST", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cart.meta_data.set.json?entity_id=&key=&value=&namespace=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/cart.meta_data.set.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['entity_id'] = ''
req.params['key'] = ''
req.params['value'] = ''
req.params['namespace'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cart.meta_data.set.json";
let querystring = [
("entity_id", ""),
("key", ""),
("value", ""),
("namespace", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/cart.meta_data.set.json?entity_id=&key=&value=&namespace=' \
--header 'x-api-key: {{apiKey}}'
http POST '{{baseUrl}}/cart.meta_data.set.json?entity_id=&key=&value=&namespace=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/cart.meta_data.set.json?entity_id=&key=&value=&namespace='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cart.meta_data.set.json?entity_id=&key=&value=&namespace=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
DELETE
CartMetaDataUnset
{{baseUrl}}/cart.meta_data.unset.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
entity_id
key
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cart.meta_data.unset.json?entity_id=&key=&id=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/cart.meta_data.unset.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:entity_id ""
:key ""
:id ""}})
require "http/client"
url = "{{baseUrl}}/cart.meta_data.unset.json?entity_id=&key=&id="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.delete url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/cart.meta_data.unset.json?entity_id=&key=&id="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cart.meta_data.unset.json?entity_id=&key=&id=");
var request = new RestRequest("", Method.Delete);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cart.meta_data.unset.json?entity_id=&key=&id="
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/cart.meta_data.unset.json?entity_id=&key=&id= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/cart.meta_data.unset.json?entity_id=&key=&id=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cart.meta_data.unset.json?entity_id=&key=&id="))
.header("x-api-key", "{{apiKey}}")
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/cart.meta_data.unset.json?entity_id=&key=&id=")
.delete(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/cart.meta_data.unset.json?entity_id=&key=&id=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/cart.meta_data.unset.json?entity_id=&key=&id=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/cart.meta_data.unset.json',
params: {entity_id: '', key: '', id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cart.meta_data.unset.json?entity_id=&key=&id=';
const options = {method: 'DELETE', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cart.meta_data.unset.json?entity_id=&key=&id=',
method: 'DELETE',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cart.meta_data.unset.json?entity_id=&key=&id=")
.delete(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/cart.meta_data.unset.json?entity_id=&key=&id=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/cart.meta_data.unset.json',
qs: {entity_id: '', key: '', id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/cart.meta_data.unset.json');
req.query({
entity_id: '',
key: '',
id: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/cart.meta_data.unset.json',
params: {entity_id: '', key: '', id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cart.meta_data.unset.json?entity_id=&key=&id=';
const options = {method: 'DELETE', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cart.meta_data.unset.json?entity_id=&key=&id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cart.meta_data.unset.json?entity_id=&key=&id=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cart.meta_data.unset.json?entity_id=&key=&id=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/cart.meta_data.unset.json?entity_id=&key=&id=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cart.meta_data.unset.json');
$request->setMethod(HTTP_METH_DELETE);
$request->setQueryData([
'entity_id' => '',
'key' => '',
'id' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cart.meta_data.unset.json');
$request->setRequestMethod('DELETE');
$request->setQuery(new http\QueryString([
'entity_id' => '',
'key' => '',
'id' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cart.meta_data.unset.json?entity_id=&key=&id=' -Method DELETE -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cart.meta_data.unset.json?entity_id=&key=&id=' -Method DELETE -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("DELETE", "/baseUrl/cart.meta_data.unset.json?entity_id=&key=&id=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cart.meta_data.unset.json"
querystring = {"entity_id":"","key":"","id":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.delete(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cart.meta_data.unset.json"
queryString <- list(
entity_id = "",
id = ""
)
response <- VERB("DELETE", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cart.meta_data.unset.json?entity_id=&key=&id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/cart.meta_data.unset.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['entity_id'] = ''
req.params['key'] = ''
req.params['id'] = ''
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cart.meta_data.unset.json";
let querystring = [
("entity_id", ""),
("key", ""),
("id", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url '{{baseUrl}}/cart.meta_data.unset.json?entity_id=&key=&id=' \
--header 'x-api-key: {{apiKey}}'
http DELETE '{{baseUrl}}/cart.meta_data.unset.json?entity_id=&key=&id=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method DELETE \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/cart.meta_data.unset.json?entity_id=&key=&id='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cart.meta_data.unset.json?entity_id=&key=&id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
CartMethods
{{baseUrl}}/cart.methods.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cart.methods.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/cart.methods.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/cart.methods.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/cart.methods.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cart.methods.json");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cart.methods.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/cart.methods.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/cart.methods.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cart.methods.json"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/cart.methods.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/cart.methods.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/cart.methods.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/cart.methods.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cart.methods.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cart.methods.json',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cart.methods.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/cart.methods.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/cart.methods.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/cart.methods.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/cart.methods.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cart.methods.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cart.methods.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cart.methods.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cart.methods.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/cart.methods.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cart.methods.json');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cart.methods.json');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cart.methods.json' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cart.methods.json' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/cart.methods.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cart.methods.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cart.methods.json"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cart.methods.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/cart.methods.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cart.methods.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/cart.methods.json \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/cart.methods.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/cart.methods.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cart.methods.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
CartPluginList
{{baseUrl}}/cart.plugin.list.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cart.plugin.list.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/cart.plugin.list.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/cart.plugin.list.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/cart.plugin.list.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cart.plugin.list.json");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cart.plugin.list.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/cart.plugin.list.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/cart.plugin.list.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cart.plugin.list.json"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/cart.plugin.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/cart.plugin.list.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/cart.plugin.list.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/cart.plugin.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cart.plugin.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cart.plugin.list.json',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cart.plugin.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/cart.plugin.list.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/cart.plugin.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/cart.plugin.list.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/cart.plugin.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cart.plugin.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cart.plugin.list.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cart.plugin.list.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cart.plugin.list.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/cart.plugin.list.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cart.plugin.list.json');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cart.plugin.list.json');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cart.plugin.list.json' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cart.plugin.list.json' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/cart.plugin.list.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cart.plugin.list.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cart.plugin.list.json"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cart.plugin.list.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/cart.plugin.list.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cart.plugin.list.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/cart.plugin.list.json \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/cart.plugin.list.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/cart.plugin.list.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cart.plugin.list.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
CartScriptAdd
{{baseUrl}}/cart.script.add.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cart.script.add.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/cart.script.add.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/cart.script.add.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.post url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/cart.script.add.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cart.script.add.json");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cart.script.add.json"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/cart.script.add.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/cart.script.add.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cart.script.add.json"))
.header("x-api-key", "{{apiKey}}")
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/cart.script.add.json")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/cart.script.add.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/cart.script.add.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/cart.script.add.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cart.script.add.json';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cart.script.add.json',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cart.script.add.json")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/cart.script.add.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/cart.script.add.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/cart.script.add.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/cart.script.add.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cart.script.add.json';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cart.script.add.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cart.script.add.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cart.script.add.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/cart.script.add.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cart.script.add.json');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cart.script.add.json');
$request->setRequestMethod('POST');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cart.script.add.json' -Method POST -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cart.script.add.json' -Method POST -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("POST", "/baseUrl/cart.script.add.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cart.script.add.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.post(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cart.script.add.json"
response <- VERB("POST", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cart.script.add.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/cart.script.add.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cart.script.add.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/cart.script.add.json \
--header 'x-api-key: {{apiKey}}'
http POST {{baseUrl}}/cart.script.add.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/cart.script.add.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cart.script.add.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
DELETE
CartScriptDelete
{{baseUrl}}/cart.script.delete.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cart.script.delete.json?id=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/cart.script.delete.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:id ""}})
require "http/client"
url = "{{baseUrl}}/cart.script.delete.json?id="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.delete url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/cart.script.delete.json?id="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cart.script.delete.json?id=");
var request = new RestRequest("", Method.Delete);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cart.script.delete.json?id="
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/cart.script.delete.json?id= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/cart.script.delete.json?id=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cart.script.delete.json?id="))
.header("x-api-key", "{{apiKey}}")
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/cart.script.delete.json?id=")
.delete(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/cart.script.delete.json?id=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/cart.script.delete.json?id=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/cart.script.delete.json',
params: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cart.script.delete.json?id=';
const options = {method: 'DELETE', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cart.script.delete.json?id=',
method: 'DELETE',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cart.script.delete.json?id=")
.delete(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/cart.script.delete.json?id=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/cart.script.delete.json',
qs: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/cart.script.delete.json');
req.query({
id: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/cart.script.delete.json',
params: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cart.script.delete.json?id=';
const options = {method: 'DELETE', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cart.script.delete.json?id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cart.script.delete.json?id=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cart.script.delete.json?id=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/cart.script.delete.json?id=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cart.script.delete.json');
$request->setMethod(HTTP_METH_DELETE);
$request->setQueryData([
'id' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cart.script.delete.json');
$request->setRequestMethod('DELETE');
$request->setQuery(new http\QueryString([
'id' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cart.script.delete.json?id=' -Method DELETE -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cart.script.delete.json?id=' -Method DELETE -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("DELETE", "/baseUrl/cart.script.delete.json?id=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cart.script.delete.json"
querystring = {"id":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.delete(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cart.script.delete.json"
queryString <- list(id = "")
response <- VERB("DELETE", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cart.script.delete.json?id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/cart.script.delete.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['id'] = ''
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cart.script.delete.json";
let querystring = [
("id", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url '{{baseUrl}}/cart.script.delete.json?id=' \
--header 'x-api-key: {{apiKey}}'
http DELETE '{{baseUrl}}/cart.script.delete.json?id=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method DELETE \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/cart.script.delete.json?id='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cart.script.delete.json?id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
CartScriptList
{{baseUrl}}/cart.script.list.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cart.script.list.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/cart.script.list.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/cart.script.list.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/cart.script.list.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cart.script.list.json");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cart.script.list.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/cart.script.list.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/cart.script.list.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cart.script.list.json"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/cart.script.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/cart.script.list.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/cart.script.list.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/cart.script.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cart.script.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cart.script.list.json',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cart.script.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/cart.script.list.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/cart.script.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/cart.script.list.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/cart.script.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cart.script.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cart.script.list.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cart.script.list.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cart.script.list.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/cart.script.list.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cart.script.list.json');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cart.script.list.json');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cart.script.list.json' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cart.script.list.json' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/cart.script.list.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cart.script.list.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cart.script.list.json"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cart.script.list.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/cart.script.list.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cart.script.list.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/cart.script.list.json \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/cart.script.list.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/cart.script.list.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cart.script.list.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
CartShippingZonesList
{{baseUrl}}/cart.shipping_zones.list.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cart.shipping_zones.list.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/cart.shipping_zones.list.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/cart.shipping_zones.list.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/cart.shipping_zones.list.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cart.shipping_zones.list.json");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cart.shipping_zones.list.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/cart.shipping_zones.list.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/cart.shipping_zones.list.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cart.shipping_zones.list.json"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/cart.shipping_zones.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/cart.shipping_zones.list.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/cart.shipping_zones.list.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/cart.shipping_zones.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cart.shipping_zones.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cart.shipping_zones.list.json',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cart.shipping_zones.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/cart.shipping_zones.list.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/cart.shipping_zones.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/cart.shipping_zones.list.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/cart.shipping_zones.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cart.shipping_zones.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cart.shipping_zones.list.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cart.shipping_zones.list.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cart.shipping_zones.list.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/cart.shipping_zones.list.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cart.shipping_zones.list.json');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cart.shipping_zones.list.json');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cart.shipping_zones.list.json' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cart.shipping_zones.list.json' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/cart.shipping_zones.list.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cart.shipping_zones.list.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cart.shipping_zones.list.json"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cart.shipping_zones.list.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/cart.shipping_zones.list.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cart.shipping_zones.list.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/cart.shipping_zones.list.json \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/cart.shipping_zones.list.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/cart.shipping_zones.list.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cart.shipping_zones.list.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
CartValidate
{{baseUrl}}/cart.validate.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/cart.validate.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/cart.validate.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/cart.validate.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/cart.validate.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/cart.validate.json");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/cart.validate.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/cart.validate.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/cart.validate.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/cart.validate.json"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/cart.validate.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/cart.validate.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/cart.validate.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/cart.validate.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/cart.validate.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/cart.validate.json',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/cart.validate.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/cart.validate.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/cart.validate.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/cart.validate.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/cart.validate.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/cart.validate.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/cart.validate.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/cart.validate.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/cart.validate.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/cart.validate.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/cart.validate.json');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/cart.validate.json');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/cart.validate.json' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/cart.validate.json' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/cart.validate.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/cart.validate.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/cart.validate.json"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/cart.validate.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/cart.validate.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/cart.validate.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/cart.validate.json \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/cart.validate.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/cart.validate.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/cart.validate.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
CategoryAdd
{{baseUrl}}/category.add.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
name
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/category.add.json?name=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/category.add.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:name ""}})
require "http/client"
url = "{{baseUrl}}/category.add.json?name="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.post url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/category.add.json?name="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/category.add.json?name=");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/category.add.json?name="
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/category.add.json?name= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/category.add.json?name=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/category.add.json?name="))
.header("x-api-key", "{{apiKey}}")
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/category.add.json?name=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/category.add.json?name=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/category.add.json?name=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/category.add.json',
params: {name: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/category.add.json?name=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/category.add.json?name=',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/category.add.json?name=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/category.add.json?name=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/category.add.json',
qs: {name: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/category.add.json');
req.query({
name: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/category.add.json',
params: {name: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/category.add.json?name=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/category.add.json?name="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/category.add.json?name=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/category.add.json?name=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/category.add.json?name=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/category.add.json');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'name' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/category.add.json');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'name' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/category.add.json?name=' -Method POST -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/category.add.json?name=' -Method POST -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("POST", "/baseUrl/category.add.json?name=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/category.add.json"
querystring = {"name":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.post(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/category.add.json"
queryString <- list(name = "")
response <- VERB("POST", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/category.add.json?name=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/category.add.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['name'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/category.add.json";
let querystring = [
("name", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/category.add.json?name=' \
--header 'x-api-key: {{apiKey}}'
http POST '{{baseUrl}}/category.add.json?name=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/category.add.json?name='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/category.add.json?name=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
CategoryAssign
{{baseUrl}}/category.assign.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
product_id
category_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/category.assign.json?product_id=&category_id=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/category.assign.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:product_id ""
:category_id ""}})
require "http/client"
url = "{{baseUrl}}/category.assign.json?product_id=&category_id="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.post url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/category.assign.json?product_id=&category_id="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/category.assign.json?product_id=&category_id=");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/category.assign.json?product_id=&category_id="
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/category.assign.json?product_id=&category_id= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/category.assign.json?product_id=&category_id=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/category.assign.json?product_id=&category_id="))
.header("x-api-key", "{{apiKey}}")
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/category.assign.json?product_id=&category_id=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/category.assign.json?product_id=&category_id=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/category.assign.json?product_id=&category_id=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/category.assign.json',
params: {product_id: '', category_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/category.assign.json?product_id=&category_id=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/category.assign.json?product_id=&category_id=',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/category.assign.json?product_id=&category_id=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/category.assign.json?product_id=&category_id=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/category.assign.json',
qs: {product_id: '', category_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/category.assign.json');
req.query({
product_id: '',
category_id: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/category.assign.json',
params: {product_id: '', category_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/category.assign.json?product_id=&category_id=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/category.assign.json?product_id=&category_id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/category.assign.json?product_id=&category_id=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/category.assign.json?product_id=&category_id=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/category.assign.json?product_id=&category_id=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/category.assign.json');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'product_id' => '',
'category_id' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/category.assign.json');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'product_id' => '',
'category_id' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/category.assign.json?product_id=&category_id=' -Method POST -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/category.assign.json?product_id=&category_id=' -Method POST -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("POST", "/baseUrl/category.assign.json?product_id=&category_id=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/category.assign.json"
querystring = {"product_id":"","category_id":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.post(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/category.assign.json"
queryString <- list(
product_id = "",
category_id = ""
)
response <- VERB("POST", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/category.assign.json?product_id=&category_id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/category.assign.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['product_id'] = ''
req.params['category_id'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/category.assign.json";
let querystring = [
("product_id", ""),
("category_id", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/category.assign.json?product_id=&category_id=' \
--header 'x-api-key: {{apiKey}}'
http POST '{{baseUrl}}/category.assign.json?product_id=&category_id=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/category.assign.json?product_id=&category_id='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/category.assign.json?product_id=&category_id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
CategoryCount
{{baseUrl}}/category.count.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/category.count.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/category.count.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/category.count.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/category.count.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/category.count.json");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/category.count.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/category.count.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/category.count.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/category.count.json"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/category.count.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/category.count.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/category.count.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/category.count.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/category.count.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/category.count.json',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/category.count.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/category.count.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/category.count.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/category.count.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/category.count.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/category.count.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/category.count.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/category.count.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/category.count.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/category.count.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/category.count.json');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/category.count.json');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/category.count.json' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/category.count.json' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/category.count.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/category.count.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/category.count.json"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/category.count.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/category.count.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/category.count.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/category.count.json \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/category.count.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/category.count.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/category.count.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
DELETE
CategoryDelete
{{baseUrl}}/category.delete.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/category.delete.json?id=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/category.delete.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:id ""}})
require "http/client"
url = "{{baseUrl}}/category.delete.json?id="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.delete url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/category.delete.json?id="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/category.delete.json?id=");
var request = new RestRequest("", Method.Delete);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/category.delete.json?id="
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/category.delete.json?id= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/category.delete.json?id=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/category.delete.json?id="))
.header("x-api-key", "{{apiKey}}")
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/category.delete.json?id=")
.delete(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/category.delete.json?id=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/category.delete.json?id=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/category.delete.json',
params: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/category.delete.json?id=';
const options = {method: 'DELETE', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/category.delete.json?id=',
method: 'DELETE',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/category.delete.json?id=")
.delete(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/category.delete.json?id=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/category.delete.json',
qs: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/category.delete.json');
req.query({
id: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/category.delete.json',
params: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/category.delete.json?id=';
const options = {method: 'DELETE', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/category.delete.json?id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/category.delete.json?id=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/category.delete.json?id=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/category.delete.json?id=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/category.delete.json');
$request->setMethod(HTTP_METH_DELETE);
$request->setQueryData([
'id' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/category.delete.json');
$request->setRequestMethod('DELETE');
$request->setQuery(new http\QueryString([
'id' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/category.delete.json?id=' -Method DELETE -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/category.delete.json?id=' -Method DELETE -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("DELETE", "/baseUrl/category.delete.json?id=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/category.delete.json"
querystring = {"id":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.delete(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/category.delete.json"
queryString <- list(id = "")
response <- VERB("DELETE", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/category.delete.json?id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/category.delete.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['id'] = ''
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/category.delete.json";
let querystring = [
("id", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url '{{baseUrl}}/category.delete.json?id=' \
--header 'x-api-key: {{apiKey}}'
http DELETE '{{baseUrl}}/category.delete.json?id=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method DELETE \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/category.delete.json?id='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/category.delete.json?id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
CategoryFind
{{baseUrl}}/category.find.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
find_value
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/category.find.json?find_value=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/category.find.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:find_value ""}})
require "http/client"
url = "{{baseUrl}}/category.find.json?find_value="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/category.find.json?find_value="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/category.find.json?find_value=");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/category.find.json?find_value="
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/category.find.json?find_value= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/category.find.json?find_value=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/category.find.json?find_value="))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/category.find.json?find_value=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/category.find.json?find_value=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/category.find.json?find_value=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/category.find.json',
params: {find_value: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/category.find.json?find_value=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/category.find.json?find_value=',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/category.find.json?find_value=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/category.find.json?find_value=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/category.find.json',
qs: {find_value: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/category.find.json');
req.query({
find_value: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/category.find.json',
params: {find_value: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/category.find.json?find_value=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/category.find.json?find_value="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/category.find.json?find_value=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/category.find.json?find_value=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/category.find.json?find_value=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/category.find.json');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'find_value' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/category.find.json');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'find_value' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/category.find.json?find_value=' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/category.find.json?find_value=' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/category.find.json?find_value=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/category.find.json"
querystring = {"find_value":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/category.find.json"
queryString <- list(find_value = "")
response <- VERB("GET", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/category.find.json?find_value=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/category.find.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['find_value'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/category.find.json";
let querystring = [
("find_value", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/category.find.json?find_value=' \
--header 'x-api-key: {{apiKey}}'
http GET '{{baseUrl}}/category.find.json?find_value=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/category.find.json?find_value='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/category.find.json?find_value=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
CategoryImageAdd
{{baseUrl}}/category.image.add.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
category_id
image_name
url
type
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/category.image.add.json?category_id=&image_name=&url=&type=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/category.image.add.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:category_id ""
:image_name ""
:url ""
:type ""}})
require "http/client"
url = "{{baseUrl}}/category.image.add.json?category_id=&image_name=&url=&type="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.post url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/category.image.add.json?category_id=&image_name=&url=&type="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/category.image.add.json?category_id=&image_name=&url=&type=");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/category.image.add.json?category_id=&image_name=&url=&type="
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/category.image.add.json?category_id=&image_name=&url=&type= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/category.image.add.json?category_id=&image_name=&url=&type=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/category.image.add.json?category_id=&image_name=&url=&type="))
.header("x-api-key", "{{apiKey}}")
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/category.image.add.json?category_id=&image_name=&url=&type=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/category.image.add.json?category_id=&image_name=&url=&type=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/category.image.add.json?category_id=&image_name=&url=&type=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/category.image.add.json',
params: {category_id: '', image_name: '', url: '', type: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/category.image.add.json?category_id=&image_name=&url=&type=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/category.image.add.json?category_id=&image_name=&url=&type=',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/category.image.add.json?category_id=&image_name=&url=&type=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/category.image.add.json?category_id=&image_name=&url=&type=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/category.image.add.json',
qs: {category_id: '', image_name: '', url: '', type: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/category.image.add.json');
req.query({
category_id: '',
image_name: '',
url: '',
type: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/category.image.add.json',
params: {category_id: '', image_name: '', url: '', type: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/category.image.add.json?category_id=&image_name=&url=&type=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/category.image.add.json?category_id=&image_name=&url=&type="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/category.image.add.json?category_id=&image_name=&url=&type=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/category.image.add.json?category_id=&image_name=&url=&type=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/category.image.add.json?category_id=&image_name=&url=&type=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/category.image.add.json');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'category_id' => '',
'image_name' => '',
'url' => '',
'type' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/category.image.add.json');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'category_id' => '',
'image_name' => '',
'url' => '',
'type' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/category.image.add.json?category_id=&image_name=&url=&type=' -Method POST -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/category.image.add.json?category_id=&image_name=&url=&type=' -Method POST -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("POST", "/baseUrl/category.image.add.json?category_id=&image_name=&url=&type=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/category.image.add.json"
querystring = {"category_id":"","image_name":"","url":"","type":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.post(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/category.image.add.json"
queryString <- list(
category_id = "",
image_name = "",
url = "",
type = ""
)
response <- VERB("POST", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/category.image.add.json?category_id=&image_name=&url=&type=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/category.image.add.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['category_id'] = ''
req.params['image_name'] = ''
req.params['url'] = ''
req.params['type'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/category.image.add.json";
let querystring = [
("category_id", ""),
("image_name", ""),
("url", ""),
("type", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/category.image.add.json?category_id=&image_name=&url=&type=' \
--header 'x-api-key: {{apiKey}}'
http POST '{{baseUrl}}/category.image.add.json?category_id=&image_name=&url=&type=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/category.image.add.json?category_id=&image_name=&url=&type='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/category.image.add.json?category_id=&image_name=&url=&type=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
DELETE
CategoryImageDelete
{{baseUrl}}/category.image.delete.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
category_id
image_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/category.image.delete.json?category_id=&image_id=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/category.image.delete.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:category_id ""
:image_id ""}})
require "http/client"
url = "{{baseUrl}}/category.image.delete.json?category_id=&image_id="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.delete url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/category.image.delete.json?category_id=&image_id="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/category.image.delete.json?category_id=&image_id=");
var request = new RestRequest("", Method.Delete);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/category.image.delete.json?category_id=&image_id="
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/category.image.delete.json?category_id=&image_id= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/category.image.delete.json?category_id=&image_id=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/category.image.delete.json?category_id=&image_id="))
.header("x-api-key", "{{apiKey}}")
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/category.image.delete.json?category_id=&image_id=")
.delete(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/category.image.delete.json?category_id=&image_id=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/category.image.delete.json?category_id=&image_id=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/category.image.delete.json',
params: {category_id: '', image_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/category.image.delete.json?category_id=&image_id=';
const options = {method: 'DELETE', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/category.image.delete.json?category_id=&image_id=',
method: 'DELETE',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/category.image.delete.json?category_id=&image_id=")
.delete(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/category.image.delete.json?category_id=&image_id=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/category.image.delete.json',
qs: {category_id: '', image_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/category.image.delete.json');
req.query({
category_id: '',
image_id: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/category.image.delete.json',
params: {category_id: '', image_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/category.image.delete.json?category_id=&image_id=';
const options = {method: 'DELETE', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/category.image.delete.json?category_id=&image_id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/category.image.delete.json?category_id=&image_id=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/category.image.delete.json?category_id=&image_id=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/category.image.delete.json?category_id=&image_id=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/category.image.delete.json');
$request->setMethod(HTTP_METH_DELETE);
$request->setQueryData([
'category_id' => '',
'image_id' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/category.image.delete.json');
$request->setRequestMethod('DELETE');
$request->setQuery(new http\QueryString([
'category_id' => '',
'image_id' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/category.image.delete.json?category_id=&image_id=' -Method DELETE -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/category.image.delete.json?category_id=&image_id=' -Method DELETE -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("DELETE", "/baseUrl/category.image.delete.json?category_id=&image_id=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/category.image.delete.json"
querystring = {"category_id":"","image_id":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.delete(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/category.image.delete.json"
queryString <- list(
category_id = "",
image_id = ""
)
response <- VERB("DELETE", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/category.image.delete.json?category_id=&image_id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/category.image.delete.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['category_id'] = ''
req.params['image_id'] = ''
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/category.image.delete.json";
let querystring = [
("category_id", ""),
("image_id", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url '{{baseUrl}}/category.image.delete.json?category_id=&image_id=' \
--header 'x-api-key: {{apiKey}}'
http DELETE '{{baseUrl}}/category.image.delete.json?category_id=&image_id=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method DELETE \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/category.image.delete.json?category_id=&image_id='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/category.image.delete.json?category_id=&image_id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
CategoryInfo
{{baseUrl}}/category.info.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/category.info.json?id=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/category.info.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:id ""}})
require "http/client"
url = "{{baseUrl}}/category.info.json?id="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/category.info.json?id="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/category.info.json?id=");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/category.info.json?id="
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/category.info.json?id= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/category.info.json?id=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/category.info.json?id="))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/category.info.json?id=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/category.info.json?id=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/category.info.json?id=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/category.info.json',
params: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/category.info.json?id=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/category.info.json?id=',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/category.info.json?id=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/category.info.json?id=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/category.info.json',
qs: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/category.info.json');
req.query({
id: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/category.info.json',
params: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/category.info.json?id=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/category.info.json?id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/category.info.json?id=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/category.info.json?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 => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/category.info.json?id=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/category.info.json');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'id' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/category.info.json');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'id' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/category.info.json?id=' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/category.info.json?id=' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/category.info.json?id=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/category.info.json"
querystring = {"id":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/category.info.json"
queryString <- list(id = "")
response <- VERB("GET", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/category.info.json?id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/category.info.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['id'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/category.info.json";
let querystring = [
("id", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/category.info.json?id=' \
--header 'x-api-key: {{apiKey}}'
http GET '{{baseUrl}}/category.info.json?id=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/category.info.json?id='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/category.info.json?id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
CategoryList
{{baseUrl}}/category.list.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/category.list.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/category.list.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/category.list.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/category.list.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/category.list.json");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/category.list.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/category.list.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/category.list.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/category.list.json"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/category.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/category.list.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/category.list.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/category.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/category.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/category.list.json',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/category.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/category.list.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/category.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/category.list.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/category.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/category.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/category.list.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/category.list.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/category.list.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/category.list.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/category.list.json');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/category.list.json');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/category.list.json' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/category.list.json' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/category.list.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/category.list.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/category.list.json"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/category.list.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/category.list.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/category.list.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/category.list.json \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/category.list.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/category.list.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/category.list.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
CategoryUnassign
{{baseUrl}}/category.unassign.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
category_id
product_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/category.unassign.json?category_id=&product_id=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/category.unassign.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:category_id ""
:product_id ""}})
require "http/client"
url = "{{baseUrl}}/category.unassign.json?category_id=&product_id="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.post url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/category.unassign.json?category_id=&product_id="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/category.unassign.json?category_id=&product_id=");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/category.unassign.json?category_id=&product_id="
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/category.unassign.json?category_id=&product_id= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/category.unassign.json?category_id=&product_id=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/category.unassign.json?category_id=&product_id="))
.header("x-api-key", "{{apiKey}}")
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/category.unassign.json?category_id=&product_id=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/category.unassign.json?category_id=&product_id=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/category.unassign.json?category_id=&product_id=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/category.unassign.json',
params: {category_id: '', product_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/category.unassign.json?category_id=&product_id=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/category.unassign.json?category_id=&product_id=',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/category.unassign.json?category_id=&product_id=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/category.unassign.json?category_id=&product_id=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/category.unassign.json',
qs: {category_id: '', product_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/category.unassign.json');
req.query({
category_id: '',
product_id: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/category.unassign.json',
params: {category_id: '', product_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/category.unassign.json?category_id=&product_id=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/category.unassign.json?category_id=&product_id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/category.unassign.json?category_id=&product_id=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/category.unassign.json?category_id=&product_id=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/category.unassign.json?category_id=&product_id=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/category.unassign.json');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'category_id' => '',
'product_id' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/category.unassign.json');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'category_id' => '',
'product_id' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/category.unassign.json?category_id=&product_id=' -Method POST -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/category.unassign.json?category_id=&product_id=' -Method POST -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("POST", "/baseUrl/category.unassign.json?category_id=&product_id=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/category.unassign.json"
querystring = {"category_id":"","product_id":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.post(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/category.unassign.json"
queryString <- list(
category_id = "",
product_id = ""
)
response <- VERB("POST", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/category.unassign.json?category_id=&product_id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/category.unassign.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['category_id'] = ''
req.params['product_id'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/category.unassign.json";
let querystring = [
("category_id", ""),
("product_id", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/category.unassign.json?category_id=&product_id=' \
--header 'x-api-key: {{apiKey}}'
http POST '{{baseUrl}}/category.unassign.json?category_id=&product_id=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/category.unassign.json?category_id=&product_id='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/category.unassign.json?category_id=&product_id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PUT
CategoryUpdate
{{baseUrl}}/category.update.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/category.update.json?id=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/category.update.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:id ""}})
require "http/client"
url = "{{baseUrl}}/category.update.json?id="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.put url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/category.update.json?id="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/category.update.json?id=");
var request = new RestRequest("", Method.Put);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/category.update.json?id="
req, _ := http.NewRequest("PUT", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/category.update.json?id= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/category.update.json?id=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/category.update.json?id="))
.header("x-api-key", "{{apiKey}}")
.method("PUT", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/category.update.json?id=")
.put(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/category.update.json?id=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/category.update.json?id=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/category.update.json',
params: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/category.update.json?id=';
const options = {method: 'PUT', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/category.update.json?id=',
method: 'PUT',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/category.update.json?id=")
.put(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/category.update.json?id=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/category.update.json',
qs: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/category.update.json');
req.query({
id: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/category.update.json',
params: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/category.update.json?id=';
const options = {method: 'PUT', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/category.update.json?id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/category.update.json?id=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/category.update.json?id=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/category.update.json?id=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/category.update.json');
$request->setMethod(HTTP_METH_PUT);
$request->setQueryData([
'id' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/category.update.json');
$request->setRequestMethod('PUT');
$request->setQuery(new http\QueryString([
'id' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/category.update.json?id=' -Method PUT -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/category.update.json?id=' -Method PUT -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("PUT", "/baseUrl/category.update.json?id=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/category.update.json"
querystring = {"id":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.put(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/category.update.json"
queryString <- list(id = "")
response <- VERB("PUT", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/category.update.json?id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.put('/baseUrl/category.update.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['id'] = ''
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/category.update.json";
let querystring = [
("id", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url '{{baseUrl}}/category.update.json?id=' \
--header 'x-api-key: {{apiKey}}'
http PUT '{{baseUrl}}/category.update.json?id=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method PUT \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/category.update.json?id='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/category.update.json?id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
CustomerAdd
{{baseUrl}}/customer.add.json
HEADERS
x-api-key
{{apiKey}}
BODY json
{
"address": [
{
"address_book_address1": "",
"address_book_address2": "",
"address_book_city": "",
"address_book_company": "",
"address_book_country": "",
"address_book_default": false,
"address_book_fax": "",
"address_book_first_name": "",
"address_book_gender": "",
"address_book_last_name": "",
"address_book_phone": "",
"address_book_postcode": "",
"address_book_region": "",
"address_book_state": "",
"address_book_type": "",
"address_book_website": ""
}
],
"birth_day": "",
"company": "",
"created_time": "",
"email": "",
"fax": "",
"first_name": "",
"gender": "",
"group": "",
"last_login": "",
"last_name": "",
"login": "",
"modified_time": "",
"news_letter_subscription": false,
"password": "",
"phone": "",
"status": "",
"store_id": "",
"website": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/customer.add.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"address\": [\n {\n \"address_book_address1\": \"\",\n \"address_book_address2\": \"\",\n \"address_book_city\": \"\",\n \"address_book_company\": \"\",\n \"address_book_country\": \"\",\n \"address_book_default\": false,\n \"address_book_fax\": \"\",\n \"address_book_first_name\": \"\",\n \"address_book_gender\": \"\",\n \"address_book_last_name\": \"\",\n \"address_book_phone\": \"\",\n \"address_book_postcode\": \"\",\n \"address_book_region\": \"\",\n \"address_book_state\": \"\",\n \"address_book_type\": \"\",\n \"address_book_website\": \"\"\n }\n ],\n \"birth_day\": \"\",\n \"company\": \"\",\n \"created_time\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"first_name\": \"\",\n \"gender\": \"\",\n \"group\": \"\",\n \"last_login\": \"\",\n \"last_name\": \"\",\n \"login\": \"\",\n \"modified_time\": \"\",\n \"news_letter_subscription\": false,\n \"password\": \"\",\n \"phone\": \"\",\n \"status\": \"\",\n \"store_id\": \"\",\n \"website\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/customer.add.json" {:headers {:x-api-key "{{apiKey}}"}
:content-type :json
:form-params {:address [{:address_book_address1 ""
:address_book_address2 ""
:address_book_city ""
:address_book_company ""
:address_book_country ""
:address_book_default false
:address_book_fax ""
:address_book_first_name ""
:address_book_gender ""
:address_book_last_name ""
:address_book_phone ""
:address_book_postcode ""
:address_book_region ""
:address_book_state ""
:address_book_type ""
:address_book_website ""}]
:birth_day ""
:company ""
:created_time ""
:email ""
:fax ""
:first_name ""
:gender ""
:group ""
:last_login ""
:last_name ""
:login ""
:modified_time ""
:news_letter_subscription false
:password ""
:phone ""
:status ""
:store_id ""
:website ""}})
require "http/client"
url = "{{baseUrl}}/customer.add.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"address\": [\n {\n \"address_book_address1\": \"\",\n \"address_book_address2\": \"\",\n \"address_book_city\": \"\",\n \"address_book_company\": \"\",\n \"address_book_country\": \"\",\n \"address_book_default\": false,\n \"address_book_fax\": \"\",\n \"address_book_first_name\": \"\",\n \"address_book_gender\": \"\",\n \"address_book_last_name\": \"\",\n \"address_book_phone\": \"\",\n \"address_book_postcode\": \"\",\n \"address_book_region\": \"\",\n \"address_book_state\": \"\",\n \"address_book_type\": \"\",\n \"address_book_website\": \"\"\n }\n ],\n \"birth_day\": \"\",\n \"company\": \"\",\n \"created_time\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"first_name\": \"\",\n \"gender\": \"\",\n \"group\": \"\",\n \"last_login\": \"\",\n \"last_name\": \"\",\n \"login\": \"\",\n \"modified_time\": \"\",\n \"news_letter_subscription\": false,\n \"password\": \"\",\n \"phone\": \"\",\n \"status\": \"\",\n \"store_id\": \"\",\n \"website\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/customer.add.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
Content = new StringContent("{\n \"address\": [\n {\n \"address_book_address1\": \"\",\n \"address_book_address2\": \"\",\n \"address_book_city\": \"\",\n \"address_book_company\": \"\",\n \"address_book_country\": \"\",\n \"address_book_default\": false,\n \"address_book_fax\": \"\",\n \"address_book_first_name\": \"\",\n \"address_book_gender\": \"\",\n \"address_book_last_name\": \"\",\n \"address_book_phone\": \"\",\n \"address_book_postcode\": \"\",\n \"address_book_region\": \"\",\n \"address_book_state\": \"\",\n \"address_book_type\": \"\",\n \"address_book_website\": \"\"\n }\n ],\n \"birth_day\": \"\",\n \"company\": \"\",\n \"created_time\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"first_name\": \"\",\n \"gender\": \"\",\n \"group\": \"\",\n \"last_login\": \"\",\n \"last_name\": \"\",\n \"login\": \"\",\n \"modified_time\": \"\",\n \"news_letter_subscription\": false,\n \"password\": \"\",\n \"phone\": \"\",\n \"status\": \"\",\n \"store_id\": \"\",\n \"website\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/customer.add.json");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"address\": [\n {\n \"address_book_address1\": \"\",\n \"address_book_address2\": \"\",\n \"address_book_city\": \"\",\n \"address_book_company\": \"\",\n \"address_book_country\": \"\",\n \"address_book_default\": false,\n \"address_book_fax\": \"\",\n \"address_book_first_name\": \"\",\n \"address_book_gender\": \"\",\n \"address_book_last_name\": \"\",\n \"address_book_phone\": \"\",\n \"address_book_postcode\": \"\",\n \"address_book_region\": \"\",\n \"address_book_state\": \"\",\n \"address_book_type\": \"\",\n \"address_book_website\": \"\"\n }\n ],\n \"birth_day\": \"\",\n \"company\": \"\",\n \"created_time\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"first_name\": \"\",\n \"gender\": \"\",\n \"group\": \"\",\n \"last_login\": \"\",\n \"last_name\": \"\",\n \"login\": \"\",\n \"modified_time\": \"\",\n \"news_letter_subscription\": false,\n \"password\": \"\",\n \"phone\": \"\",\n \"status\": \"\",\n \"store_id\": \"\",\n \"website\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/customer.add.json"
payload := strings.NewReader("{\n \"address\": [\n {\n \"address_book_address1\": \"\",\n \"address_book_address2\": \"\",\n \"address_book_city\": \"\",\n \"address_book_company\": \"\",\n \"address_book_country\": \"\",\n \"address_book_default\": false,\n \"address_book_fax\": \"\",\n \"address_book_first_name\": \"\",\n \"address_book_gender\": \"\",\n \"address_book_last_name\": \"\",\n \"address_book_phone\": \"\",\n \"address_book_postcode\": \"\",\n \"address_book_region\": \"\",\n \"address_book_state\": \"\",\n \"address_book_type\": \"\",\n \"address_book_website\": \"\"\n }\n ],\n \"birth_day\": \"\",\n \"company\": \"\",\n \"created_time\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"first_name\": \"\",\n \"gender\": \"\",\n \"group\": \"\",\n \"last_login\": \"\",\n \"last_name\": \"\",\n \"login\": \"\",\n \"modified_time\": \"\",\n \"news_letter_subscription\": false,\n \"password\": \"\",\n \"phone\": \"\",\n \"status\": \"\",\n \"store_id\": \"\",\n \"website\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/customer.add.json HTTP/1.1
X-Api-Key: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 907
{
"address": [
{
"address_book_address1": "",
"address_book_address2": "",
"address_book_city": "",
"address_book_company": "",
"address_book_country": "",
"address_book_default": false,
"address_book_fax": "",
"address_book_first_name": "",
"address_book_gender": "",
"address_book_last_name": "",
"address_book_phone": "",
"address_book_postcode": "",
"address_book_region": "",
"address_book_state": "",
"address_book_type": "",
"address_book_website": ""
}
],
"birth_day": "",
"company": "",
"created_time": "",
"email": "",
"fax": "",
"first_name": "",
"gender": "",
"group": "",
"last_login": "",
"last_name": "",
"login": "",
"modified_time": "",
"news_letter_subscription": false,
"password": "",
"phone": "",
"status": "",
"store_id": "",
"website": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/customer.add.json")
.setHeader("x-api-key", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"address\": [\n {\n \"address_book_address1\": \"\",\n \"address_book_address2\": \"\",\n \"address_book_city\": \"\",\n \"address_book_company\": \"\",\n \"address_book_country\": \"\",\n \"address_book_default\": false,\n \"address_book_fax\": \"\",\n \"address_book_first_name\": \"\",\n \"address_book_gender\": \"\",\n \"address_book_last_name\": \"\",\n \"address_book_phone\": \"\",\n \"address_book_postcode\": \"\",\n \"address_book_region\": \"\",\n \"address_book_state\": \"\",\n \"address_book_type\": \"\",\n \"address_book_website\": \"\"\n }\n ],\n \"birth_day\": \"\",\n \"company\": \"\",\n \"created_time\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"first_name\": \"\",\n \"gender\": \"\",\n \"group\": \"\",\n \"last_login\": \"\",\n \"last_name\": \"\",\n \"login\": \"\",\n \"modified_time\": \"\",\n \"news_letter_subscription\": false,\n \"password\": \"\",\n \"phone\": \"\",\n \"status\": \"\",\n \"store_id\": \"\",\n \"website\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/customer.add.json"))
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"address\": [\n {\n \"address_book_address1\": \"\",\n \"address_book_address2\": \"\",\n \"address_book_city\": \"\",\n \"address_book_company\": \"\",\n \"address_book_country\": \"\",\n \"address_book_default\": false,\n \"address_book_fax\": \"\",\n \"address_book_first_name\": \"\",\n \"address_book_gender\": \"\",\n \"address_book_last_name\": \"\",\n \"address_book_phone\": \"\",\n \"address_book_postcode\": \"\",\n \"address_book_region\": \"\",\n \"address_book_state\": \"\",\n \"address_book_type\": \"\",\n \"address_book_website\": \"\"\n }\n ],\n \"birth_day\": \"\",\n \"company\": \"\",\n \"created_time\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"first_name\": \"\",\n \"gender\": \"\",\n \"group\": \"\",\n \"last_login\": \"\",\n \"last_name\": \"\",\n \"login\": \"\",\n \"modified_time\": \"\",\n \"news_letter_subscription\": false,\n \"password\": \"\",\n \"phone\": \"\",\n \"status\": \"\",\n \"store_id\": \"\",\n \"website\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"address\": [\n {\n \"address_book_address1\": \"\",\n \"address_book_address2\": \"\",\n \"address_book_city\": \"\",\n \"address_book_company\": \"\",\n \"address_book_country\": \"\",\n \"address_book_default\": false,\n \"address_book_fax\": \"\",\n \"address_book_first_name\": \"\",\n \"address_book_gender\": \"\",\n \"address_book_last_name\": \"\",\n \"address_book_phone\": \"\",\n \"address_book_postcode\": \"\",\n \"address_book_region\": \"\",\n \"address_book_state\": \"\",\n \"address_book_type\": \"\",\n \"address_book_website\": \"\"\n }\n ],\n \"birth_day\": \"\",\n \"company\": \"\",\n \"created_time\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"first_name\": \"\",\n \"gender\": \"\",\n \"group\": \"\",\n \"last_login\": \"\",\n \"last_name\": \"\",\n \"login\": \"\",\n \"modified_time\": \"\",\n \"news_letter_subscription\": false,\n \"password\": \"\",\n \"phone\": \"\",\n \"status\": \"\",\n \"store_id\": \"\",\n \"website\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/customer.add.json")
.post(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/customer.add.json")
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"address\": [\n {\n \"address_book_address1\": \"\",\n \"address_book_address2\": \"\",\n \"address_book_city\": \"\",\n \"address_book_company\": \"\",\n \"address_book_country\": \"\",\n \"address_book_default\": false,\n \"address_book_fax\": \"\",\n \"address_book_first_name\": \"\",\n \"address_book_gender\": \"\",\n \"address_book_last_name\": \"\",\n \"address_book_phone\": \"\",\n \"address_book_postcode\": \"\",\n \"address_book_region\": \"\",\n \"address_book_state\": \"\",\n \"address_book_type\": \"\",\n \"address_book_website\": \"\"\n }\n ],\n \"birth_day\": \"\",\n \"company\": \"\",\n \"created_time\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"first_name\": \"\",\n \"gender\": \"\",\n \"group\": \"\",\n \"last_login\": \"\",\n \"last_name\": \"\",\n \"login\": \"\",\n \"modified_time\": \"\",\n \"news_letter_subscription\": false,\n \"password\": \"\",\n \"phone\": \"\",\n \"status\": \"\",\n \"store_id\": \"\",\n \"website\": \"\"\n}")
.asString();
const data = JSON.stringify({
address: [
{
address_book_address1: '',
address_book_address2: '',
address_book_city: '',
address_book_company: '',
address_book_country: '',
address_book_default: false,
address_book_fax: '',
address_book_first_name: '',
address_book_gender: '',
address_book_last_name: '',
address_book_phone: '',
address_book_postcode: '',
address_book_region: '',
address_book_state: '',
address_book_type: '',
address_book_website: ''
}
],
birth_day: '',
company: '',
created_time: '',
email: '',
fax: '',
first_name: '',
gender: '',
group: '',
last_login: '',
last_name: '',
login: '',
modified_time: '',
news_letter_subscription: false,
password: '',
phone: '',
status: '',
store_id: '',
website: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/customer.add.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/customer.add.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {
address: [
{
address_book_address1: '',
address_book_address2: '',
address_book_city: '',
address_book_company: '',
address_book_country: '',
address_book_default: false,
address_book_fax: '',
address_book_first_name: '',
address_book_gender: '',
address_book_last_name: '',
address_book_phone: '',
address_book_postcode: '',
address_book_region: '',
address_book_state: '',
address_book_type: '',
address_book_website: ''
}
],
birth_day: '',
company: '',
created_time: '',
email: '',
fax: '',
first_name: '',
gender: '',
group: '',
last_login: '',
last_name: '',
login: '',
modified_time: '',
news_letter_subscription: false,
password: '',
phone: '',
status: '',
store_id: '',
website: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/customer.add.json';
const options = {
method: 'POST',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"address":[{"address_book_address1":"","address_book_address2":"","address_book_city":"","address_book_company":"","address_book_country":"","address_book_default":false,"address_book_fax":"","address_book_first_name":"","address_book_gender":"","address_book_last_name":"","address_book_phone":"","address_book_postcode":"","address_book_region":"","address_book_state":"","address_book_type":"","address_book_website":""}],"birth_day":"","company":"","created_time":"","email":"","fax":"","first_name":"","gender":"","group":"","last_login":"","last_name":"","login":"","modified_time":"","news_letter_subscription":false,"password":"","phone":"","status":"","store_id":"","website":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/customer.add.json',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "address": [\n {\n "address_book_address1": "",\n "address_book_address2": "",\n "address_book_city": "",\n "address_book_company": "",\n "address_book_country": "",\n "address_book_default": false,\n "address_book_fax": "",\n "address_book_first_name": "",\n "address_book_gender": "",\n "address_book_last_name": "",\n "address_book_phone": "",\n "address_book_postcode": "",\n "address_book_region": "",\n "address_book_state": "",\n "address_book_type": "",\n "address_book_website": ""\n }\n ],\n "birth_day": "",\n "company": "",\n "created_time": "",\n "email": "",\n "fax": "",\n "first_name": "",\n "gender": "",\n "group": "",\n "last_login": "",\n "last_name": "",\n "login": "",\n "modified_time": "",\n "news_letter_subscription": false,\n "password": "",\n "phone": "",\n "status": "",\n "store_id": "",\n "website": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"address\": [\n {\n \"address_book_address1\": \"\",\n \"address_book_address2\": \"\",\n \"address_book_city\": \"\",\n \"address_book_company\": \"\",\n \"address_book_country\": \"\",\n \"address_book_default\": false,\n \"address_book_fax\": \"\",\n \"address_book_first_name\": \"\",\n \"address_book_gender\": \"\",\n \"address_book_last_name\": \"\",\n \"address_book_phone\": \"\",\n \"address_book_postcode\": \"\",\n \"address_book_region\": \"\",\n \"address_book_state\": \"\",\n \"address_book_type\": \"\",\n \"address_book_website\": \"\"\n }\n ],\n \"birth_day\": \"\",\n \"company\": \"\",\n \"created_time\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"first_name\": \"\",\n \"gender\": \"\",\n \"group\": \"\",\n \"last_login\": \"\",\n \"last_name\": \"\",\n \"login\": \"\",\n \"modified_time\": \"\",\n \"news_letter_subscription\": false,\n \"password\": \"\",\n \"phone\": \"\",\n \"status\": \"\",\n \"store_id\": \"\",\n \"website\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/customer.add.json")
.post(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/customer.add.json',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
address: [
{
address_book_address1: '',
address_book_address2: '',
address_book_city: '',
address_book_company: '',
address_book_country: '',
address_book_default: false,
address_book_fax: '',
address_book_first_name: '',
address_book_gender: '',
address_book_last_name: '',
address_book_phone: '',
address_book_postcode: '',
address_book_region: '',
address_book_state: '',
address_book_type: '',
address_book_website: ''
}
],
birth_day: '',
company: '',
created_time: '',
email: '',
fax: '',
first_name: '',
gender: '',
group: '',
last_login: '',
last_name: '',
login: '',
modified_time: '',
news_letter_subscription: false,
password: '',
phone: '',
status: '',
store_id: '',
website: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/customer.add.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: {
address: [
{
address_book_address1: '',
address_book_address2: '',
address_book_city: '',
address_book_company: '',
address_book_country: '',
address_book_default: false,
address_book_fax: '',
address_book_first_name: '',
address_book_gender: '',
address_book_last_name: '',
address_book_phone: '',
address_book_postcode: '',
address_book_region: '',
address_book_state: '',
address_book_type: '',
address_book_website: ''
}
],
birth_day: '',
company: '',
created_time: '',
email: '',
fax: '',
first_name: '',
gender: '',
group: '',
last_login: '',
last_name: '',
login: '',
modified_time: '',
news_letter_subscription: false,
password: '',
phone: '',
status: '',
store_id: '',
website: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/customer.add.json');
req.headers({
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
address: [
{
address_book_address1: '',
address_book_address2: '',
address_book_city: '',
address_book_company: '',
address_book_country: '',
address_book_default: false,
address_book_fax: '',
address_book_first_name: '',
address_book_gender: '',
address_book_last_name: '',
address_book_phone: '',
address_book_postcode: '',
address_book_region: '',
address_book_state: '',
address_book_type: '',
address_book_website: ''
}
],
birth_day: '',
company: '',
created_time: '',
email: '',
fax: '',
first_name: '',
gender: '',
group: '',
last_login: '',
last_name: '',
login: '',
modified_time: '',
news_letter_subscription: false,
password: '',
phone: '',
status: '',
store_id: '',
website: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/customer.add.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {
address: [
{
address_book_address1: '',
address_book_address2: '',
address_book_city: '',
address_book_company: '',
address_book_country: '',
address_book_default: false,
address_book_fax: '',
address_book_first_name: '',
address_book_gender: '',
address_book_last_name: '',
address_book_phone: '',
address_book_postcode: '',
address_book_region: '',
address_book_state: '',
address_book_type: '',
address_book_website: ''
}
],
birth_day: '',
company: '',
created_time: '',
email: '',
fax: '',
first_name: '',
gender: '',
group: '',
last_login: '',
last_name: '',
login: '',
modified_time: '',
news_letter_subscription: false,
password: '',
phone: '',
status: '',
store_id: '',
website: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/customer.add.json';
const options = {
method: 'POST',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"address":[{"address_book_address1":"","address_book_address2":"","address_book_city":"","address_book_company":"","address_book_country":"","address_book_default":false,"address_book_fax":"","address_book_first_name":"","address_book_gender":"","address_book_last_name":"","address_book_phone":"","address_book_postcode":"","address_book_region":"","address_book_state":"","address_book_type":"","address_book_website":""}],"birth_day":"","company":"","created_time":"","email":"","fax":"","first_name":"","gender":"","group":"","last_login":"","last_name":"","login":"","modified_time":"","news_letter_subscription":false,"password":"","phone":"","status":"","store_id":"","website":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"address": @[ @{ @"address_book_address1": @"", @"address_book_address2": @"", @"address_book_city": @"", @"address_book_company": @"", @"address_book_country": @"", @"address_book_default": @NO, @"address_book_fax": @"", @"address_book_first_name": @"", @"address_book_gender": @"", @"address_book_last_name": @"", @"address_book_phone": @"", @"address_book_postcode": @"", @"address_book_region": @"", @"address_book_state": @"", @"address_book_type": @"", @"address_book_website": @"" } ],
@"birth_day": @"",
@"company": @"",
@"created_time": @"",
@"email": @"",
@"fax": @"",
@"first_name": @"",
@"gender": @"",
@"group": @"",
@"last_login": @"",
@"last_name": @"",
@"login": @"",
@"modified_time": @"",
@"news_letter_subscription": @NO,
@"password": @"",
@"phone": @"",
@"status": @"",
@"store_id": @"",
@"website": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/customer.add.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/customer.add.json" in
let headers = Header.add_list (Header.init ()) [
("x-api-key", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"address\": [\n {\n \"address_book_address1\": \"\",\n \"address_book_address2\": \"\",\n \"address_book_city\": \"\",\n \"address_book_company\": \"\",\n \"address_book_country\": \"\",\n \"address_book_default\": false,\n \"address_book_fax\": \"\",\n \"address_book_first_name\": \"\",\n \"address_book_gender\": \"\",\n \"address_book_last_name\": \"\",\n \"address_book_phone\": \"\",\n \"address_book_postcode\": \"\",\n \"address_book_region\": \"\",\n \"address_book_state\": \"\",\n \"address_book_type\": \"\",\n \"address_book_website\": \"\"\n }\n ],\n \"birth_day\": \"\",\n \"company\": \"\",\n \"created_time\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"first_name\": \"\",\n \"gender\": \"\",\n \"group\": \"\",\n \"last_login\": \"\",\n \"last_name\": \"\",\n \"login\": \"\",\n \"modified_time\": \"\",\n \"news_letter_subscription\": false,\n \"password\": \"\",\n \"phone\": \"\",\n \"status\": \"\",\n \"store_id\": \"\",\n \"website\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/customer.add.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'address' => [
[
'address_book_address1' => '',
'address_book_address2' => '',
'address_book_city' => '',
'address_book_company' => '',
'address_book_country' => '',
'address_book_default' => null,
'address_book_fax' => '',
'address_book_first_name' => '',
'address_book_gender' => '',
'address_book_last_name' => '',
'address_book_phone' => '',
'address_book_postcode' => '',
'address_book_region' => '',
'address_book_state' => '',
'address_book_type' => '',
'address_book_website' => ''
]
],
'birth_day' => '',
'company' => '',
'created_time' => '',
'email' => '',
'fax' => '',
'first_name' => '',
'gender' => '',
'group' => '',
'last_login' => '',
'last_name' => '',
'login' => '',
'modified_time' => '',
'news_letter_subscription' => null,
'password' => '',
'phone' => '',
'status' => '',
'store_id' => '',
'website' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/customer.add.json', [
'body' => '{
"address": [
{
"address_book_address1": "",
"address_book_address2": "",
"address_book_city": "",
"address_book_company": "",
"address_book_country": "",
"address_book_default": false,
"address_book_fax": "",
"address_book_first_name": "",
"address_book_gender": "",
"address_book_last_name": "",
"address_book_phone": "",
"address_book_postcode": "",
"address_book_region": "",
"address_book_state": "",
"address_book_type": "",
"address_book_website": ""
}
],
"birth_day": "",
"company": "",
"created_time": "",
"email": "",
"fax": "",
"first_name": "",
"gender": "",
"group": "",
"last_login": "",
"last_name": "",
"login": "",
"modified_time": "",
"news_letter_subscription": false,
"password": "",
"phone": "",
"status": "",
"store_id": "",
"website": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/customer.add.json');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'address' => [
[
'address_book_address1' => '',
'address_book_address2' => '',
'address_book_city' => '',
'address_book_company' => '',
'address_book_country' => '',
'address_book_default' => null,
'address_book_fax' => '',
'address_book_first_name' => '',
'address_book_gender' => '',
'address_book_last_name' => '',
'address_book_phone' => '',
'address_book_postcode' => '',
'address_book_region' => '',
'address_book_state' => '',
'address_book_type' => '',
'address_book_website' => ''
]
],
'birth_day' => '',
'company' => '',
'created_time' => '',
'email' => '',
'fax' => '',
'first_name' => '',
'gender' => '',
'group' => '',
'last_login' => '',
'last_name' => '',
'login' => '',
'modified_time' => '',
'news_letter_subscription' => null,
'password' => '',
'phone' => '',
'status' => '',
'store_id' => '',
'website' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'address' => [
[
'address_book_address1' => '',
'address_book_address2' => '',
'address_book_city' => '',
'address_book_company' => '',
'address_book_country' => '',
'address_book_default' => null,
'address_book_fax' => '',
'address_book_first_name' => '',
'address_book_gender' => '',
'address_book_last_name' => '',
'address_book_phone' => '',
'address_book_postcode' => '',
'address_book_region' => '',
'address_book_state' => '',
'address_book_type' => '',
'address_book_website' => ''
]
],
'birth_day' => '',
'company' => '',
'created_time' => '',
'email' => '',
'fax' => '',
'first_name' => '',
'gender' => '',
'group' => '',
'last_login' => '',
'last_name' => '',
'login' => '',
'modified_time' => '',
'news_letter_subscription' => null,
'password' => '',
'phone' => '',
'status' => '',
'store_id' => '',
'website' => ''
]));
$request->setRequestUrl('{{baseUrl}}/customer.add.json');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/customer.add.json' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"address": [
{
"address_book_address1": "",
"address_book_address2": "",
"address_book_city": "",
"address_book_company": "",
"address_book_country": "",
"address_book_default": false,
"address_book_fax": "",
"address_book_first_name": "",
"address_book_gender": "",
"address_book_last_name": "",
"address_book_phone": "",
"address_book_postcode": "",
"address_book_region": "",
"address_book_state": "",
"address_book_type": "",
"address_book_website": ""
}
],
"birth_day": "",
"company": "",
"created_time": "",
"email": "",
"fax": "",
"first_name": "",
"gender": "",
"group": "",
"last_login": "",
"last_name": "",
"login": "",
"modified_time": "",
"news_letter_subscription": false,
"password": "",
"phone": "",
"status": "",
"store_id": "",
"website": ""
}'
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/customer.add.json' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"address": [
{
"address_book_address1": "",
"address_book_address2": "",
"address_book_city": "",
"address_book_company": "",
"address_book_country": "",
"address_book_default": false,
"address_book_fax": "",
"address_book_first_name": "",
"address_book_gender": "",
"address_book_last_name": "",
"address_book_phone": "",
"address_book_postcode": "",
"address_book_region": "",
"address_book_state": "",
"address_book_type": "",
"address_book_website": ""
}
],
"birth_day": "",
"company": "",
"created_time": "",
"email": "",
"fax": "",
"first_name": "",
"gender": "",
"group": "",
"last_login": "",
"last_name": "",
"login": "",
"modified_time": "",
"news_letter_subscription": false,
"password": "",
"phone": "",
"status": "",
"store_id": "",
"website": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"address\": [\n {\n \"address_book_address1\": \"\",\n \"address_book_address2\": \"\",\n \"address_book_city\": \"\",\n \"address_book_company\": \"\",\n \"address_book_country\": \"\",\n \"address_book_default\": false,\n \"address_book_fax\": \"\",\n \"address_book_first_name\": \"\",\n \"address_book_gender\": \"\",\n \"address_book_last_name\": \"\",\n \"address_book_phone\": \"\",\n \"address_book_postcode\": \"\",\n \"address_book_region\": \"\",\n \"address_book_state\": \"\",\n \"address_book_type\": \"\",\n \"address_book_website\": \"\"\n }\n ],\n \"birth_day\": \"\",\n \"company\": \"\",\n \"created_time\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"first_name\": \"\",\n \"gender\": \"\",\n \"group\": \"\",\n \"last_login\": \"\",\n \"last_name\": \"\",\n \"login\": \"\",\n \"modified_time\": \"\",\n \"news_letter_subscription\": false,\n \"password\": \"\",\n \"phone\": \"\",\n \"status\": \"\",\n \"store_id\": \"\",\n \"website\": \"\"\n}"
headers = {
'x-api-key': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/customer.add.json", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/customer.add.json"
payload = {
"address": [
{
"address_book_address1": "",
"address_book_address2": "",
"address_book_city": "",
"address_book_company": "",
"address_book_country": "",
"address_book_default": False,
"address_book_fax": "",
"address_book_first_name": "",
"address_book_gender": "",
"address_book_last_name": "",
"address_book_phone": "",
"address_book_postcode": "",
"address_book_region": "",
"address_book_state": "",
"address_book_type": "",
"address_book_website": ""
}
],
"birth_day": "",
"company": "",
"created_time": "",
"email": "",
"fax": "",
"first_name": "",
"gender": "",
"group": "",
"last_login": "",
"last_name": "",
"login": "",
"modified_time": "",
"news_letter_subscription": False,
"password": "",
"phone": "",
"status": "",
"store_id": "",
"website": ""
}
headers = {
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/customer.add.json"
payload <- "{\n \"address\": [\n {\n \"address_book_address1\": \"\",\n \"address_book_address2\": \"\",\n \"address_book_city\": \"\",\n \"address_book_company\": \"\",\n \"address_book_country\": \"\",\n \"address_book_default\": false,\n \"address_book_fax\": \"\",\n \"address_book_first_name\": \"\",\n \"address_book_gender\": \"\",\n \"address_book_last_name\": \"\",\n \"address_book_phone\": \"\",\n \"address_book_postcode\": \"\",\n \"address_book_region\": \"\",\n \"address_book_state\": \"\",\n \"address_book_type\": \"\",\n \"address_book_website\": \"\"\n }\n ],\n \"birth_day\": \"\",\n \"company\": \"\",\n \"created_time\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"first_name\": \"\",\n \"gender\": \"\",\n \"group\": \"\",\n \"last_login\": \"\",\n \"last_name\": \"\",\n \"login\": \"\",\n \"modified_time\": \"\",\n \"news_letter_subscription\": false,\n \"password\": \"\",\n \"phone\": \"\",\n \"status\": \"\",\n \"store_id\": \"\",\n \"website\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/customer.add.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"address\": [\n {\n \"address_book_address1\": \"\",\n \"address_book_address2\": \"\",\n \"address_book_city\": \"\",\n \"address_book_company\": \"\",\n \"address_book_country\": \"\",\n \"address_book_default\": false,\n \"address_book_fax\": \"\",\n \"address_book_first_name\": \"\",\n \"address_book_gender\": \"\",\n \"address_book_last_name\": \"\",\n \"address_book_phone\": \"\",\n \"address_book_postcode\": \"\",\n \"address_book_region\": \"\",\n \"address_book_state\": \"\",\n \"address_book_type\": \"\",\n \"address_book_website\": \"\"\n }\n ],\n \"birth_day\": \"\",\n \"company\": \"\",\n \"created_time\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"first_name\": \"\",\n \"gender\": \"\",\n \"group\": \"\",\n \"last_login\": \"\",\n \"last_name\": \"\",\n \"login\": \"\",\n \"modified_time\": \"\",\n \"news_letter_subscription\": false,\n \"password\": \"\",\n \"phone\": \"\",\n \"status\": \"\",\n \"store_id\": \"\",\n \"website\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/customer.add.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.body = "{\n \"address\": [\n {\n \"address_book_address1\": \"\",\n \"address_book_address2\": \"\",\n \"address_book_city\": \"\",\n \"address_book_company\": \"\",\n \"address_book_country\": \"\",\n \"address_book_default\": false,\n \"address_book_fax\": \"\",\n \"address_book_first_name\": \"\",\n \"address_book_gender\": \"\",\n \"address_book_last_name\": \"\",\n \"address_book_phone\": \"\",\n \"address_book_postcode\": \"\",\n \"address_book_region\": \"\",\n \"address_book_state\": \"\",\n \"address_book_type\": \"\",\n \"address_book_website\": \"\"\n }\n ],\n \"birth_day\": \"\",\n \"company\": \"\",\n \"created_time\": \"\",\n \"email\": \"\",\n \"fax\": \"\",\n \"first_name\": \"\",\n \"gender\": \"\",\n \"group\": \"\",\n \"last_login\": \"\",\n \"last_name\": \"\",\n \"login\": \"\",\n \"modified_time\": \"\",\n \"news_letter_subscription\": false,\n \"password\": \"\",\n \"phone\": \"\",\n \"status\": \"\",\n \"store_id\": \"\",\n \"website\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/customer.add.json";
let payload = json!({
"address": (
json!({
"address_book_address1": "",
"address_book_address2": "",
"address_book_city": "",
"address_book_company": "",
"address_book_country": "",
"address_book_default": false,
"address_book_fax": "",
"address_book_first_name": "",
"address_book_gender": "",
"address_book_last_name": "",
"address_book_phone": "",
"address_book_postcode": "",
"address_book_region": "",
"address_book_state": "",
"address_book_type": "",
"address_book_website": ""
})
),
"birth_day": "",
"company": "",
"created_time": "",
"email": "",
"fax": "",
"first_name": "",
"gender": "",
"group": "",
"last_login": "",
"last_name": "",
"login": "",
"modified_time": "",
"news_letter_subscription": false,
"password": "",
"phone": "",
"status": "",
"store_id": "",
"website": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/customer.add.json \
--header 'content-type: application/json' \
--header 'x-api-key: {{apiKey}}' \
--data '{
"address": [
{
"address_book_address1": "",
"address_book_address2": "",
"address_book_city": "",
"address_book_company": "",
"address_book_country": "",
"address_book_default": false,
"address_book_fax": "",
"address_book_first_name": "",
"address_book_gender": "",
"address_book_last_name": "",
"address_book_phone": "",
"address_book_postcode": "",
"address_book_region": "",
"address_book_state": "",
"address_book_type": "",
"address_book_website": ""
}
],
"birth_day": "",
"company": "",
"created_time": "",
"email": "",
"fax": "",
"first_name": "",
"gender": "",
"group": "",
"last_login": "",
"last_name": "",
"login": "",
"modified_time": "",
"news_letter_subscription": false,
"password": "",
"phone": "",
"status": "",
"store_id": "",
"website": ""
}'
echo '{
"address": [
{
"address_book_address1": "",
"address_book_address2": "",
"address_book_city": "",
"address_book_company": "",
"address_book_country": "",
"address_book_default": false,
"address_book_fax": "",
"address_book_first_name": "",
"address_book_gender": "",
"address_book_last_name": "",
"address_book_phone": "",
"address_book_postcode": "",
"address_book_region": "",
"address_book_state": "",
"address_book_type": "",
"address_book_website": ""
}
],
"birth_day": "",
"company": "",
"created_time": "",
"email": "",
"fax": "",
"first_name": "",
"gender": "",
"group": "",
"last_login": "",
"last_name": "",
"login": "",
"modified_time": "",
"news_letter_subscription": false,
"password": "",
"phone": "",
"status": "",
"store_id": "",
"website": ""
}' | \
http POST {{baseUrl}}/customer.add.json \
content-type:application/json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "address": [\n {\n "address_book_address1": "",\n "address_book_address2": "",\n "address_book_city": "",\n "address_book_company": "",\n "address_book_country": "",\n "address_book_default": false,\n "address_book_fax": "",\n "address_book_first_name": "",\n "address_book_gender": "",\n "address_book_last_name": "",\n "address_book_phone": "",\n "address_book_postcode": "",\n "address_book_region": "",\n "address_book_state": "",\n "address_book_type": "",\n "address_book_website": ""\n }\n ],\n "birth_day": "",\n "company": "",\n "created_time": "",\n "email": "",\n "fax": "",\n "first_name": "",\n "gender": "",\n "group": "",\n "last_login": "",\n "last_name": "",\n "login": "",\n "modified_time": "",\n "news_letter_subscription": false,\n "password": "",\n "phone": "",\n "status": "",\n "store_id": "",\n "website": ""\n}' \
--output-document \
- {{baseUrl}}/customer.add.json
import Foundation
let headers = [
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"address": [
[
"address_book_address1": "",
"address_book_address2": "",
"address_book_city": "",
"address_book_company": "",
"address_book_country": "",
"address_book_default": false,
"address_book_fax": "",
"address_book_first_name": "",
"address_book_gender": "",
"address_book_last_name": "",
"address_book_phone": "",
"address_book_postcode": "",
"address_book_region": "",
"address_book_state": "",
"address_book_type": "",
"address_book_website": ""
]
],
"birth_day": "",
"company": "",
"created_time": "",
"email": "",
"fax": "",
"first_name": "",
"gender": "",
"group": "",
"last_login": "",
"last_name": "",
"login": "",
"modified_time": "",
"news_letter_subscription": false,
"password": "",
"phone": "",
"status": "",
"store_id": "",
"website": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/customer.add.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
CustomerAttributeList
{{baseUrl}}/customer.attribute.list.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
customer_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/customer.attribute.list.json?customer_id=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/customer.attribute.list.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:customer_id ""}})
require "http/client"
url = "{{baseUrl}}/customer.attribute.list.json?customer_id="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/customer.attribute.list.json?customer_id="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/customer.attribute.list.json?customer_id=");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/customer.attribute.list.json?customer_id="
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/customer.attribute.list.json?customer_id= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/customer.attribute.list.json?customer_id=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/customer.attribute.list.json?customer_id="))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/customer.attribute.list.json?customer_id=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/customer.attribute.list.json?customer_id=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/customer.attribute.list.json?customer_id=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/customer.attribute.list.json',
params: {customer_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/customer.attribute.list.json?customer_id=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/customer.attribute.list.json?customer_id=',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/customer.attribute.list.json?customer_id=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/customer.attribute.list.json?customer_id=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/customer.attribute.list.json',
qs: {customer_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/customer.attribute.list.json');
req.query({
customer_id: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/customer.attribute.list.json',
params: {customer_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/customer.attribute.list.json?customer_id=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/customer.attribute.list.json?customer_id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/customer.attribute.list.json?customer_id=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/customer.attribute.list.json?customer_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 => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/customer.attribute.list.json?customer_id=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/customer.attribute.list.json');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'customer_id' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/customer.attribute.list.json');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'customer_id' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/customer.attribute.list.json?customer_id=' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/customer.attribute.list.json?customer_id=' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/customer.attribute.list.json?customer_id=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/customer.attribute.list.json"
querystring = {"customer_id":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/customer.attribute.list.json"
queryString <- list(customer_id = "")
response <- VERB("GET", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/customer.attribute.list.json?customer_id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/customer.attribute.list.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['customer_id'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/customer.attribute.list.json";
let querystring = [
("customer_id", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/customer.attribute.list.json?customer_id=' \
--header 'x-api-key: {{apiKey}}'
http GET '{{baseUrl}}/customer.attribute.list.json?customer_id=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/customer.attribute.list.json?customer_id='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/customer.attribute.list.json?customer_id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
CustomerCount
{{baseUrl}}/customer.count.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/customer.count.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/customer.count.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/customer.count.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/customer.count.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/customer.count.json");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/customer.count.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/customer.count.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/customer.count.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/customer.count.json"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/customer.count.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/customer.count.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/customer.count.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/customer.count.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/customer.count.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/customer.count.json',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/customer.count.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/customer.count.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/customer.count.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/customer.count.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/customer.count.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/customer.count.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/customer.count.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/customer.count.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/customer.count.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/customer.count.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/customer.count.json');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/customer.count.json');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/customer.count.json' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/customer.count.json' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/customer.count.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/customer.count.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/customer.count.json"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/customer.count.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/customer.count.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/customer.count.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/customer.count.json \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/customer.count.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/customer.count.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/customer.count.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
CustomerFind
{{baseUrl}}/customer.find.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
find_value
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/customer.find.json?find_value=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/customer.find.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:find_value ""}})
require "http/client"
url = "{{baseUrl}}/customer.find.json?find_value="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/customer.find.json?find_value="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/customer.find.json?find_value=");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/customer.find.json?find_value="
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/customer.find.json?find_value= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/customer.find.json?find_value=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/customer.find.json?find_value="))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/customer.find.json?find_value=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/customer.find.json?find_value=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/customer.find.json?find_value=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/customer.find.json',
params: {find_value: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/customer.find.json?find_value=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/customer.find.json?find_value=',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/customer.find.json?find_value=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/customer.find.json?find_value=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/customer.find.json',
qs: {find_value: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/customer.find.json');
req.query({
find_value: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/customer.find.json',
params: {find_value: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/customer.find.json?find_value=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/customer.find.json?find_value="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/customer.find.json?find_value=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/customer.find.json?find_value=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/customer.find.json?find_value=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/customer.find.json');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'find_value' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/customer.find.json');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'find_value' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/customer.find.json?find_value=' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/customer.find.json?find_value=' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/customer.find.json?find_value=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/customer.find.json"
querystring = {"find_value":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/customer.find.json"
queryString <- list(find_value = "")
response <- VERB("GET", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/customer.find.json?find_value=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/customer.find.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['find_value'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/customer.find.json";
let querystring = [
("find_value", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/customer.find.json?find_value=' \
--header 'x-api-key: {{apiKey}}'
http GET '{{baseUrl}}/customer.find.json?find_value=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/customer.find.json?find_value='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/customer.find.json?find_value=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
CustomerGroupAdd
{{baseUrl}}/customer.group.add.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
name
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/customer.group.add.json?name=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/customer.group.add.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:name ""}})
require "http/client"
url = "{{baseUrl}}/customer.group.add.json?name="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.post url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/customer.group.add.json?name="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/customer.group.add.json?name=");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/customer.group.add.json?name="
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/customer.group.add.json?name= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/customer.group.add.json?name=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/customer.group.add.json?name="))
.header("x-api-key", "{{apiKey}}")
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/customer.group.add.json?name=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/customer.group.add.json?name=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/customer.group.add.json?name=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/customer.group.add.json',
params: {name: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/customer.group.add.json?name=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/customer.group.add.json?name=',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/customer.group.add.json?name=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/customer.group.add.json?name=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/customer.group.add.json',
qs: {name: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/customer.group.add.json');
req.query({
name: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/customer.group.add.json',
params: {name: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/customer.group.add.json?name=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/customer.group.add.json?name="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/customer.group.add.json?name=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/customer.group.add.json?name=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/customer.group.add.json?name=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/customer.group.add.json');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'name' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/customer.group.add.json');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'name' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/customer.group.add.json?name=' -Method POST -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/customer.group.add.json?name=' -Method POST -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("POST", "/baseUrl/customer.group.add.json?name=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/customer.group.add.json"
querystring = {"name":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.post(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/customer.group.add.json"
queryString <- list(name = "")
response <- VERB("POST", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/customer.group.add.json?name=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/customer.group.add.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['name'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/customer.group.add.json";
let querystring = [
("name", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/customer.group.add.json?name=' \
--header 'x-api-key: {{apiKey}}'
http POST '{{baseUrl}}/customer.group.add.json?name=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/customer.group.add.json?name='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/customer.group.add.json?name=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
CustomerGroupList
{{baseUrl}}/customer.group.list.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/customer.group.list.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/customer.group.list.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/customer.group.list.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/customer.group.list.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/customer.group.list.json");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/customer.group.list.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/customer.group.list.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/customer.group.list.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/customer.group.list.json"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/customer.group.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/customer.group.list.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/customer.group.list.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/customer.group.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/customer.group.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/customer.group.list.json',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/customer.group.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/customer.group.list.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/customer.group.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/customer.group.list.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/customer.group.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/customer.group.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/customer.group.list.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/customer.group.list.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/customer.group.list.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/customer.group.list.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/customer.group.list.json');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/customer.group.list.json');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/customer.group.list.json' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/customer.group.list.json' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/customer.group.list.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/customer.group.list.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/customer.group.list.json"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/customer.group.list.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/customer.group.list.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/customer.group.list.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/customer.group.list.json \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/customer.group.list.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/customer.group.list.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/customer.group.list.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
CustomerInfo
{{baseUrl}}/customer.info.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/customer.info.json?id=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/customer.info.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:id ""}})
require "http/client"
url = "{{baseUrl}}/customer.info.json?id="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/customer.info.json?id="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/customer.info.json?id=");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/customer.info.json?id="
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/customer.info.json?id= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/customer.info.json?id=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/customer.info.json?id="))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/customer.info.json?id=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/customer.info.json?id=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/customer.info.json?id=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/customer.info.json',
params: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/customer.info.json?id=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/customer.info.json?id=',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/customer.info.json?id=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/customer.info.json?id=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/customer.info.json',
qs: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/customer.info.json');
req.query({
id: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/customer.info.json',
params: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/customer.info.json?id=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/customer.info.json?id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/customer.info.json?id=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/customer.info.json?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 => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/customer.info.json?id=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/customer.info.json');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'id' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/customer.info.json');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'id' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/customer.info.json?id=' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/customer.info.json?id=' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/customer.info.json?id=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/customer.info.json"
querystring = {"id":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/customer.info.json"
queryString <- list(id = "")
response <- VERB("GET", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/customer.info.json?id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/customer.info.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['id'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/customer.info.json";
let querystring = [
("id", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/customer.info.json?id=' \
--header 'x-api-key: {{apiKey}}'
http GET '{{baseUrl}}/customer.info.json?id=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/customer.info.json?id='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/customer.info.json?id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
CustomerList
{{baseUrl}}/customer.list.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/customer.list.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/customer.list.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/customer.list.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/customer.list.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/customer.list.json");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/customer.list.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/customer.list.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/customer.list.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/customer.list.json"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/customer.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/customer.list.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/customer.list.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/customer.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/customer.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/customer.list.json',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/customer.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/customer.list.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/customer.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/customer.list.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/customer.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/customer.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/customer.list.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/customer.list.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/customer.list.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/customer.list.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/customer.list.json');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/customer.list.json');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/customer.list.json' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/customer.list.json' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/customer.list.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/customer.list.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/customer.list.json"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/customer.list.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/customer.list.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/customer.list.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/customer.list.json \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/customer.list.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/customer.list.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/customer.list.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PUT
CustomerUpdate
{{baseUrl}}/customer.update.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/customer.update.json?id=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/customer.update.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:id ""}})
require "http/client"
url = "{{baseUrl}}/customer.update.json?id="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.put url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/customer.update.json?id="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/customer.update.json?id=");
var request = new RestRequest("", Method.Put);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/customer.update.json?id="
req, _ := http.NewRequest("PUT", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/customer.update.json?id= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/customer.update.json?id=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/customer.update.json?id="))
.header("x-api-key", "{{apiKey}}")
.method("PUT", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/customer.update.json?id=")
.put(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/customer.update.json?id=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/customer.update.json?id=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/customer.update.json',
params: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/customer.update.json?id=';
const options = {method: 'PUT', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/customer.update.json?id=',
method: 'PUT',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/customer.update.json?id=")
.put(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/customer.update.json?id=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/customer.update.json',
qs: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/customer.update.json');
req.query({
id: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/customer.update.json',
params: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/customer.update.json?id=';
const options = {method: 'PUT', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/customer.update.json?id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/customer.update.json?id=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/customer.update.json?id=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/customer.update.json?id=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/customer.update.json');
$request->setMethod(HTTP_METH_PUT);
$request->setQueryData([
'id' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/customer.update.json');
$request->setRequestMethod('PUT');
$request->setQuery(new http\QueryString([
'id' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/customer.update.json?id=' -Method PUT -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/customer.update.json?id=' -Method PUT -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("PUT", "/baseUrl/customer.update.json?id=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/customer.update.json"
querystring = {"id":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.put(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/customer.update.json"
queryString <- list(id = "")
response <- VERB("PUT", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/customer.update.json?id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.put('/baseUrl/customer.update.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['id'] = ''
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/customer.update.json";
let querystring = [
("id", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url '{{baseUrl}}/customer.update.json?id=' \
--header 'x-api-key: {{apiKey}}'
http PUT '{{baseUrl}}/customer.update.json?id=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method PUT \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/customer.update.json?id='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/customer.update.json?id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
OrderAbandonedList
{{baseUrl}}/order.abandoned.list.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/order.abandoned.list.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/order.abandoned.list.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/order.abandoned.list.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/order.abandoned.list.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/order.abandoned.list.json");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/order.abandoned.list.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/order.abandoned.list.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/order.abandoned.list.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/order.abandoned.list.json"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/order.abandoned.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/order.abandoned.list.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/order.abandoned.list.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/order.abandoned.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/order.abandoned.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/order.abandoned.list.json',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/order.abandoned.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/order.abandoned.list.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/order.abandoned.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/order.abandoned.list.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/order.abandoned.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/order.abandoned.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/order.abandoned.list.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/order.abandoned.list.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/order.abandoned.list.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/order.abandoned.list.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/order.abandoned.list.json');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/order.abandoned.list.json');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/order.abandoned.list.json' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/order.abandoned.list.json' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/order.abandoned.list.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/order.abandoned.list.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/order.abandoned.list.json"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/order.abandoned.list.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/order.abandoned.list.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/order.abandoned.list.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/order.abandoned.list.json \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/order.abandoned.list.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/order.abandoned.list.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/order.abandoned.list.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
OrderAdd
{{baseUrl}}/order.add.json
HEADERS
x-api-key
{{apiKey}}
BODY json
{
"admin_comment": "",
"admin_private_comment": "",
"bill_address_1": "",
"bill_address_2": "",
"bill_city": "",
"bill_company": "",
"bill_country": "",
"bill_fax": "",
"bill_first_name": "",
"bill_last_name": "",
"bill_phone": "",
"bill_postcode": "",
"bill_state": "",
"channel_id": "",
"clear_cache": false,
"comment": "",
"coupon_discount": "",
"coupons": [],
"create_invoice": false,
"currency": "",
"customer_birthday": "",
"customer_email": "",
"customer_fax": "",
"customer_first_name": "",
"customer_last_name": "",
"customer_phone": "",
"date": "",
"date_finished": "",
"date_modified": "",
"discount": "",
"external_source": "",
"financial_status": "",
"fulfillment_status": "",
"gift_certificate_discount": "",
"id": "",
"inventory_behaviour": "",
"note_attributes": [
{
"name": "",
"value": ""
}
],
"order_id": "",
"order_item": [
{
"order_item_allow_refund_items_separately": false,
"order_item_allow_ship_items_separately": false,
"order_item_id": "",
"order_item_model": "",
"order_item_name": "",
"order_item_option": [
{
"order_item_option_name": "",
"order_item_option_price": "",
"order_item_option_value": ""
}
],
"order_item_parent": 0,
"order_item_parent_option_name": "",
"order_item_price": "",
"order_item_price_includes_tax": false,
"order_item_property": [
{
"order_item_property_name": "",
"order_item_property_value": ""
}
],
"order_item_quantity": 0,
"order_item_tax": "",
"order_item_variant_id": "",
"order_item_weight": ""
}
],
"order_payment_method": "",
"order_shipping_method": "",
"order_status": "",
"prices_inc_tax": false,
"send_admin_notifications": false,
"send_notifications": false,
"shipp_address_1": "",
"shipp_address_2": "",
"shipp_city": "",
"shipp_company": "",
"shipp_country": "",
"shipp_fax": "",
"shipp_first_name": "",
"shipp_last_name": "",
"shipp_phone": "",
"shipp_postcode": "",
"shipp_state": "",
"shipping_price": "",
"shipping_tax": "",
"store_id": "",
"subtotal_price": "",
"tags": "",
"tax_price": "",
"total_paid": "",
"total_price": "",
"total_weight": 0,
"transaction_id": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/order.add.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"admin_comment\": \"\",\n \"admin_private_comment\": \"\",\n \"bill_address_1\": \"\",\n \"bill_address_2\": \"\",\n \"bill_city\": \"\",\n \"bill_company\": \"\",\n \"bill_country\": \"\",\n \"bill_fax\": \"\",\n \"bill_first_name\": \"\",\n \"bill_last_name\": \"\",\n \"bill_phone\": \"\",\n \"bill_postcode\": \"\",\n \"bill_state\": \"\",\n \"channel_id\": \"\",\n \"clear_cache\": false,\n \"comment\": \"\",\n \"coupon_discount\": \"\",\n \"coupons\": [],\n \"create_invoice\": false,\n \"currency\": \"\",\n \"customer_birthday\": \"\",\n \"customer_email\": \"\",\n \"customer_fax\": \"\",\n \"customer_first_name\": \"\",\n \"customer_last_name\": \"\",\n \"customer_phone\": \"\",\n \"date\": \"\",\n \"date_finished\": \"\",\n \"date_modified\": \"\",\n \"discount\": \"\",\n \"external_source\": \"\",\n \"financial_status\": \"\",\n \"fulfillment_status\": \"\",\n \"gift_certificate_discount\": \"\",\n \"id\": \"\",\n \"inventory_behaviour\": \"\",\n \"note_attributes\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"order_id\": \"\",\n \"order_item\": [\n {\n \"order_item_allow_refund_items_separately\": false,\n \"order_item_allow_ship_items_separately\": false,\n \"order_item_id\": \"\",\n \"order_item_model\": \"\",\n \"order_item_name\": \"\",\n \"order_item_option\": [\n {\n \"order_item_option_name\": \"\",\n \"order_item_option_price\": \"\",\n \"order_item_option_value\": \"\"\n }\n ],\n \"order_item_parent\": 0,\n \"order_item_parent_option_name\": \"\",\n \"order_item_price\": \"\",\n \"order_item_price_includes_tax\": false,\n \"order_item_property\": [\n {\n \"order_item_property_name\": \"\",\n \"order_item_property_value\": \"\"\n }\n ],\n \"order_item_quantity\": 0,\n \"order_item_tax\": \"\",\n \"order_item_variant_id\": \"\",\n \"order_item_weight\": \"\"\n }\n ],\n \"order_payment_method\": \"\",\n \"order_shipping_method\": \"\",\n \"order_status\": \"\",\n \"prices_inc_tax\": false,\n \"send_admin_notifications\": false,\n \"send_notifications\": false,\n \"shipp_address_1\": \"\",\n \"shipp_address_2\": \"\",\n \"shipp_city\": \"\",\n \"shipp_company\": \"\",\n \"shipp_country\": \"\",\n \"shipp_fax\": \"\",\n \"shipp_first_name\": \"\",\n \"shipp_last_name\": \"\",\n \"shipp_phone\": \"\",\n \"shipp_postcode\": \"\",\n \"shipp_state\": \"\",\n \"shipping_price\": \"\",\n \"shipping_tax\": \"\",\n \"store_id\": \"\",\n \"subtotal_price\": \"\",\n \"tags\": \"\",\n \"tax_price\": \"\",\n \"total_paid\": \"\",\n \"total_price\": \"\",\n \"total_weight\": 0,\n \"transaction_id\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/order.add.json" {:headers {:x-api-key "{{apiKey}}"}
:content-type :json
:form-params {:admin_comment ""
:admin_private_comment ""
:bill_address_1 ""
:bill_address_2 ""
:bill_city ""
:bill_company ""
:bill_country ""
:bill_fax ""
:bill_first_name ""
:bill_last_name ""
:bill_phone ""
:bill_postcode ""
:bill_state ""
:channel_id ""
:clear_cache false
:comment ""
:coupon_discount ""
:coupons []
:create_invoice false
:currency ""
:customer_birthday ""
:customer_email ""
:customer_fax ""
:customer_first_name ""
:customer_last_name ""
:customer_phone ""
:date ""
:date_finished ""
:date_modified ""
:discount ""
:external_source ""
:financial_status ""
:fulfillment_status ""
:gift_certificate_discount ""
:id ""
:inventory_behaviour ""
:note_attributes [{:name ""
:value ""}]
:order_id ""
:order_item [{:order_item_allow_refund_items_separately false
:order_item_allow_ship_items_separately false
:order_item_id ""
:order_item_model ""
:order_item_name ""
:order_item_option [{:order_item_option_name ""
:order_item_option_price ""
:order_item_option_value ""}]
:order_item_parent 0
:order_item_parent_option_name ""
:order_item_price ""
:order_item_price_includes_tax false
:order_item_property [{:order_item_property_name ""
:order_item_property_value ""}]
:order_item_quantity 0
:order_item_tax ""
:order_item_variant_id ""
:order_item_weight ""}]
:order_payment_method ""
:order_shipping_method ""
:order_status ""
:prices_inc_tax false
:send_admin_notifications false
:send_notifications false
:shipp_address_1 ""
:shipp_address_2 ""
:shipp_city ""
:shipp_company ""
:shipp_country ""
:shipp_fax ""
:shipp_first_name ""
:shipp_last_name ""
:shipp_phone ""
:shipp_postcode ""
:shipp_state ""
:shipping_price ""
:shipping_tax ""
:store_id ""
:subtotal_price ""
:tags ""
:tax_price ""
:total_paid ""
:total_price ""
:total_weight 0
:transaction_id ""}})
require "http/client"
url = "{{baseUrl}}/order.add.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"admin_comment\": \"\",\n \"admin_private_comment\": \"\",\n \"bill_address_1\": \"\",\n \"bill_address_2\": \"\",\n \"bill_city\": \"\",\n \"bill_company\": \"\",\n \"bill_country\": \"\",\n \"bill_fax\": \"\",\n \"bill_first_name\": \"\",\n \"bill_last_name\": \"\",\n \"bill_phone\": \"\",\n \"bill_postcode\": \"\",\n \"bill_state\": \"\",\n \"channel_id\": \"\",\n \"clear_cache\": false,\n \"comment\": \"\",\n \"coupon_discount\": \"\",\n \"coupons\": [],\n \"create_invoice\": false,\n \"currency\": \"\",\n \"customer_birthday\": \"\",\n \"customer_email\": \"\",\n \"customer_fax\": \"\",\n \"customer_first_name\": \"\",\n \"customer_last_name\": \"\",\n \"customer_phone\": \"\",\n \"date\": \"\",\n \"date_finished\": \"\",\n \"date_modified\": \"\",\n \"discount\": \"\",\n \"external_source\": \"\",\n \"financial_status\": \"\",\n \"fulfillment_status\": \"\",\n \"gift_certificate_discount\": \"\",\n \"id\": \"\",\n \"inventory_behaviour\": \"\",\n \"note_attributes\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"order_id\": \"\",\n \"order_item\": [\n {\n \"order_item_allow_refund_items_separately\": false,\n \"order_item_allow_ship_items_separately\": false,\n \"order_item_id\": \"\",\n \"order_item_model\": \"\",\n \"order_item_name\": \"\",\n \"order_item_option\": [\n {\n \"order_item_option_name\": \"\",\n \"order_item_option_price\": \"\",\n \"order_item_option_value\": \"\"\n }\n ],\n \"order_item_parent\": 0,\n \"order_item_parent_option_name\": \"\",\n \"order_item_price\": \"\",\n \"order_item_price_includes_tax\": false,\n \"order_item_property\": [\n {\n \"order_item_property_name\": \"\",\n \"order_item_property_value\": \"\"\n }\n ],\n \"order_item_quantity\": 0,\n \"order_item_tax\": \"\",\n \"order_item_variant_id\": \"\",\n \"order_item_weight\": \"\"\n }\n ],\n \"order_payment_method\": \"\",\n \"order_shipping_method\": \"\",\n \"order_status\": \"\",\n \"prices_inc_tax\": false,\n \"send_admin_notifications\": false,\n \"send_notifications\": false,\n \"shipp_address_1\": \"\",\n \"shipp_address_2\": \"\",\n \"shipp_city\": \"\",\n \"shipp_company\": \"\",\n \"shipp_country\": \"\",\n \"shipp_fax\": \"\",\n \"shipp_first_name\": \"\",\n \"shipp_last_name\": \"\",\n \"shipp_phone\": \"\",\n \"shipp_postcode\": \"\",\n \"shipp_state\": \"\",\n \"shipping_price\": \"\",\n \"shipping_tax\": \"\",\n \"store_id\": \"\",\n \"subtotal_price\": \"\",\n \"tags\": \"\",\n \"tax_price\": \"\",\n \"total_paid\": \"\",\n \"total_price\": \"\",\n \"total_weight\": 0,\n \"transaction_id\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/order.add.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
Content = new StringContent("{\n \"admin_comment\": \"\",\n \"admin_private_comment\": \"\",\n \"bill_address_1\": \"\",\n \"bill_address_2\": \"\",\n \"bill_city\": \"\",\n \"bill_company\": \"\",\n \"bill_country\": \"\",\n \"bill_fax\": \"\",\n \"bill_first_name\": \"\",\n \"bill_last_name\": \"\",\n \"bill_phone\": \"\",\n \"bill_postcode\": \"\",\n \"bill_state\": \"\",\n \"channel_id\": \"\",\n \"clear_cache\": false,\n \"comment\": \"\",\n \"coupon_discount\": \"\",\n \"coupons\": [],\n \"create_invoice\": false,\n \"currency\": \"\",\n \"customer_birthday\": \"\",\n \"customer_email\": \"\",\n \"customer_fax\": \"\",\n \"customer_first_name\": \"\",\n \"customer_last_name\": \"\",\n \"customer_phone\": \"\",\n \"date\": \"\",\n \"date_finished\": \"\",\n \"date_modified\": \"\",\n \"discount\": \"\",\n \"external_source\": \"\",\n \"financial_status\": \"\",\n \"fulfillment_status\": \"\",\n \"gift_certificate_discount\": \"\",\n \"id\": \"\",\n \"inventory_behaviour\": \"\",\n \"note_attributes\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"order_id\": \"\",\n \"order_item\": [\n {\n \"order_item_allow_refund_items_separately\": false,\n \"order_item_allow_ship_items_separately\": false,\n \"order_item_id\": \"\",\n \"order_item_model\": \"\",\n \"order_item_name\": \"\",\n \"order_item_option\": [\n {\n \"order_item_option_name\": \"\",\n \"order_item_option_price\": \"\",\n \"order_item_option_value\": \"\"\n }\n ],\n \"order_item_parent\": 0,\n \"order_item_parent_option_name\": \"\",\n \"order_item_price\": \"\",\n \"order_item_price_includes_tax\": false,\n \"order_item_property\": [\n {\n \"order_item_property_name\": \"\",\n \"order_item_property_value\": \"\"\n }\n ],\n \"order_item_quantity\": 0,\n \"order_item_tax\": \"\",\n \"order_item_variant_id\": \"\",\n \"order_item_weight\": \"\"\n }\n ],\n \"order_payment_method\": \"\",\n \"order_shipping_method\": \"\",\n \"order_status\": \"\",\n \"prices_inc_tax\": false,\n \"send_admin_notifications\": false,\n \"send_notifications\": false,\n \"shipp_address_1\": \"\",\n \"shipp_address_2\": \"\",\n \"shipp_city\": \"\",\n \"shipp_company\": \"\",\n \"shipp_country\": \"\",\n \"shipp_fax\": \"\",\n \"shipp_first_name\": \"\",\n \"shipp_last_name\": \"\",\n \"shipp_phone\": \"\",\n \"shipp_postcode\": \"\",\n \"shipp_state\": \"\",\n \"shipping_price\": \"\",\n \"shipping_tax\": \"\",\n \"store_id\": \"\",\n \"subtotal_price\": \"\",\n \"tags\": \"\",\n \"tax_price\": \"\",\n \"total_paid\": \"\",\n \"total_price\": \"\",\n \"total_weight\": 0,\n \"transaction_id\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/order.add.json");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"admin_comment\": \"\",\n \"admin_private_comment\": \"\",\n \"bill_address_1\": \"\",\n \"bill_address_2\": \"\",\n \"bill_city\": \"\",\n \"bill_company\": \"\",\n \"bill_country\": \"\",\n \"bill_fax\": \"\",\n \"bill_first_name\": \"\",\n \"bill_last_name\": \"\",\n \"bill_phone\": \"\",\n \"bill_postcode\": \"\",\n \"bill_state\": \"\",\n \"channel_id\": \"\",\n \"clear_cache\": false,\n \"comment\": \"\",\n \"coupon_discount\": \"\",\n \"coupons\": [],\n \"create_invoice\": false,\n \"currency\": \"\",\n \"customer_birthday\": \"\",\n \"customer_email\": \"\",\n \"customer_fax\": \"\",\n \"customer_first_name\": \"\",\n \"customer_last_name\": \"\",\n \"customer_phone\": \"\",\n \"date\": \"\",\n \"date_finished\": \"\",\n \"date_modified\": \"\",\n \"discount\": \"\",\n \"external_source\": \"\",\n \"financial_status\": \"\",\n \"fulfillment_status\": \"\",\n \"gift_certificate_discount\": \"\",\n \"id\": \"\",\n \"inventory_behaviour\": \"\",\n \"note_attributes\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"order_id\": \"\",\n \"order_item\": [\n {\n \"order_item_allow_refund_items_separately\": false,\n \"order_item_allow_ship_items_separately\": false,\n \"order_item_id\": \"\",\n \"order_item_model\": \"\",\n \"order_item_name\": \"\",\n \"order_item_option\": [\n {\n \"order_item_option_name\": \"\",\n \"order_item_option_price\": \"\",\n \"order_item_option_value\": \"\"\n }\n ],\n \"order_item_parent\": 0,\n \"order_item_parent_option_name\": \"\",\n \"order_item_price\": \"\",\n \"order_item_price_includes_tax\": false,\n \"order_item_property\": [\n {\n \"order_item_property_name\": \"\",\n \"order_item_property_value\": \"\"\n }\n ],\n \"order_item_quantity\": 0,\n \"order_item_tax\": \"\",\n \"order_item_variant_id\": \"\",\n \"order_item_weight\": \"\"\n }\n ],\n \"order_payment_method\": \"\",\n \"order_shipping_method\": \"\",\n \"order_status\": \"\",\n \"prices_inc_tax\": false,\n \"send_admin_notifications\": false,\n \"send_notifications\": false,\n \"shipp_address_1\": \"\",\n \"shipp_address_2\": \"\",\n \"shipp_city\": \"\",\n \"shipp_company\": \"\",\n \"shipp_country\": \"\",\n \"shipp_fax\": \"\",\n \"shipp_first_name\": \"\",\n \"shipp_last_name\": \"\",\n \"shipp_phone\": \"\",\n \"shipp_postcode\": \"\",\n \"shipp_state\": \"\",\n \"shipping_price\": \"\",\n \"shipping_tax\": \"\",\n \"store_id\": \"\",\n \"subtotal_price\": \"\",\n \"tags\": \"\",\n \"tax_price\": \"\",\n \"total_paid\": \"\",\n \"total_price\": \"\",\n \"total_weight\": 0,\n \"transaction_id\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/order.add.json"
payload := strings.NewReader("{\n \"admin_comment\": \"\",\n \"admin_private_comment\": \"\",\n \"bill_address_1\": \"\",\n \"bill_address_2\": \"\",\n \"bill_city\": \"\",\n \"bill_company\": \"\",\n \"bill_country\": \"\",\n \"bill_fax\": \"\",\n \"bill_first_name\": \"\",\n \"bill_last_name\": \"\",\n \"bill_phone\": \"\",\n \"bill_postcode\": \"\",\n \"bill_state\": \"\",\n \"channel_id\": \"\",\n \"clear_cache\": false,\n \"comment\": \"\",\n \"coupon_discount\": \"\",\n \"coupons\": [],\n \"create_invoice\": false,\n \"currency\": \"\",\n \"customer_birthday\": \"\",\n \"customer_email\": \"\",\n \"customer_fax\": \"\",\n \"customer_first_name\": \"\",\n \"customer_last_name\": \"\",\n \"customer_phone\": \"\",\n \"date\": \"\",\n \"date_finished\": \"\",\n \"date_modified\": \"\",\n \"discount\": \"\",\n \"external_source\": \"\",\n \"financial_status\": \"\",\n \"fulfillment_status\": \"\",\n \"gift_certificate_discount\": \"\",\n \"id\": \"\",\n \"inventory_behaviour\": \"\",\n \"note_attributes\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"order_id\": \"\",\n \"order_item\": [\n {\n \"order_item_allow_refund_items_separately\": false,\n \"order_item_allow_ship_items_separately\": false,\n \"order_item_id\": \"\",\n \"order_item_model\": \"\",\n \"order_item_name\": \"\",\n \"order_item_option\": [\n {\n \"order_item_option_name\": \"\",\n \"order_item_option_price\": \"\",\n \"order_item_option_value\": \"\"\n }\n ],\n \"order_item_parent\": 0,\n \"order_item_parent_option_name\": \"\",\n \"order_item_price\": \"\",\n \"order_item_price_includes_tax\": false,\n \"order_item_property\": [\n {\n \"order_item_property_name\": \"\",\n \"order_item_property_value\": \"\"\n }\n ],\n \"order_item_quantity\": 0,\n \"order_item_tax\": \"\",\n \"order_item_variant_id\": \"\",\n \"order_item_weight\": \"\"\n }\n ],\n \"order_payment_method\": \"\",\n \"order_shipping_method\": \"\",\n \"order_status\": \"\",\n \"prices_inc_tax\": false,\n \"send_admin_notifications\": false,\n \"send_notifications\": false,\n \"shipp_address_1\": \"\",\n \"shipp_address_2\": \"\",\n \"shipp_city\": \"\",\n \"shipp_company\": \"\",\n \"shipp_country\": \"\",\n \"shipp_fax\": \"\",\n \"shipp_first_name\": \"\",\n \"shipp_last_name\": \"\",\n \"shipp_phone\": \"\",\n \"shipp_postcode\": \"\",\n \"shipp_state\": \"\",\n \"shipping_price\": \"\",\n \"shipping_tax\": \"\",\n \"store_id\": \"\",\n \"subtotal_price\": \"\",\n \"tags\": \"\",\n \"tax_price\": \"\",\n \"total_paid\": \"\",\n \"total_price\": \"\",\n \"total_weight\": 0,\n \"transaction_id\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/order.add.json HTTP/1.1
X-Api-Key: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 2393
{
"admin_comment": "",
"admin_private_comment": "",
"bill_address_1": "",
"bill_address_2": "",
"bill_city": "",
"bill_company": "",
"bill_country": "",
"bill_fax": "",
"bill_first_name": "",
"bill_last_name": "",
"bill_phone": "",
"bill_postcode": "",
"bill_state": "",
"channel_id": "",
"clear_cache": false,
"comment": "",
"coupon_discount": "",
"coupons": [],
"create_invoice": false,
"currency": "",
"customer_birthday": "",
"customer_email": "",
"customer_fax": "",
"customer_first_name": "",
"customer_last_name": "",
"customer_phone": "",
"date": "",
"date_finished": "",
"date_modified": "",
"discount": "",
"external_source": "",
"financial_status": "",
"fulfillment_status": "",
"gift_certificate_discount": "",
"id": "",
"inventory_behaviour": "",
"note_attributes": [
{
"name": "",
"value": ""
}
],
"order_id": "",
"order_item": [
{
"order_item_allow_refund_items_separately": false,
"order_item_allow_ship_items_separately": false,
"order_item_id": "",
"order_item_model": "",
"order_item_name": "",
"order_item_option": [
{
"order_item_option_name": "",
"order_item_option_price": "",
"order_item_option_value": ""
}
],
"order_item_parent": 0,
"order_item_parent_option_name": "",
"order_item_price": "",
"order_item_price_includes_tax": false,
"order_item_property": [
{
"order_item_property_name": "",
"order_item_property_value": ""
}
],
"order_item_quantity": 0,
"order_item_tax": "",
"order_item_variant_id": "",
"order_item_weight": ""
}
],
"order_payment_method": "",
"order_shipping_method": "",
"order_status": "",
"prices_inc_tax": false,
"send_admin_notifications": false,
"send_notifications": false,
"shipp_address_1": "",
"shipp_address_2": "",
"shipp_city": "",
"shipp_company": "",
"shipp_country": "",
"shipp_fax": "",
"shipp_first_name": "",
"shipp_last_name": "",
"shipp_phone": "",
"shipp_postcode": "",
"shipp_state": "",
"shipping_price": "",
"shipping_tax": "",
"store_id": "",
"subtotal_price": "",
"tags": "",
"tax_price": "",
"total_paid": "",
"total_price": "",
"total_weight": 0,
"transaction_id": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/order.add.json")
.setHeader("x-api-key", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"admin_comment\": \"\",\n \"admin_private_comment\": \"\",\n \"bill_address_1\": \"\",\n \"bill_address_2\": \"\",\n \"bill_city\": \"\",\n \"bill_company\": \"\",\n \"bill_country\": \"\",\n \"bill_fax\": \"\",\n \"bill_first_name\": \"\",\n \"bill_last_name\": \"\",\n \"bill_phone\": \"\",\n \"bill_postcode\": \"\",\n \"bill_state\": \"\",\n \"channel_id\": \"\",\n \"clear_cache\": false,\n \"comment\": \"\",\n \"coupon_discount\": \"\",\n \"coupons\": [],\n \"create_invoice\": false,\n \"currency\": \"\",\n \"customer_birthday\": \"\",\n \"customer_email\": \"\",\n \"customer_fax\": \"\",\n \"customer_first_name\": \"\",\n \"customer_last_name\": \"\",\n \"customer_phone\": \"\",\n \"date\": \"\",\n \"date_finished\": \"\",\n \"date_modified\": \"\",\n \"discount\": \"\",\n \"external_source\": \"\",\n \"financial_status\": \"\",\n \"fulfillment_status\": \"\",\n \"gift_certificate_discount\": \"\",\n \"id\": \"\",\n \"inventory_behaviour\": \"\",\n \"note_attributes\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"order_id\": \"\",\n \"order_item\": [\n {\n \"order_item_allow_refund_items_separately\": false,\n \"order_item_allow_ship_items_separately\": false,\n \"order_item_id\": \"\",\n \"order_item_model\": \"\",\n \"order_item_name\": \"\",\n \"order_item_option\": [\n {\n \"order_item_option_name\": \"\",\n \"order_item_option_price\": \"\",\n \"order_item_option_value\": \"\"\n }\n ],\n \"order_item_parent\": 0,\n \"order_item_parent_option_name\": \"\",\n \"order_item_price\": \"\",\n \"order_item_price_includes_tax\": false,\n \"order_item_property\": [\n {\n \"order_item_property_name\": \"\",\n \"order_item_property_value\": \"\"\n }\n ],\n \"order_item_quantity\": 0,\n \"order_item_tax\": \"\",\n \"order_item_variant_id\": \"\",\n \"order_item_weight\": \"\"\n }\n ],\n \"order_payment_method\": \"\",\n \"order_shipping_method\": \"\",\n \"order_status\": \"\",\n \"prices_inc_tax\": false,\n \"send_admin_notifications\": false,\n \"send_notifications\": false,\n \"shipp_address_1\": \"\",\n \"shipp_address_2\": \"\",\n \"shipp_city\": \"\",\n \"shipp_company\": \"\",\n \"shipp_country\": \"\",\n \"shipp_fax\": \"\",\n \"shipp_first_name\": \"\",\n \"shipp_last_name\": \"\",\n \"shipp_phone\": \"\",\n \"shipp_postcode\": \"\",\n \"shipp_state\": \"\",\n \"shipping_price\": \"\",\n \"shipping_tax\": \"\",\n \"store_id\": \"\",\n \"subtotal_price\": \"\",\n \"tags\": \"\",\n \"tax_price\": \"\",\n \"total_paid\": \"\",\n \"total_price\": \"\",\n \"total_weight\": 0,\n \"transaction_id\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/order.add.json"))
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"admin_comment\": \"\",\n \"admin_private_comment\": \"\",\n \"bill_address_1\": \"\",\n \"bill_address_2\": \"\",\n \"bill_city\": \"\",\n \"bill_company\": \"\",\n \"bill_country\": \"\",\n \"bill_fax\": \"\",\n \"bill_first_name\": \"\",\n \"bill_last_name\": \"\",\n \"bill_phone\": \"\",\n \"bill_postcode\": \"\",\n \"bill_state\": \"\",\n \"channel_id\": \"\",\n \"clear_cache\": false,\n \"comment\": \"\",\n \"coupon_discount\": \"\",\n \"coupons\": [],\n \"create_invoice\": false,\n \"currency\": \"\",\n \"customer_birthday\": \"\",\n \"customer_email\": \"\",\n \"customer_fax\": \"\",\n \"customer_first_name\": \"\",\n \"customer_last_name\": \"\",\n \"customer_phone\": \"\",\n \"date\": \"\",\n \"date_finished\": \"\",\n \"date_modified\": \"\",\n \"discount\": \"\",\n \"external_source\": \"\",\n \"financial_status\": \"\",\n \"fulfillment_status\": \"\",\n \"gift_certificate_discount\": \"\",\n \"id\": \"\",\n \"inventory_behaviour\": \"\",\n \"note_attributes\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"order_id\": \"\",\n \"order_item\": [\n {\n \"order_item_allow_refund_items_separately\": false,\n \"order_item_allow_ship_items_separately\": false,\n \"order_item_id\": \"\",\n \"order_item_model\": \"\",\n \"order_item_name\": \"\",\n \"order_item_option\": [\n {\n \"order_item_option_name\": \"\",\n \"order_item_option_price\": \"\",\n \"order_item_option_value\": \"\"\n }\n ],\n \"order_item_parent\": 0,\n \"order_item_parent_option_name\": \"\",\n \"order_item_price\": \"\",\n \"order_item_price_includes_tax\": false,\n \"order_item_property\": [\n {\n \"order_item_property_name\": \"\",\n \"order_item_property_value\": \"\"\n }\n ],\n \"order_item_quantity\": 0,\n \"order_item_tax\": \"\",\n \"order_item_variant_id\": \"\",\n \"order_item_weight\": \"\"\n }\n ],\n \"order_payment_method\": \"\",\n \"order_shipping_method\": \"\",\n \"order_status\": \"\",\n \"prices_inc_tax\": false,\n \"send_admin_notifications\": false,\n \"send_notifications\": false,\n \"shipp_address_1\": \"\",\n \"shipp_address_2\": \"\",\n \"shipp_city\": \"\",\n \"shipp_company\": \"\",\n \"shipp_country\": \"\",\n \"shipp_fax\": \"\",\n \"shipp_first_name\": \"\",\n \"shipp_last_name\": \"\",\n \"shipp_phone\": \"\",\n \"shipp_postcode\": \"\",\n \"shipp_state\": \"\",\n \"shipping_price\": \"\",\n \"shipping_tax\": \"\",\n \"store_id\": \"\",\n \"subtotal_price\": \"\",\n \"tags\": \"\",\n \"tax_price\": \"\",\n \"total_paid\": \"\",\n \"total_price\": \"\",\n \"total_weight\": 0,\n \"transaction_id\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"admin_comment\": \"\",\n \"admin_private_comment\": \"\",\n \"bill_address_1\": \"\",\n \"bill_address_2\": \"\",\n \"bill_city\": \"\",\n \"bill_company\": \"\",\n \"bill_country\": \"\",\n \"bill_fax\": \"\",\n \"bill_first_name\": \"\",\n \"bill_last_name\": \"\",\n \"bill_phone\": \"\",\n \"bill_postcode\": \"\",\n \"bill_state\": \"\",\n \"channel_id\": \"\",\n \"clear_cache\": false,\n \"comment\": \"\",\n \"coupon_discount\": \"\",\n \"coupons\": [],\n \"create_invoice\": false,\n \"currency\": \"\",\n \"customer_birthday\": \"\",\n \"customer_email\": \"\",\n \"customer_fax\": \"\",\n \"customer_first_name\": \"\",\n \"customer_last_name\": \"\",\n \"customer_phone\": \"\",\n \"date\": \"\",\n \"date_finished\": \"\",\n \"date_modified\": \"\",\n \"discount\": \"\",\n \"external_source\": \"\",\n \"financial_status\": \"\",\n \"fulfillment_status\": \"\",\n \"gift_certificate_discount\": \"\",\n \"id\": \"\",\n \"inventory_behaviour\": \"\",\n \"note_attributes\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"order_id\": \"\",\n \"order_item\": [\n {\n \"order_item_allow_refund_items_separately\": false,\n \"order_item_allow_ship_items_separately\": false,\n \"order_item_id\": \"\",\n \"order_item_model\": \"\",\n \"order_item_name\": \"\",\n \"order_item_option\": [\n {\n \"order_item_option_name\": \"\",\n \"order_item_option_price\": \"\",\n \"order_item_option_value\": \"\"\n }\n ],\n \"order_item_parent\": 0,\n \"order_item_parent_option_name\": \"\",\n \"order_item_price\": \"\",\n \"order_item_price_includes_tax\": false,\n \"order_item_property\": [\n {\n \"order_item_property_name\": \"\",\n \"order_item_property_value\": \"\"\n }\n ],\n \"order_item_quantity\": 0,\n \"order_item_tax\": \"\",\n \"order_item_variant_id\": \"\",\n \"order_item_weight\": \"\"\n }\n ],\n \"order_payment_method\": \"\",\n \"order_shipping_method\": \"\",\n \"order_status\": \"\",\n \"prices_inc_tax\": false,\n \"send_admin_notifications\": false,\n \"send_notifications\": false,\n \"shipp_address_1\": \"\",\n \"shipp_address_2\": \"\",\n \"shipp_city\": \"\",\n \"shipp_company\": \"\",\n \"shipp_country\": \"\",\n \"shipp_fax\": \"\",\n \"shipp_first_name\": \"\",\n \"shipp_last_name\": \"\",\n \"shipp_phone\": \"\",\n \"shipp_postcode\": \"\",\n \"shipp_state\": \"\",\n \"shipping_price\": \"\",\n \"shipping_tax\": \"\",\n \"store_id\": \"\",\n \"subtotal_price\": \"\",\n \"tags\": \"\",\n \"tax_price\": \"\",\n \"total_paid\": \"\",\n \"total_price\": \"\",\n \"total_weight\": 0,\n \"transaction_id\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/order.add.json")
.post(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/order.add.json")
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"admin_comment\": \"\",\n \"admin_private_comment\": \"\",\n \"bill_address_1\": \"\",\n \"bill_address_2\": \"\",\n \"bill_city\": \"\",\n \"bill_company\": \"\",\n \"bill_country\": \"\",\n \"bill_fax\": \"\",\n \"bill_first_name\": \"\",\n \"bill_last_name\": \"\",\n \"bill_phone\": \"\",\n \"bill_postcode\": \"\",\n \"bill_state\": \"\",\n \"channel_id\": \"\",\n \"clear_cache\": false,\n \"comment\": \"\",\n \"coupon_discount\": \"\",\n \"coupons\": [],\n \"create_invoice\": false,\n \"currency\": \"\",\n \"customer_birthday\": \"\",\n \"customer_email\": \"\",\n \"customer_fax\": \"\",\n \"customer_first_name\": \"\",\n \"customer_last_name\": \"\",\n \"customer_phone\": \"\",\n \"date\": \"\",\n \"date_finished\": \"\",\n \"date_modified\": \"\",\n \"discount\": \"\",\n \"external_source\": \"\",\n \"financial_status\": \"\",\n \"fulfillment_status\": \"\",\n \"gift_certificate_discount\": \"\",\n \"id\": \"\",\n \"inventory_behaviour\": \"\",\n \"note_attributes\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"order_id\": \"\",\n \"order_item\": [\n {\n \"order_item_allow_refund_items_separately\": false,\n \"order_item_allow_ship_items_separately\": false,\n \"order_item_id\": \"\",\n \"order_item_model\": \"\",\n \"order_item_name\": \"\",\n \"order_item_option\": [\n {\n \"order_item_option_name\": \"\",\n \"order_item_option_price\": \"\",\n \"order_item_option_value\": \"\"\n }\n ],\n \"order_item_parent\": 0,\n \"order_item_parent_option_name\": \"\",\n \"order_item_price\": \"\",\n \"order_item_price_includes_tax\": false,\n \"order_item_property\": [\n {\n \"order_item_property_name\": \"\",\n \"order_item_property_value\": \"\"\n }\n ],\n \"order_item_quantity\": 0,\n \"order_item_tax\": \"\",\n \"order_item_variant_id\": \"\",\n \"order_item_weight\": \"\"\n }\n ],\n \"order_payment_method\": \"\",\n \"order_shipping_method\": \"\",\n \"order_status\": \"\",\n \"prices_inc_tax\": false,\n \"send_admin_notifications\": false,\n \"send_notifications\": false,\n \"shipp_address_1\": \"\",\n \"shipp_address_2\": \"\",\n \"shipp_city\": \"\",\n \"shipp_company\": \"\",\n \"shipp_country\": \"\",\n \"shipp_fax\": \"\",\n \"shipp_first_name\": \"\",\n \"shipp_last_name\": \"\",\n \"shipp_phone\": \"\",\n \"shipp_postcode\": \"\",\n \"shipp_state\": \"\",\n \"shipping_price\": \"\",\n \"shipping_tax\": \"\",\n \"store_id\": \"\",\n \"subtotal_price\": \"\",\n \"tags\": \"\",\n \"tax_price\": \"\",\n \"total_paid\": \"\",\n \"total_price\": \"\",\n \"total_weight\": 0,\n \"transaction_id\": \"\"\n}")
.asString();
const data = JSON.stringify({
admin_comment: '',
admin_private_comment: '',
bill_address_1: '',
bill_address_2: '',
bill_city: '',
bill_company: '',
bill_country: '',
bill_fax: '',
bill_first_name: '',
bill_last_name: '',
bill_phone: '',
bill_postcode: '',
bill_state: '',
channel_id: '',
clear_cache: false,
comment: '',
coupon_discount: '',
coupons: [],
create_invoice: false,
currency: '',
customer_birthday: '',
customer_email: '',
customer_fax: '',
customer_first_name: '',
customer_last_name: '',
customer_phone: '',
date: '',
date_finished: '',
date_modified: '',
discount: '',
external_source: '',
financial_status: '',
fulfillment_status: '',
gift_certificate_discount: '',
id: '',
inventory_behaviour: '',
note_attributes: [
{
name: '',
value: ''
}
],
order_id: '',
order_item: [
{
order_item_allow_refund_items_separately: false,
order_item_allow_ship_items_separately: false,
order_item_id: '',
order_item_model: '',
order_item_name: '',
order_item_option: [
{
order_item_option_name: '',
order_item_option_price: '',
order_item_option_value: ''
}
],
order_item_parent: 0,
order_item_parent_option_name: '',
order_item_price: '',
order_item_price_includes_tax: false,
order_item_property: [
{
order_item_property_name: '',
order_item_property_value: ''
}
],
order_item_quantity: 0,
order_item_tax: '',
order_item_variant_id: '',
order_item_weight: ''
}
],
order_payment_method: '',
order_shipping_method: '',
order_status: '',
prices_inc_tax: false,
send_admin_notifications: false,
send_notifications: false,
shipp_address_1: '',
shipp_address_2: '',
shipp_city: '',
shipp_company: '',
shipp_country: '',
shipp_fax: '',
shipp_first_name: '',
shipp_last_name: '',
shipp_phone: '',
shipp_postcode: '',
shipp_state: '',
shipping_price: '',
shipping_tax: '',
store_id: '',
subtotal_price: '',
tags: '',
tax_price: '',
total_paid: '',
total_price: '',
total_weight: 0,
transaction_id: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/order.add.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/order.add.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {
admin_comment: '',
admin_private_comment: '',
bill_address_1: '',
bill_address_2: '',
bill_city: '',
bill_company: '',
bill_country: '',
bill_fax: '',
bill_first_name: '',
bill_last_name: '',
bill_phone: '',
bill_postcode: '',
bill_state: '',
channel_id: '',
clear_cache: false,
comment: '',
coupon_discount: '',
coupons: [],
create_invoice: false,
currency: '',
customer_birthday: '',
customer_email: '',
customer_fax: '',
customer_first_name: '',
customer_last_name: '',
customer_phone: '',
date: '',
date_finished: '',
date_modified: '',
discount: '',
external_source: '',
financial_status: '',
fulfillment_status: '',
gift_certificate_discount: '',
id: '',
inventory_behaviour: '',
note_attributes: [{name: '', value: ''}],
order_id: '',
order_item: [
{
order_item_allow_refund_items_separately: false,
order_item_allow_ship_items_separately: false,
order_item_id: '',
order_item_model: '',
order_item_name: '',
order_item_option: [
{
order_item_option_name: '',
order_item_option_price: '',
order_item_option_value: ''
}
],
order_item_parent: 0,
order_item_parent_option_name: '',
order_item_price: '',
order_item_price_includes_tax: false,
order_item_property: [{order_item_property_name: '', order_item_property_value: ''}],
order_item_quantity: 0,
order_item_tax: '',
order_item_variant_id: '',
order_item_weight: ''
}
],
order_payment_method: '',
order_shipping_method: '',
order_status: '',
prices_inc_tax: false,
send_admin_notifications: false,
send_notifications: false,
shipp_address_1: '',
shipp_address_2: '',
shipp_city: '',
shipp_company: '',
shipp_country: '',
shipp_fax: '',
shipp_first_name: '',
shipp_last_name: '',
shipp_phone: '',
shipp_postcode: '',
shipp_state: '',
shipping_price: '',
shipping_tax: '',
store_id: '',
subtotal_price: '',
tags: '',
tax_price: '',
total_paid: '',
total_price: '',
total_weight: 0,
transaction_id: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/order.add.json';
const options = {
method: 'POST',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"admin_comment":"","admin_private_comment":"","bill_address_1":"","bill_address_2":"","bill_city":"","bill_company":"","bill_country":"","bill_fax":"","bill_first_name":"","bill_last_name":"","bill_phone":"","bill_postcode":"","bill_state":"","channel_id":"","clear_cache":false,"comment":"","coupon_discount":"","coupons":[],"create_invoice":false,"currency":"","customer_birthday":"","customer_email":"","customer_fax":"","customer_first_name":"","customer_last_name":"","customer_phone":"","date":"","date_finished":"","date_modified":"","discount":"","external_source":"","financial_status":"","fulfillment_status":"","gift_certificate_discount":"","id":"","inventory_behaviour":"","note_attributes":[{"name":"","value":""}],"order_id":"","order_item":[{"order_item_allow_refund_items_separately":false,"order_item_allow_ship_items_separately":false,"order_item_id":"","order_item_model":"","order_item_name":"","order_item_option":[{"order_item_option_name":"","order_item_option_price":"","order_item_option_value":""}],"order_item_parent":0,"order_item_parent_option_name":"","order_item_price":"","order_item_price_includes_tax":false,"order_item_property":[{"order_item_property_name":"","order_item_property_value":""}],"order_item_quantity":0,"order_item_tax":"","order_item_variant_id":"","order_item_weight":""}],"order_payment_method":"","order_shipping_method":"","order_status":"","prices_inc_tax":false,"send_admin_notifications":false,"send_notifications":false,"shipp_address_1":"","shipp_address_2":"","shipp_city":"","shipp_company":"","shipp_country":"","shipp_fax":"","shipp_first_name":"","shipp_last_name":"","shipp_phone":"","shipp_postcode":"","shipp_state":"","shipping_price":"","shipping_tax":"","store_id":"","subtotal_price":"","tags":"","tax_price":"","total_paid":"","total_price":"","total_weight":0,"transaction_id":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/order.add.json',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "admin_comment": "",\n "admin_private_comment": "",\n "bill_address_1": "",\n "bill_address_2": "",\n "bill_city": "",\n "bill_company": "",\n "bill_country": "",\n "bill_fax": "",\n "bill_first_name": "",\n "bill_last_name": "",\n "bill_phone": "",\n "bill_postcode": "",\n "bill_state": "",\n "channel_id": "",\n "clear_cache": false,\n "comment": "",\n "coupon_discount": "",\n "coupons": [],\n "create_invoice": false,\n "currency": "",\n "customer_birthday": "",\n "customer_email": "",\n "customer_fax": "",\n "customer_first_name": "",\n "customer_last_name": "",\n "customer_phone": "",\n "date": "",\n "date_finished": "",\n "date_modified": "",\n "discount": "",\n "external_source": "",\n "financial_status": "",\n "fulfillment_status": "",\n "gift_certificate_discount": "",\n "id": "",\n "inventory_behaviour": "",\n "note_attributes": [\n {\n "name": "",\n "value": ""\n }\n ],\n "order_id": "",\n "order_item": [\n {\n "order_item_allow_refund_items_separately": false,\n "order_item_allow_ship_items_separately": false,\n "order_item_id": "",\n "order_item_model": "",\n "order_item_name": "",\n "order_item_option": [\n {\n "order_item_option_name": "",\n "order_item_option_price": "",\n "order_item_option_value": ""\n }\n ],\n "order_item_parent": 0,\n "order_item_parent_option_name": "",\n "order_item_price": "",\n "order_item_price_includes_tax": false,\n "order_item_property": [\n {\n "order_item_property_name": "",\n "order_item_property_value": ""\n }\n ],\n "order_item_quantity": 0,\n "order_item_tax": "",\n "order_item_variant_id": "",\n "order_item_weight": ""\n }\n ],\n "order_payment_method": "",\n "order_shipping_method": "",\n "order_status": "",\n "prices_inc_tax": false,\n "send_admin_notifications": false,\n "send_notifications": false,\n "shipp_address_1": "",\n "shipp_address_2": "",\n "shipp_city": "",\n "shipp_company": "",\n "shipp_country": "",\n "shipp_fax": "",\n "shipp_first_name": "",\n "shipp_last_name": "",\n "shipp_phone": "",\n "shipp_postcode": "",\n "shipp_state": "",\n "shipping_price": "",\n "shipping_tax": "",\n "store_id": "",\n "subtotal_price": "",\n "tags": "",\n "tax_price": "",\n "total_paid": "",\n "total_price": "",\n "total_weight": 0,\n "transaction_id": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"admin_comment\": \"\",\n \"admin_private_comment\": \"\",\n \"bill_address_1\": \"\",\n \"bill_address_2\": \"\",\n \"bill_city\": \"\",\n \"bill_company\": \"\",\n \"bill_country\": \"\",\n \"bill_fax\": \"\",\n \"bill_first_name\": \"\",\n \"bill_last_name\": \"\",\n \"bill_phone\": \"\",\n \"bill_postcode\": \"\",\n \"bill_state\": \"\",\n \"channel_id\": \"\",\n \"clear_cache\": false,\n \"comment\": \"\",\n \"coupon_discount\": \"\",\n \"coupons\": [],\n \"create_invoice\": false,\n \"currency\": \"\",\n \"customer_birthday\": \"\",\n \"customer_email\": \"\",\n \"customer_fax\": \"\",\n \"customer_first_name\": \"\",\n \"customer_last_name\": \"\",\n \"customer_phone\": \"\",\n \"date\": \"\",\n \"date_finished\": \"\",\n \"date_modified\": \"\",\n \"discount\": \"\",\n \"external_source\": \"\",\n \"financial_status\": \"\",\n \"fulfillment_status\": \"\",\n \"gift_certificate_discount\": \"\",\n \"id\": \"\",\n \"inventory_behaviour\": \"\",\n \"note_attributes\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"order_id\": \"\",\n \"order_item\": [\n {\n \"order_item_allow_refund_items_separately\": false,\n \"order_item_allow_ship_items_separately\": false,\n \"order_item_id\": \"\",\n \"order_item_model\": \"\",\n \"order_item_name\": \"\",\n \"order_item_option\": [\n {\n \"order_item_option_name\": \"\",\n \"order_item_option_price\": \"\",\n \"order_item_option_value\": \"\"\n }\n ],\n \"order_item_parent\": 0,\n \"order_item_parent_option_name\": \"\",\n \"order_item_price\": \"\",\n \"order_item_price_includes_tax\": false,\n \"order_item_property\": [\n {\n \"order_item_property_name\": \"\",\n \"order_item_property_value\": \"\"\n }\n ],\n \"order_item_quantity\": 0,\n \"order_item_tax\": \"\",\n \"order_item_variant_id\": \"\",\n \"order_item_weight\": \"\"\n }\n ],\n \"order_payment_method\": \"\",\n \"order_shipping_method\": \"\",\n \"order_status\": \"\",\n \"prices_inc_tax\": false,\n \"send_admin_notifications\": false,\n \"send_notifications\": false,\n \"shipp_address_1\": \"\",\n \"shipp_address_2\": \"\",\n \"shipp_city\": \"\",\n \"shipp_company\": \"\",\n \"shipp_country\": \"\",\n \"shipp_fax\": \"\",\n \"shipp_first_name\": \"\",\n \"shipp_last_name\": \"\",\n \"shipp_phone\": \"\",\n \"shipp_postcode\": \"\",\n \"shipp_state\": \"\",\n \"shipping_price\": \"\",\n \"shipping_tax\": \"\",\n \"store_id\": \"\",\n \"subtotal_price\": \"\",\n \"tags\": \"\",\n \"tax_price\": \"\",\n \"total_paid\": \"\",\n \"total_price\": \"\",\n \"total_weight\": 0,\n \"transaction_id\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/order.add.json")
.post(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/order.add.json',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
admin_comment: '',
admin_private_comment: '',
bill_address_1: '',
bill_address_2: '',
bill_city: '',
bill_company: '',
bill_country: '',
bill_fax: '',
bill_first_name: '',
bill_last_name: '',
bill_phone: '',
bill_postcode: '',
bill_state: '',
channel_id: '',
clear_cache: false,
comment: '',
coupon_discount: '',
coupons: [],
create_invoice: false,
currency: '',
customer_birthday: '',
customer_email: '',
customer_fax: '',
customer_first_name: '',
customer_last_name: '',
customer_phone: '',
date: '',
date_finished: '',
date_modified: '',
discount: '',
external_source: '',
financial_status: '',
fulfillment_status: '',
gift_certificate_discount: '',
id: '',
inventory_behaviour: '',
note_attributes: [{name: '', value: ''}],
order_id: '',
order_item: [
{
order_item_allow_refund_items_separately: false,
order_item_allow_ship_items_separately: false,
order_item_id: '',
order_item_model: '',
order_item_name: '',
order_item_option: [
{
order_item_option_name: '',
order_item_option_price: '',
order_item_option_value: ''
}
],
order_item_parent: 0,
order_item_parent_option_name: '',
order_item_price: '',
order_item_price_includes_tax: false,
order_item_property: [{order_item_property_name: '', order_item_property_value: ''}],
order_item_quantity: 0,
order_item_tax: '',
order_item_variant_id: '',
order_item_weight: ''
}
],
order_payment_method: '',
order_shipping_method: '',
order_status: '',
prices_inc_tax: false,
send_admin_notifications: false,
send_notifications: false,
shipp_address_1: '',
shipp_address_2: '',
shipp_city: '',
shipp_company: '',
shipp_country: '',
shipp_fax: '',
shipp_first_name: '',
shipp_last_name: '',
shipp_phone: '',
shipp_postcode: '',
shipp_state: '',
shipping_price: '',
shipping_tax: '',
store_id: '',
subtotal_price: '',
tags: '',
tax_price: '',
total_paid: '',
total_price: '',
total_weight: 0,
transaction_id: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/order.add.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: {
admin_comment: '',
admin_private_comment: '',
bill_address_1: '',
bill_address_2: '',
bill_city: '',
bill_company: '',
bill_country: '',
bill_fax: '',
bill_first_name: '',
bill_last_name: '',
bill_phone: '',
bill_postcode: '',
bill_state: '',
channel_id: '',
clear_cache: false,
comment: '',
coupon_discount: '',
coupons: [],
create_invoice: false,
currency: '',
customer_birthday: '',
customer_email: '',
customer_fax: '',
customer_first_name: '',
customer_last_name: '',
customer_phone: '',
date: '',
date_finished: '',
date_modified: '',
discount: '',
external_source: '',
financial_status: '',
fulfillment_status: '',
gift_certificate_discount: '',
id: '',
inventory_behaviour: '',
note_attributes: [{name: '', value: ''}],
order_id: '',
order_item: [
{
order_item_allow_refund_items_separately: false,
order_item_allow_ship_items_separately: false,
order_item_id: '',
order_item_model: '',
order_item_name: '',
order_item_option: [
{
order_item_option_name: '',
order_item_option_price: '',
order_item_option_value: ''
}
],
order_item_parent: 0,
order_item_parent_option_name: '',
order_item_price: '',
order_item_price_includes_tax: false,
order_item_property: [{order_item_property_name: '', order_item_property_value: ''}],
order_item_quantity: 0,
order_item_tax: '',
order_item_variant_id: '',
order_item_weight: ''
}
],
order_payment_method: '',
order_shipping_method: '',
order_status: '',
prices_inc_tax: false,
send_admin_notifications: false,
send_notifications: false,
shipp_address_1: '',
shipp_address_2: '',
shipp_city: '',
shipp_company: '',
shipp_country: '',
shipp_fax: '',
shipp_first_name: '',
shipp_last_name: '',
shipp_phone: '',
shipp_postcode: '',
shipp_state: '',
shipping_price: '',
shipping_tax: '',
store_id: '',
subtotal_price: '',
tags: '',
tax_price: '',
total_paid: '',
total_price: '',
total_weight: 0,
transaction_id: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/order.add.json');
req.headers({
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
admin_comment: '',
admin_private_comment: '',
bill_address_1: '',
bill_address_2: '',
bill_city: '',
bill_company: '',
bill_country: '',
bill_fax: '',
bill_first_name: '',
bill_last_name: '',
bill_phone: '',
bill_postcode: '',
bill_state: '',
channel_id: '',
clear_cache: false,
comment: '',
coupon_discount: '',
coupons: [],
create_invoice: false,
currency: '',
customer_birthday: '',
customer_email: '',
customer_fax: '',
customer_first_name: '',
customer_last_name: '',
customer_phone: '',
date: '',
date_finished: '',
date_modified: '',
discount: '',
external_source: '',
financial_status: '',
fulfillment_status: '',
gift_certificate_discount: '',
id: '',
inventory_behaviour: '',
note_attributes: [
{
name: '',
value: ''
}
],
order_id: '',
order_item: [
{
order_item_allow_refund_items_separately: false,
order_item_allow_ship_items_separately: false,
order_item_id: '',
order_item_model: '',
order_item_name: '',
order_item_option: [
{
order_item_option_name: '',
order_item_option_price: '',
order_item_option_value: ''
}
],
order_item_parent: 0,
order_item_parent_option_name: '',
order_item_price: '',
order_item_price_includes_tax: false,
order_item_property: [
{
order_item_property_name: '',
order_item_property_value: ''
}
],
order_item_quantity: 0,
order_item_tax: '',
order_item_variant_id: '',
order_item_weight: ''
}
],
order_payment_method: '',
order_shipping_method: '',
order_status: '',
prices_inc_tax: false,
send_admin_notifications: false,
send_notifications: false,
shipp_address_1: '',
shipp_address_2: '',
shipp_city: '',
shipp_company: '',
shipp_country: '',
shipp_fax: '',
shipp_first_name: '',
shipp_last_name: '',
shipp_phone: '',
shipp_postcode: '',
shipp_state: '',
shipping_price: '',
shipping_tax: '',
store_id: '',
subtotal_price: '',
tags: '',
tax_price: '',
total_paid: '',
total_price: '',
total_weight: 0,
transaction_id: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/order.add.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {
admin_comment: '',
admin_private_comment: '',
bill_address_1: '',
bill_address_2: '',
bill_city: '',
bill_company: '',
bill_country: '',
bill_fax: '',
bill_first_name: '',
bill_last_name: '',
bill_phone: '',
bill_postcode: '',
bill_state: '',
channel_id: '',
clear_cache: false,
comment: '',
coupon_discount: '',
coupons: [],
create_invoice: false,
currency: '',
customer_birthday: '',
customer_email: '',
customer_fax: '',
customer_first_name: '',
customer_last_name: '',
customer_phone: '',
date: '',
date_finished: '',
date_modified: '',
discount: '',
external_source: '',
financial_status: '',
fulfillment_status: '',
gift_certificate_discount: '',
id: '',
inventory_behaviour: '',
note_attributes: [{name: '', value: ''}],
order_id: '',
order_item: [
{
order_item_allow_refund_items_separately: false,
order_item_allow_ship_items_separately: false,
order_item_id: '',
order_item_model: '',
order_item_name: '',
order_item_option: [
{
order_item_option_name: '',
order_item_option_price: '',
order_item_option_value: ''
}
],
order_item_parent: 0,
order_item_parent_option_name: '',
order_item_price: '',
order_item_price_includes_tax: false,
order_item_property: [{order_item_property_name: '', order_item_property_value: ''}],
order_item_quantity: 0,
order_item_tax: '',
order_item_variant_id: '',
order_item_weight: ''
}
],
order_payment_method: '',
order_shipping_method: '',
order_status: '',
prices_inc_tax: false,
send_admin_notifications: false,
send_notifications: false,
shipp_address_1: '',
shipp_address_2: '',
shipp_city: '',
shipp_company: '',
shipp_country: '',
shipp_fax: '',
shipp_first_name: '',
shipp_last_name: '',
shipp_phone: '',
shipp_postcode: '',
shipp_state: '',
shipping_price: '',
shipping_tax: '',
store_id: '',
subtotal_price: '',
tags: '',
tax_price: '',
total_paid: '',
total_price: '',
total_weight: 0,
transaction_id: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/order.add.json';
const options = {
method: 'POST',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"admin_comment":"","admin_private_comment":"","bill_address_1":"","bill_address_2":"","bill_city":"","bill_company":"","bill_country":"","bill_fax":"","bill_first_name":"","bill_last_name":"","bill_phone":"","bill_postcode":"","bill_state":"","channel_id":"","clear_cache":false,"comment":"","coupon_discount":"","coupons":[],"create_invoice":false,"currency":"","customer_birthday":"","customer_email":"","customer_fax":"","customer_first_name":"","customer_last_name":"","customer_phone":"","date":"","date_finished":"","date_modified":"","discount":"","external_source":"","financial_status":"","fulfillment_status":"","gift_certificate_discount":"","id":"","inventory_behaviour":"","note_attributes":[{"name":"","value":""}],"order_id":"","order_item":[{"order_item_allow_refund_items_separately":false,"order_item_allow_ship_items_separately":false,"order_item_id":"","order_item_model":"","order_item_name":"","order_item_option":[{"order_item_option_name":"","order_item_option_price":"","order_item_option_value":""}],"order_item_parent":0,"order_item_parent_option_name":"","order_item_price":"","order_item_price_includes_tax":false,"order_item_property":[{"order_item_property_name":"","order_item_property_value":""}],"order_item_quantity":0,"order_item_tax":"","order_item_variant_id":"","order_item_weight":""}],"order_payment_method":"","order_shipping_method":"","order_status":"","prices_inc_tax":false,"send_admin_notifications":false,"send_notifications":false,"shipp_address_1":"","shipp_address_2":"","shipp_city":"","shipp_company":"","shipp_country":"","shipp_fax":"","shipp_first_name":"","shipp_last_name":"","shipp_phone":"","shipp_postcode":"","shipp_state":"","shipping_price":"","shipping_tax":"","store_id":"","subtotal_price":"","tags":"","tax_price":"","total_paid":"","total_price":"","total_weight":0,"transaction_id":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"admin_comment": @"",
@"admin_private_comment": @"",
@"bill_address_1": @"",
@"bill_address_2": @"",
@"bill_city": @"",
@"bill_company": @"",
@"bill_country": @"",
@"bill_fax": @"",
@"bill_first_name": @"",
@"bill_last_name": @"",
@"bill_phone": @"",
@"bill_postcode": @"",
@"bill_state": @"",
@"channel_id": @"",
@"clear_cache": @NO,
@"comment": @"",
@"coupon_discount": @"",
@"coupons": @[ ],
@"create_invoice": @NO,
@"currency": @"",
@"customer_birthday": @"",
@"customer_email": @"",
@"customer_fax": @"",
@"customer_first_name": @"",
@"customer_last_name": @"",
@"customer_phone": @"",
@"date": @"",
@"date_finished": @"",
@"date_modified": @"",
@"discount": @"",
@"external_source": @"",
@"financial_status": @"",
@"fulfillment_status": @"",
@"gift_certificate_discount": @"",
@"id": @"",
@"inventory_behaviour": @"",
@"note_attributes": @[ @{ @"name": @"", @"value": @"" } ],
@"order_id": @"",
@"order_item": @[ @{ @"order_item_allow_refund_items_separately": @NO, @"order_item_allow_ship_items_separately": @NO, @"order_item_id": @"", @"order_item_model": @"", @"order_item_name": @"", @"order_item_option": @[ @{ @"order_item_option_name": @"", @"order_item_option_price": @"", @"order_item_option_value": @"" } ], @"order_item_parent": @0, @"order_item_parent_option_name": @"", @"order_item_price": @"", @"order_item_price_includes_tax": @NO, @"order_item_property": @[ @{ @"order_item_property_name": @"", @"order_item_property_value": @"" } ], @"order_item_quantity": @0, @"order_item_tax": @"", @"order_item_variant_id": @"", @"order_item_weight": @"" } ],
@"order_payment_method": @"",
@"order_shipping_method": @"",
@"order_status": @"",
@"prices_inc_tax": @NO,
@"send_admin_notifications": @NO,
@"send_notifications": @NO,
@"shipp_address_1": @"",
@"shipp_address_2": @"",
@"shipp_city": @"",
@"shipp_company": @"",
@"shipp_country": @"",
@"shipp_fax": @"",
@"shipp_first_name": @"",
@"shipp_last_name": @"",
@"shipp_phone": @"",
@"shipp_postcode": @"",
@"shipp_state": @"",
@"shipping_price": @"",
@"shipping_tax": @"",
@"store_id": @"",
@"subtotal_price": @"",
@"tags": @"",
@"tax_price": @"",
@"total_paid": @"",
@"total_price": @"",
@"total_weight": @0,
@"transaction_id": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/order.add.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/order.add.json" in
let headers = Header.add_list (Header.init ()) [
("x-api-key", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"admin_comment\": \"\",\n \"admin_private_comment\": \"\",\n \"bill_address_1\": \"\",\n \"bill_address_2\": \"\",\n \"bill_city\": \"\",\n \"bill_company\": \"\",\n \"bill_country\": \"\",\n \"bill_fax\": \"\",\n \"bill_first_name\": \"\",\n \"bill_last_name\": \"\",\n \"bill_phone\": \"\",\n \"bill_postcode\": \"\",\n \"bill_state\": \"\",\n \"channel_id\": \"\",\n \"clear_cache\": false,\n \"comment\": \"\",\n \"coupon_discount\": \"\",\n \"coupons\": [],\n \"create_invoice\": false,\n \"currency\": \"\",\n \"customer_birthday\": \"\",\n \"customer_email\": \"\",\n \"customer_fax\": \"\",\n \"customer_first_name\": \"\",\n \"customer_last_name\": \"\",\n \"customer_phone\": \"\",\n \"date\": \"\",\n \"date_finished\": \"\",\n \"date_modified\": \"\",\n \"discount\": \"\",\n \"external_source\": \"\",\n \"financial_status\": \"\",\n \"fulfillment_status\": \"\",\n \"gift_certificate_discount\": \"\",\n \"id\": \"\",\n \"inventory_behaviour\": \"\",\n \"note_attributes\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"order_id\": \"\",\n \"order_item\": [\n {\n \"order_item_allow_refund_items_separately\": false,\n \"order_item_allow_ship_items_separately\": false,\n \"order_item_id\": \"\",\n \"order_item_model\": \"\",\n \"order_item_name\": \"\",\n \"order_item_option\": [\n {\n \"order_item_option_name\": \"\",\n \"order_item_option_price\": \"\",\n \"order_item_option_value\": \"\"\n }\n ],\n \"order_item_parent\": 0,\n \"order_item_parent_option_name\": \"\",\n \"order_item_price\": \"\",\n \"order_item_price_includes_tax\": false,\n \"order_item_property\": [\n {\n \"order_item_property_name\": \"\",\n \"order_item_property_value\": \"\"\n }\n ],\n \"order_item_quantity\": 0,\n \"order_item_tax\": \"\",\n \"order_item_variant_id\": \"\",\n \"order_item_weight\": \"\"\n }\n ],\n \"order_payment_method\": \"\",\n \"order_shipping_method\": \"\",\n \"order_status\": \"\",\n \"prices_inc_tax\": false,\n \"send_admin_notifications\": false,\n \"send_notifications\": false,\n \"shipp_address_1\": \"\",\n \"shipp_address_2\": \"\",\n \"shipp_city\": \"\",\n \"shipp_company\": \"\",\n \"shipp_country\": \"\",\n \"shipp_fax\": \"\",\n \"shipp_first_name\": \"\",\n \"shipp_last_name\": \"\",\n \"shipp_phone\": \"\",\n \"shipp_postcode\": \"\",\n \"shipp_state\": \"\",\n \"shipping_price\": \"\",\n \"shipping_tax\": \"\",\n \"store_id\": \"\",\n \"subtotal_price\": \"\",\n \"tags\": \"\",\n \"tax_price\": \"\",\n \"total_paid\": \"\",\n \"total_price\": \"\",\n \"total_weight\": 0,\n \"transaction_id\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/order.add.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'admin_comment' => '',
'admin_private_comment' => '',
'bill_address_1' => '',
'bill_address_2' => '',
'bill_city' => '',
'bill_company' => '',
'bill_country' => '',
'bill_fax' => '',
'bill_first_name' => '',
'bill_last_name' => '',
'bill_phone' => '',
'bill_postcode' => '',
'bill_state' => '',
'channel_id' => '',
'clear_cache' => null,
'comment' => '',
'coupon_discount' => '',
'coupons' => [
],
'create_invoice' => null,
'currency' => '',
'customer_birthday' => '',
'customer_email' => '',
'customer_fax' => '',
'customer_first_name' => '',
'customer_last_name' => '',
'customer_phone' => '',
'date' => '',
'date_finished' => '',
'date_modified' => '',
'discount' => '',
'external_source' => '',
'financial_status' => '',
'fulfillment_status' => '',
'gift_certificate_discount' => '',
'id' => '',
'inventory_behaviour' => '',
'note_attributes' => [
[
'name' => '',
'value' => ''
]
],
'order_id' => '',
'order_item' => [
[
'order_item_allow_refund_items_separately' => null,
'order_item_allow_ship_items_separately' => null,
'order_item_id' => '',
'order_item_model' => '',
'order_item_name' => '',
'order_item_option' => [
[
'order_item_option_name' => '',
'order_item_option_price' => '',
'order_item_option_value' => ''
]
],
'order_item_parent' => 0,
'order_item_parent_option_name' => '',
'order_item_price' => '',
'order_item_price_includes_tax' => null,
'order_item_property' => [
[
'order_item_property_name' => '',
'order_item_property_value' => ''
]
],
'order_item_quantity' => 0,
'order_item_tax' => '',
'order_item_variant_id' => '',
'order_item_weight' => ''
]
],
'order_payment_method' => '',
'order_shipping_method' => '',
'order_status' => '',
'prices_inc_tax' => null,
'send_admin_notifications' => null,
'send_notifications' => null,
'shipp_address_1' => '',
'shipp_address_2' => '',
'shipp_city' => '',
'shipp_company' => '',
'shipp_country' => '',
'shipp_fax' => '',
'shipp_first_name' => '',
'shipp_last_name' => '',
'shipp_phone' => '',
'shipp_postcode' => '',
'shipp_state' => '',
'shipping_price' => '',
'shipping_tax' => '',
'store_id' => '',
'subtotal_price' => '',
'tags' => '',
'tax_price' => '',
'total_paid' => '',
'total_price' => '',
'total_weight' => 0,
'transaction_id' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/order.add.json', [
'body' => '{
"admin_comment": "",
"admin_private_comment": "",
"bill_address_1": "",
"bill_address_2": "",
"bill_city": "",
"bill_company": "",
"bill_country": "",
"bill_fax": "",
"bill_first_name": "",
"bill_last_name": "",
"bill_phone": "",
"bill_postcode": "",
"bill_state": "",
"channel_id": "",
"clear_cache": false,
"comment": "",
"coupon_discount": "",
"coupons": [],
"create_invoice": false,
"currency": "",
"customer_birthday": "",
"customer_email": "",
"customer_fax": "",
"customer_first_name": "",
"customer_last_name": "",
"customer_phone": "",
"date": "",
"date_finished": "",
"date_modified": "",
"discount": "",
"external_source": "",
"financial_status": "",
"fulfillment_status": "",
"gift_certificate_discount": "",
"id": "",
"inventory_behaviour": "",
"note_attributes": [
{
"name": "",
"value": ""
}
],
"order_id": "",
"order_item": [
{
"order_item_allow_refund_items_separately": false,
"order_item_allow_ship_items_separately": false,
"order_item_id": "",
"order_item_model": "",
"order_item_name": "",
"order_item_option": [
{
"order_item_option_name": "",
"order_item_option_price": "",
"order_item_option_value": ""
}
],
"order_item_parent": 0,
"order_item_parent_option_name": "",
"order_item_price": "",
"order_item_price_includes_tax": false,
"order_item_property": [
{
"order_item_property_name": "",
"order_item_property_value": ""
}
],
"order_item_quantity": 0,
"order_item_tax": "",
"order_item_variant_id": "",
"order_item_weight": ""
}
],
"order_payment_method": "",
"order_shipping_method": "",
"order_status": "",
"prices_inc_tax": false,
"send_admin_notifications": false,
"send_notifications": false,
"shipp_address_1": "",
"shipp_address_2": "",
"shipp_city": "",
"shipp_company": "",
"shipp_country": "",
"shipp_fax": "",
"shipp_first_name": "",
"shipp_last_name": "",
"shipp_phone": "",
"shipp_postcode": "",
"shipp_state": "",
"shipping_price": "",
"shipping_tax": "",
"store_id": "",
"subtotal_price": "",
"tags": "",
"tax_price": "",
"total_paid": "",
"total_price": "",
"total_weight": 0,
"transaction_id": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/order.add.json');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'admin_comment' => '',
'admin_private_comment' => '',
'bill_address_1' => '',
'bill_address_2' => '',
'bill_city' => '',
'bill_company' => '',
'bill_country' => '',
'bill_fax' => '',
'bill_first_name' => '',
'bill_last_name' => '',
'bill_phone' => '',
'bill_postcode' => '',
'bill_state' => '',
'channel_id' => '',
'clear_cache' => null,
'comment' => '',
'coupon_discount' => '',
'coupons' => [
],
'create_invoice' => null,
'currency' => '',
'customer_birthday' => '',
'customer_email' => '',
'customer_fax' => '',
'customer_first_name' => '',
'customer_last_name' => '',
'customer_phone' => '',
'date' => '',
'date_finished' => '',
'date_modified' => '',
'discount' => '',
'external_source' => '',
'financial_status' => '',
'fulfillment_status' => '',
'gift_certificate_discount' => '',
'id' => '',
'inventory_behaviour' => '',
'note_attributes' => [
[
'name' => '',
'value' => ''
]
],
'order_id' => '',
'order_item' => [
[
'order_item_allow_refund_items_separately' => null,
'order_item_allow_ship_items_separately' => null,
'order_item_id' => '',
'order_item_model' => '',
'order_item_name' => '',
'order_item_option' => [
[
'order_item_option_name' => '',
'order_item_option_price' => '',
'order_item_option_value' => ''
]
],
'order_item_parent' => 0,
'order_item_parent_option_name' => '',
'order_item_price' => '',
'order_item_price_includes_tax' => null,
'order_item_property' => [
[
'order_item_property_name' => '',
'order_item_property_value' => ''
]
],
'order_item_quantity' => 0,
'order_item_tax' => '',
'order_item_variant_id' => '',
'order_item_weight' => ''
]
],
'order_payment_method' => '',
'order_shipping_method' => '',
'order_status' => '',
'prices_inc_tax' => null,
'send_admin_notifications' => null,
'send_notifications' => null,
'shipp_address_1' => '',
'shipp_address_2' => '',
'shipp_city' => '',
'shipp_company' => '',
'shipp_country' => '',
'shipp_fax' => '',
'shipp_first_name' => '',
'shipp_last_name' => '',
'shipp_phone' => '',
'shipp_postcode' => '',
'shipp_state' => '',
'shipping_price' => '',
'shipping_tax' => '',
'store_id' => '',
'subtotal_price' => '',
'tags' => '',
'tax_price' => '',
'total_paid' => '',
'total_price' => '',
'total_weight' => 0,
'transaction_id' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'admin_comment' => '',
'admin_private_comment' => '',
'bill_address_1' => '',
'bill_address_2' => '',
'bill_city' => '',
'bill_company' => '',
'bill_country' => '',
'bill_fax' => '',
'bill_first_name' => '',
'bill_last_name' => '',
'bill_phone' => '',
'bill_postcode' => '',
'bill_state' => '',
'channel_id' => '',
'clear_cache' => null,
'comment' => '',
'coupon_discount' => '',
'coupons' => [
],
'create_invoice' => null,
'currency' => '',
'customer_birthday' => '',
'customer_email' => '',
'customer_fax' => '',
'customer_first_name' => '',
'customer_last_name' => '',
'customer_phone' => '',
'date' => '',
'date_finished' => '',
'date_modified' => '',
'discount' => '',
'external_source' => '',
'financial_status' => '',
'fulfillment_status' => '',
'gift_certificate_discount' => '',
'id' => '',
'inventory_behaviour' => '',
'note_attributes' => [
[
'name' => '',
'value' => ''
]
],
'order_id' => '',
'order_item' => [
[
'order_item_allow_refund_items_separately' => null,
'order_item_allow_ship_items_separately' => null,
'order_item_id' => '',
'order_item_model' => '',
'order_item_name' => '',
'order_item_option' => [
[
'order_item_option_name' => '',
'order_item_option_price' => '',
'order_item_option_value' => ''
]
],
'order_item_parent' => 0,
'order_item_parent_option_name' => '',
'order_item_price' => '',
'order_item_price_includes_tax' => null,
'order_item_property' => [
[
'order_item_property_name' => '',
'order_item_property_value' => ''
]
],
'order_item_quantity' => 0,
'order_item_tax' => '',
'order_item_variant_id' => '',
'order_item_weight' => ''
]
],
'order_payment_method' => '',
'order_shipping_method' => '',
'order_status' => '',
'prices_inc_tax' => null,
'send_admin_notifications' => null,
'send_notifications' => null,
'shipp_address_1' => '',
'shipp_address_2' => '',
'shipp_city' => '',
'shipp_company' => '',
'shipp_country' => '',
'shipp_fax' => '',
'shipp_first_name' => '',
'shipp_last_name' => '',
'shipp_phone' => '',
'shipp_postcode' => '',
'shipp_state' => '',
'shipping_price' => '',
'shipping_tax' => '',
'store_id' => '',
'subtotal_price' => '',
'tags' => '',
'tax_price' => '',
'total_paid' => '',
'total_price' => '',
'total_weight' => 0,
'transaction_id' => ''
]));
$request->setRequestUrl('{{baseUrl}}/order.add.json');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/order.add.json' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"admin_comment": "",
"admin_private_comment": "",
"bill_address_1": "",
"bill_address_2": "",
"bill_city": "",
"bill_company": "",
"bill_country": "",
"bill_fax": "",
"bill_first_name": "",
"bill_last_name": "",
"bill_phone": "",
"bill_postcode": "",
"bill_state": "",
"channel_id": "",
"clear_cache": false,
"comment": "",
"coupon_discount": "",
"coupons": [],
"create_invoice": false,
"currency": "",
"customer_birthday": "",
"customer_email": "",
"customer_fax": "",
"customer_first_name": "",
"customer_last_name": "",
"customer_phone": "",
"date": "",
"date_finished": "",
"date_modified": "",
"discount": "",
"external_source": "",
"financial_status": "",
"fulfillment_status": "",
"gift_certificate_discount": "",
"id": "",
"inventory_behaviour": "",
"note_attributes": [
{
"name": "",
"value": ""
}
],
"order_id": "",
"order_item": [
{
"order_item_allow_refund_items_separately": false,
"order_item_allow_ship_items_separately": false,
"order_item_id": "",
"order_item_model": "",
"order_item_name": "",
"order_item_option": [
{
"order_item_option_name": "",
"order_item_option_price": "",
"order_item_option_value": ""
}
],
"order_item_parent": 0,
"order_item_parent_option_name": "",
"order_item_price": "",
"order_item_price_includes_tax": false,
"order_item_property": [
{
"order_item_property_name": "",
"order_item_property_value": ""
}
],
"order_item_quantity": 0,
"order_item_tax": "",
"order_item_variant_id": "",
"order_item_weight": ""
}
],
"order_payment_method": "",
"order_shipping_method": "",
"order_status": "",
"prices_inc_tax": false,
"send_admin_notifications": false,
"send_notifications": false,
"shipp_address_1": "",
"shipp_address_2": "",
"shipp_city": "",
"shipp_company": "",
"shipp_country": "",
"shipp_fax": "",
"shipp_first_name": "",
"shipp_last_name": "",
"shipp_phone": "",
"shipp_postcode": "",
"shipp_state": "",
"shipping_price": "",
"shipping_tax": "",
"store_id": "",
"subtotal_price": "",
"tags": "",
"tax_price": "",
"total_paid": "",
"total_price": "",
"total_weight": 0,
"transaction_id": ""
}'
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/order.add.json' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"admin_comment": "",
"admin_private_comment": "",
"bill_address_1": "",
"bill_address_2": "",
"bill_city": "",
"bill_company": "",
"bill_country": "",
"bill_fax": "",
"bill_first_name": "",
"bill_last_name": "",
"bill_phone": "",
"bill_postcode": "",
"bill_state": "",
"channel_id": "",
"clear_cache": false,
"comment": "",
"coupon_discount": "",
"coupons": [],
"create_invoice": false,
"currency": "",
"customer_birthday": "",
"customer_email": "",
"customer_fax": "",
"customer_first_name": "",
"customer_last_name": "",
"customer_phone": "",
"date": "",
"date_finished": "",
"date_modified": "",
"discount": "",
"external_source": "",
"financial_status": "",
"fulfillment_status": "",
"gift_certificate_discount": "",
"id": "",
"inventory_behaviour": "",
"note_attributes": [
{
"name": "",
"value": ""
}
],
"order_id": "",
"order_item": [
{
"order_item_allow_refund_items_separately": false,
"order_item_allow_ship_items_separately": false,
"order_item_id": "",
"order_item_model": "",
"order_item_name": "",
"order_item_option": [
{
"order_item_option_name": "",
"order_item_option_price": "",
"order_item_option_value": ""
}
],
"order_item_parent": 0,
"order_item_parent_option_name": "",
"order_item_price": "",
"order_item_price_includes_tax": false,
"order_item_property": [
{
"order_item_property_name": "",
"order_item_property_value": ""
}
],
"order_item_quantity": 0,
"order_item_tax": "",
"order_item_variant_id": "",
"order_item_weight": ""
}
],
"order_payment_method": "",
"order_shipping_method": "",
"order_status": "",
"prices_inc_tax": false,
"send_admin_notifications": false,
"send_notifications": false,
"shipp_address_1": "",
"shipp_address_2": "",
"shipp_city": "",
"shipp_company": "",
"shipp_country": "",
"shipp_fax": "",
"shipp_first_name": "",
"shipp_last_name": "",
"shipp_phone": "",
"shipp_postcode": "",
"shipp_state": "",
"shipping_price": "",
"shipping_tax": "",
"store_id": "",
"subtotal_price": "",
"tags": "",
"tax_price": "",
"total_paid": "",
"total_price": "",
"total_weight": 0,
"transaction_id": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"admin_comment\": \"\",\n \"admin_private_comment\": \"\",\n \"bill_address_1\": \"\",\n \"bill_address_2\": \"\",\n \"bill_city\": \"\",\n \"bill_company\": \"\",\n \"bill_country\": \"\",\n \"bill_fax\": \"\",\n \"bill_first_name\": \"\",\n \"bill_last_name\": \"\",\n \"bill_phone\": \"\",\n \"bill_postcode\": \"\",\n \"bill_state\": \"\",\n \"channel_id\": \"\",\n \"clear_cache\": false,\n \"comment\": \"\",\n \"coupon_discount\": \"\",\n \"coupons\": [],\n \"create_invoice\": false,\n \"currency\": \"\",\n \"customer_birthday\": \"\",\n \"customer_email\": \"\",\n \"customer_fax\": \"\",\n \"customer_first_name\": \"\",\n \"customer_last_name\": \"\",\n \"customer_phone\": \"\",\n \"date\": \"\",\n \"date_finished\": \"\",\n \"date_modified\": \"\",\n \"discount\": \"\",\n \"external_source\": \"\",\n \"financial_status\": \"\",\n \"fulfillment_status\": \"\",\n \"gift_certificate_discount\": \"\",\n \"id\": \"\",\n \"inventory_behaviour\": \"\",\n \"note_attributes\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"order_id\": \"\",\n \"order_item\": [\n {\n \"order_item_allow_refund_items_separately\": false,\n \"order_item_allow_ship_items_separately\": false,\n \"order_item_id\": \"\",\n \"order_item_model\": \"\",\n \"order_item_name\": \"\",\n \"order_item_option\": [\n {\n \"order_item_option_name\": \"\",\n \"order_item_option_price\": \"\",\n \"order_item_option_value\": \"\"\n }\n ],\n \"order_item_parent\": 0,\n \"order_item_parent_option_name\": \"\",\n \"order_item_price\": \"\",\n \"order_item_price_includes_tax\": false,\n \"order_item_property\": [\n {\n \"order_item_property_name\": \"\",\n \"order_item_property_value\": \"\"\n }\n ],\n \"order_item_quantity\": 0,\n \"order_item_tax\": \"\",\n \"order_item_variant_id\": \"\",\n \"order_item_weight\": \"\"\n }\n ],\n \"order_payment_method\": \"\",\n \"order_shipping_method\": \"\",\n \"order_status\": \"\",\n \"prices_inc_tax\": false,\n \"send_admin_notifications\": false,\n \"send_notifications\": false,\n \"shipp_address_1\": \"\",\n \"shipp_address_2\": \"\",\n \"shipp_city\": \"\",\n \"shipp_company\": \"\",\n \"shipp_country\": \"\",\n \"shipp_fax\": \"\",\n \"shipp_first_name\": \"\",\n \"shipp_last_name\": \"\",\n \"shipp_phone\": \"\",\n \"shipp_postcode\": \"\",\n \"shipp_state\": \"\",\n \"shipping_price\": \"\",\n \"shipping_tax\": \"\",\n \"store_id\": \"\",\n \"subtotal_price\": \"\",\n \"tags\": \"\",\n \"tax_price\": \"\",\n \"total_paid\": \"\",\n \"total_price\": \"\",\n \"total_weight\": 0,\n \"transaction_id\": \"\"\n}"
headers = {
'x-api-key': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/order.add.json", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/order.add.json"
payload = {
"admin_comment": "",
"admin_private_comment": "",
"bill_address_1": "",
"bill_address_2": "",
"bill_city": "",
"bill_company": "",
"bill_country": "",
"bill_fax": "",
"bill_first_name": "",
"bill_last_name": "",
"bill_phone": "",
"bill_postcode": "",
"bill_state": "",
"channel_id": "",
"clear_cache": False,
"comment": "",
"coupon_discount": "",
"coupons": [],
"create_invoice": False,
"currency": "",
"customer_birthday": "",
"customer_email": "",
"customer_fax": "",
"customer_first_name": "",
"customer_last_name": "",
"customer_phone": "",
"date": "",
"date_finished": "",
"date_modified": "",
"discount": "",
"external_source": "",
"financial_status": "",
"fulfillment_status": "",
"gift_certificate_discount": "",
"id": "",
"inventory_behaviour": "",
"note_attributes": [
{
"name": "",
"value": ""
}
],
"order_id": "",
"order_item": [
{
"order_item_allow_refund_items_separately": False,
"order_item_allow_ship_items_separately": False,
"order_item_id": "",
"order_item_model": "",
"order_item_name": "",
"order_item_option": [
{
"order_item_option_name": "",
"order_item_option_price": "",
"order_item_option_value": ""
}
],
"order_item_parent": 0,
"order_item_parent_option_name": "",
"order_item_price": "",
"order_item_price_includes_tax": False,
"order_item_property": [
{
"order_item_property_name": "",
"order_item_property_value": ""
}
],
"order_item_quantity": 0,
"order_item_tax": "",
"order_item_variant_id": "",
"order_item_weight": ""
}
],
"order_payment_method": "",
"order_shipping_method": "",
"order_status": "",
"prices_inc_tax": False,
"send_admin_notifications": False,
"send_notifications": False,
"shipp_address_1": "",
"shipp_address_2": "",
"shipp_city": "",
"shipp_company": "",
"shipp_country": "",
"shipp_fax": "",
"shipp_first_name": "",
"shipp_last_name": "",
"shipp_phone": "",
"shipp_postcode": "",
"shipp_state": "",
"shipping_price": "",
"shipping_tax": "",
"store_id": "",
"subtotal_price": "",
"tags": "",
"tax_price": "",
"total_paid": "",
"total_price": "",
"total_weight": 0,
"transaction_id": ""
}
headers = {
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/order.add.json"
payload <- "{\n \"admin_comment\": \"\",\n \"admin_private_comment\": \"\",\n \"bill_address_1\": \"\",\n \"bill_address_2\": \"\",\n \"bill_city\": \"\",\n \"bill_company\": \"\",\n \"bill_country\": \"\",\n \"bill_fax\": \"\",\n \"bill_first_name\": \"\",\n \"bill_last_name\": \"\",\n \"bill_phone\": \"\",\n \"bill_postcode\": \"\",\n \"bill_state\": \"\",\n \"channel_id\": \"\",\n \"clear_cache\": false,\n \"comment\": \"\",\n \"coupon_discount\": \"\",\n \"coupons\": [],\n \"create_invoice\": false,\n \"currency\": \"\",\n \"customer_birthday\": \"\",\n \"customer_email\": \"\",\n \"customer_fax\": \"\",\n \"customer_first_name\": \"\",\n \"customer_last_name\": \"\",\n \"customer_phone\": \"\",\n \"date\": \"\",\n \"date_finished\": \"\",\n \"date_modified\": \"\",\n \"discount\": \"\",\n \"external_source\": \"\",\n \"financial_status\": \"\",\n \"fulfillment_status\": \"\",\n \"gift_certificate_discount\": \"\",\n \"id\": \"\",\n \"inventory_behaviour\": \"\",\n \"note_attributes\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"order_id\": \"\",\n \"order_item\": [\n {\n \"order_item_allow_refund_items_separately\": false,\n \"order_item_allow_ship_items_separately\": false,\n \"order_item_id\": \"\",\n \"order_item_model\": \"\",\n \"order_item_name\": \"\",\n \"order_item_option\": [\n {\n \"order_item_option_name\": \"\",\n \"order_item_option_price\": \"\",\n \"order_item_option_value\": \"\"\n }\n ],\n \"order_item_parent\": 0,\n \"order_item_parent_option_name\": \"\",\n \"order_item_price\": \"\",\n \"order_item_price_includes_tax\": false,\n \"order_item_property\": [\n {\n \"order_item_property_name\": \"\",\n \"order_item_property_value\": \"\"\n }\n ],\n \"order_item_quantity\": 0,\n \"order_item_tax\": \"\",\n \"order_item_variant_id\": \"\",\n \"order_item_weight\": \"\"\n }\n ],\n \"order_payment_method\": \"\",\n \"order_shipping_method\": \"\",\n \"order_status\": \"\",\n \"prices_inc_tax\": false,\n \"send_admin_notifications\": false,\n \"send_notifications\": false,\n \"shipp_address_1\": \"\",\n \"shipp_address_2\": \"\",\n \"shipp_city\": \"\",\n \"shipp_company\": \"\",\n \"shipp_country\": \"\",\n \"shipp_fax\": \"\",\n \"shipp_first_name\": \"\",\n \"shipp_last_name\": \"\",\n \"shipp_phone\": \"\",\n \"shipp_postcode\": \"\",\n \"shipp_state\": \"\",\n \"shipping_price\": \"\",\n \"shipping_tax\": \"\",\n \"store_id\": \"\",\n \"subtotal_price\": \"\",\n \"tags\": \"\",\n \"tax_price\": \"\",\n \"total_paid\": \"\",\n \"total_price\": \"\",\n \"total_weight\": 0,\n \"transaction_id\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/order.add.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"admin_comment\": \"\",\n \"admin_private_comment\": \"\",\n \"bill_address_1\": \"\",\n \"bill_address_2\": \"\",\n \"bill_city\": \"\",\n \"bill_company\": \"\",\n \"bill_country\": \"\",\n \"bill_fax\": \"\",\n \"bill_first_name\": \"\",\n \"bill_last_name\": \"\",\n \"bill_phone\": \"\",\n \"bill_postcode\": \"\",\n \"bill_state\": \"\",\n \"channel_id\": \"\",\n \"clear_cache\": false,\n \"comment\": \"\",\n \"coupon_discount\": \"\",\n \"coupons\": [],\n \"create_invoice\": false,\n \"currency\": \"\",\n \"customer_birthday\": \"\",\n \"customer_email\": \"\",\n \"customer_fax\": \"\",\n \"customer_first_name\": \"\",\n \"customer_last_name\": \"\",\n \"customer_phone\": \"\",\n \"date\": \"\",\n \"date_finished\": \"\",\n \"date_modified\": \"\",\n \"discount\": \"\",\n \"external_source\": \"\",\n \"financial_status\": \"\",\n \"fulfillment_status\": \"\",\n \"gift_certificate_discount\": \"\",\n \"id\": \"\",\n \"inventory_behaviour\": \"\",\n \"note_attributes\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"order_id\": \"\",\n \"order_item\": [\n {\n \"order_item_allow_refund_items_separately\": false,\n \"order_item_allow_ship_items_separately\": false,\n \"order_item_id\": \"\",\n \"order_item_model\": \"\",\n \"order_item_name\": \"\",\n \"order_item_option\": [\n {\n \"order_item_option_name\": \"\",\n \"order_item_option_price\": \"\",\n \"order_item_option_value\": \"\"\n }\n ],\n \"order_item_parent\": 0,\n \"order_item_parent_option_name\": \"\",\n \"order_item_price\": \"\",\n \"order_item_price_includes_tax\": false,\n \"order_item_property\": [\n {\n \"order_item_property_name\": \"\",\n \"order_item_property_value\": \"\"\n }\n ],\n \"order_item_quantity\": 0,\n \"order_item_tax\": \"\",\n \"order_item_variant_id\": \"\",\n \"order_item_weight\": \"\"\n }\n ],\n \"order_payment_method\": \"\",\n \"order_shipping_method\": \"\",\n \"order_status\": \"\",\n \"prices_inc_tax\": false,\n \"send_admin_notifications\": false,\n \"send_notifications\": false,\n \"shipp_address_1\": \"\",\n \"shipp_address_2\": \"\",\n \"shipp_city\": \"\",\n \"shipp_company\": \"\",\n \"shipp_country\": \"\",\n \"shipp_fax\": \"\",\n \"shipp_first_name\": \"\",\n \"shipp_last_name\": \"\",\n \"shipp_phone\": \"\",\n \"shipp_postcode\": \"\",\n \"shipp_state\": \"\",\n \"shipping_price\": \"\",\n \"shipping_tax\": \"\",\n \"store_id\": \"\",\n \"subtotal_price\": \"\",\n \"tags\": \"\",\n \"tax_price\": \"\",\n \"total_paid\": \"\",\n \"total_price\": \"\",\n \"total_weight\": 0,\n \"transaction_id\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/order.add.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.body = "{\n \"admin_comment\": \"\",\n \"admin_private_comment\": \"\",\n \"bill_address_1\": \"\",\n \"bill_address_2\": \"\",\n \"bill_city\": \"\",\n \"bill_company\": \"\",\n \"bill_country\": \"\",\n \"bill_fax\": \"\",\n \"bill_first_name\": \"\",\n \"bill_last_name\": \"\",\n \"bill_phone\": \"\",\n \"bill_postcode\": \"\",\n \"bill_state\": \"\",\n \"channel_id\": \"\",\n \"clear_cache\": false,\n \"comment\": \"\",\n \"coupon_discount\": \"\",\n \"coupons\": [],\n \"create_invoice\": false,\n \"currency\": \"\",\n \"customer_birthday\": \"\",\n \"customer_email\": \"\",\n \"customer_fax\": \"\",\n \"customer_first_name\": \"\",\n \"customer_last_name\": \"\",\n \"customer_phone\": \"\",\n \"date\": \"\",\n \"date_finished\": \"\",\n \"date_modified\": \"\",\n \"discount\": \"\",\n \"external_source\": \"\",\n \"financial_status\": \"\",\n \"fulfillment_status\": \"\",\n \"gift_certificate_discount\": \"\",\n \"id\": \"\",\n \"inventory_behaviour\": \"\",\n \"note_attributes\": [\n {\n \"name\": \"\",\n \"value\": \"\"\n }\n ],\n \"order_id\": \"\",\n \"order_item\": [\n {\n \"order_item_allow_refund_items_separately\": false,\n \"order_item_allow_ship_items_separately\": false,\n \"order_item_id\": \"\",\n \"order_item_model\": \"\",\n \"order_item_name\": \"\",\n \"order_item_option\": [\n {\n \"order_item_option_name\": \"\",\n \"order_item_option_price\": \"\",\n \"order_item_option_value\": \"\"\n }\n ],\n \"order_item_parent\": 0,\n \"order_item_parent_option_name\": \"\",\n \"order_item_price\": \"\",\n \"order_item_price_includes_tax\": false,\n \"order_item_property\": [\n {\n \"order_item_property_name\": \"\",\n \"order_item_property_value\": \"\"\n }\n ],\n \"order_item_quantity\": 0,\n \"order_item_tax\": \"\",\n \"order_item_variant_id\": \"\",\n \"order_item_weight\": \"\"\n }\n ],\n \"order_payment_method\": \"\",\n \"order_shipping_method\": \"\",\n \"order_status\": \"\",\n \"prices_inc_tax\": false,\n \"send_admin_notifications\": false,\n \"send_notifications\": false,\n \"shipp_address_1\": \"\",\n \"shipp_address_2\": \"\",\n \"shipp_city\": \"\",\n \"shipp_company\": \"\",\n \"shipp_country\": \"\",\n \"shipp_fax\": \"\",\n \"shipp_first_name\": \"\",\n \"shipp_last_name\": \"\",\n \"shipp_phone\": \"\",\n \"shipp_postcode\": \"\",\n \"shipp_state\": \"\",\n \"shipping_price\": \"\",\n \"shipping_tax\": \"\",\n \"store_id\": \"\",\n \"subtotal_price\": \"\",\n \"tags\": \"\",\n \"tax_price\": \"\",\n \"total_paid\": \"\",\n \"total_price\": \"\",\n \"total_weight\": 0,\n \"transaction_id\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/order.add.json";
let payload = json!({
"admin_comment": "",
"admin_private_comment": "",
"bill_address_1": "",
"bill_address_2": "",
"bill_city": "",
"bill_company": "",
"bill_country": "",
"bill_fax": "",
"bill_first_name": "",
"bill_last_name": "",
"bill_phone": "",
"bill_postcode": "",
"bill_state": "",
"channel_id": "",
"clear_cache": false,
"comment": "",
"coupon_discount": "",
"coupons": (),
"create_invoice": false,
"currency": "",
"customer_birthday": "",
"customer_email": "",
"customer_fax": "",
"customer_first_name": "",
"customer_last_name": "",
"customer_phone": "",
"date": "",
"date_finished": "",
"date_modified": "",
"discount": "",
"external_source": "",
"financial_status": "",
"fulfillment_status": "",
"gift_certificate_discount": "",
"id": "",
"inventory_behaviour": "",
"note_attributes": (
json!({
"name": "",
"value": ""
})
),
"order_id": "",
"order_item": (
json!({
"order_item_allow_refund_items_separately": false,
"order_item_allow_ship_items_separately": false,
"order_item_id": "",
"order_item_model": "",
"order_item_name": "",
"order_item_option": (
json!({
"order_item_option_name": "",
"order_item_option_price": "",
"order_item_option_value": ""
})
),
"order_item_parent": 0,
"order_item_parent_option_name": "",
"order_item_price": "",
"order_item_price_includes_tax": false,
"order_item_property": (
json!({
"order_item_property_name": "",
"order_item_property_value": ""
})
),
"order_item_quantity": 0,
"order_item_tax": "",
"order_item_variant_id": "",
"order_item_weight": ""
})
),
"order_payment_method": "",
"order_shipping_method": "",
"order_status": "",
"prices_inc_tax": false,
"send_admin_notifications": false,
"send_notifications": false,
"shipp_address_1": "",
"shipp_address_2": "",
"shipp_city": "",
"shipp_company": "",
"shipp_country": "",
"shipp_fax": "",
"shipp_first_name": "",
"shipp_last_name": "",
"shipp_phone": "",
"shipp_postcode": "",
"shipp_state": "",
"shipping_price": "",
"shipping_tax": "",
"store_id": "",
"subtotal_price": "",
"tags": "",
"tax_price": "",
"total_paid": "",
"total_price": "",
"total_weight": 0,
"transaction_id": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/order.add.json \
--header 'content-type: application/json' \
--header 'x-api-key: {{apiKey}}' \
--data '{
"admin_comment": "",
"admin_private_comment": "",
"bill_address_1": "",
"bill_address_2": "",
"bill_city": "",
"bill_company": "",
"bill_country": "",
"bill_fax": "",
"bill_first_name": "",
"bill_last_name": "",
"bill_phone": "",
"bill_postcode": "",
"bill_state": "",
"channel_id": "",
"clear_cache": false,
"comment": "",
"coupon_discount": "",
"coupons": [],
"create_invoice": false,
"currency": "",
"customer_birthday": "",
"customer_email": "",
"customer_fax": "",
"customer_first_name": "",
"customer_last_name": "",
"customer_phone": "",
"date": "",
"date_finished": "",
"date_modified": "",
"discount": "",
"external_source": "",
"financial_status": "",
"fulfillment_status": "",
"gift_certificate_discount": "",
"id": "",
"inventory_behaviour": "",
"note_attributes": [
{
"name": "",
"value": ""
}
],
"order_id": "",
"order_item": [
{
"order_item_allow_refund_items_separately": false,
"order_item_allow_ship_items_separately": false,
"order_item_id": "",
"order_item_model": "",
"order_item_name": "",
"order_item_option": [
{
"order_item_option_name": "",
"order_item_option_price": "",
"order_item_option_value": ""
}
],
"order_item_parent": 0,
"order_item_parent_option_name": "",
"order_item_price": "",
"order_item_price_includes_tax": false,
"order_item_property": [
{
"order_item_property_name": "",
"order_item_property_value": ""
}
],
"order_item_quantity": 0,
"order_item_tax": "",
"order_item_variant_id": "",
"order_item_weight": ""
}
],
"order_payment_method": "",
"order_shipping_method": "",
"order_status": "",
"prices_inc_tax": false,
"send_admin_notifications": false,
"send_notifications": false,
"shipp_address_1": "",
"shipp_address_2": "",
"shipp_city": "",
"shipp_company": "",
"shipp_country": "",
"shipp_fax": "",
"shipp_first_name": "",
"shipp_last_name": "",
"shipp_phone": "",
"shipp_postcode": "",
"shipp_state": "",
"shipping_price": "",
"shipping_tax": "",
"store_id": "",
"subtotal_price": "",
"tags": "",
"tax_price": "",
"total_paid": "",
"total_price": "",
"total_weight": 0,
"transaction_id": ""
}'
echo '{
"admin_comment": "",
"admin_private_comment": "",
"bill_address_1": "",
"bill_address_2": "",
"bill_city": "",
"bill_company": "",
"bill_country": "",
"bill_fax": "",
"bill_first_name": "",
"bill_last_name": "",
"bill_phone": "",
"bill_postcode": "",
"bill_state": "",
"channel_id": "",
"clear_cache": false,
"comment": "",
"coupon_discount": "",
"coupons": [],
"create_invoice": false,
"currency": "",
"customer_birthday": "",
"customer_email": "",
"customer_fax": "",
"customer_first_name": "",
"customer_last_name": "",
"customer_phone": "",
"date": "",
"date_finished": "",
"date_modified": "",
"discount": "",
"external_source": "",
"financial_status": "",
"fulfillment_status": "",
"gift_certificate_discount": "",
"id": "",
"inventory_behaviour": "",
"note_attributes": [
{
"name": "",
"value": ""
}
],
"order_id": "",
"order_item": [
{
"order_item_allow_refund_items_separately": false,
"order_item_allow_ship_items_separately": false,
"order_item_id": "",
"order_item_model": "",
"order_item_name": "",
"order_item_option": [
{
"order_item_option_name": "",
"order_item_option_price": "",
"order_item_option_value": ""
}
],
"order_item_parent": 0,
"order_item_parent_option_name": "",
"order_item_price": "",
"order_item_price_includes_tax": false,
"order_item_property": [
{
"order_item_property_name": "",
"order_item_property_value": ""
}
],
"order_item_quantity": 0,
"order_item_tax": "",
"order_item_variant_id": "",
"order_item_weight": ""
}
],
"order_payment_method": "",
"order_shipping_method": "",
"order_status": "",
"prices_inc_tax": false,
"send_admin_notifications": false,
"send_notifications": false,
"shipp_address_1": "",
"shipp_address_2": "",
"shipp_city": "",
"shipp_company": "",
"shipp_country": "",
"shipp_fax": "",
"shipp_first_name": "",
"shipp_last_name": "",
"shipp_phone": "",
"shipp_postcode": "",
"shipp_state": "",
"shipping_price": "",
"shipping_tax": "",
"store_id": "",
"subtotal_price": "",
"tags": "",
"tax_price": "",
"total_paid": "",
"total_price": "",
"total_weight": 0,
"transaction_id": ""
}' | \
http POST {{baseUrl}}/order.add.json \
content-type:application/json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "admin_comment": "",\n "admin_private_comment": "",\n "bill_address_1": "",\n "bill_address_2": "",\n "bill_city": "",\n "bill_company": "",\n "bill_country": "",\n "bill_fax": "",\n "bill_first_name": "",\n "bill_last_name": "",\n "bill_phone": "",\n "bill_postcode": "",\n "bill_state": "",\n "channel_id": "",\n "clear_cache": false,\n "comment": "",\n "coupon_discount": "",\n "coupons": [],\n "create_invoice": false,\n "currency": "",\n "customer_birthday": "",\n "customer_email": "",\n "customer_fax": "",\n "customer_first_name": "",\n "customer_last_name": "",\n "customer_phone": "",\n "date": "",\n "date_finished": "",\n "date_modified": "",\n "discount": "",\n "external_source": "",\n "financial_status": "",\n "fulfillment_status": "",\n "gift_certificate_discount": "",\n "id": "",\n "inventory_behaviour": "",\n "note_attributes": [\n {\n "name": "",\n "value": ""\n }\n ],\n "order_id": "",\n "order_item": [\n {\n "order_item_allow_refund_items_separately": false,\n "order_item_allow_ship_items_separately": false,\n "order_item_id": "",\n "order_item_model": "",\n "order_item_name": "",\n "order_item_option": [\n {\n "order_item_option_name": "",\n "order_item_option_price": "",\n "order_item_option_value": ""\n }\n ],\n "order_item_parent": 0,\n "order_item_parent_option_name": "",\n "order_item_price": "",\n "order_item_price_includes_tax": false,\n "order_item_property": [\n {\n "order_item_property_name": "",\n "order_item_property_value": ""\n }\n ],\n "order_item_quantity": 0,\n "order_item_tax": "",\n "order_item_variant_id": "",\n "order_item_weight": ""\n }\n ],\n "order_payment_method": "",\n "order_shipping_method": "",\n "order_status": "",\n "prices_inc_tax": false,\n "send_admin_notifications": false,\n "send_notifications": false,\n "shipp_address_1": "",\n "shipp_address_2": "",\n "shipp_city": "",\n "shipp_company": "",\n "shipp_country": "",\n "shipp_fax": "",\n "shipp_first_name": "",\n "shipp_last_name": "",\n "shipp_phone": "",\n "shipp_postcode": "",\n "shipp_state": "",\n "shipping_price": "",\n "shipping_tax": "",\n "store_id": "",\n "subtotal_price": "",\n "tags": "",\n "tax_price": "",\n "total_paid": "",\n "total_price": "",\n "total_weight": 0,\n "transaction_id": ""\n}' \
--output-document \
- {{baseUrl}}/order.add.json
import Foundation
let headers = [
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"admin_comment": "",
"admin_private_comment": "",
"bill_address_1": "",
"bill_address_2": "",
"bill_city": "",
"bill_company": "",
"bill_country": "",
"bill_fax": "",
"bill_first_name": "",
"bill_last_name": "",
"bill_phone": "",
"bill_postcode": "",
"bill_state": "",
"channel_id": "",
"clear_cache": false,
"comment": "",
"coupon_discount": "",
"coupons": [],
"create_invoice": false,
"currency": "",
"customer_birthday": "",
"customer_email": "",
"customer_fax": "",
"customer_first_name": "",
"customer_last_name": "",
"customer_phone": "",
"date": "",
"date_finished": "",
"date_modified": "",
"discount": "",
"external_source": "",
"financial_status": "",
"fulfillment_status": "",
"gift_certificate_discount": "",
"id": "",
"inventory_behaviour": "",
"note_attributes": [
[
"name": "",
"value": ""
]
],
"order_id": "",
"order_item": [
[
"order_item_allow_refund_items_separately": false,
"order_item_allow_ship_items_separately": false,
"order_item_id": "",
"order_item_model": "",
"order_item_name": "",
"order_item_option": [
[
"order_item_option_name": "",
"order_item_option_price": "",
"order_item_option_value": ""
]
],
"order_item_parent": 0,
"order_item_parent_option_name": "",
"order_item_price": "",
"order_item_price_includes_tax": false,
"order_item_property": [
[
"order_item_property_name": "",
"order_item_property_value": ""
]
],
"order_item_quantity": 0,
"order_item_tax": "",
"order_item_variant_id": "",
"order_item_weight": ""
]
],
"order_payment_method": "",
"order_shipping_method": "",
"order_status": "",
"prices_inc_tax": false,
"send_admin_notifications": false,
"send_notifications": false,
"shipp_address_1": "",
"shipp_address_2": "",
"shipp_city": "",
"shipp_company": "",
"shipp_country": "",
"shipp_fax": "",
"shipp_first_name": "",
"shipp_last_name": "",
"shipp_phone": "",
"shipp_postcode": "",
"shipp_state": "",
"shipping_price": "",
"shipping_tax": "",
"store_id": "",
"subtotal_price": "",
"tags": "",
"tax_price": "",
"total_paid": "",
"total_price": "",
"total_weight": 0,
"transaction_id": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/order.add.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
OrderCount
{{baseUrl}}/order.count.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/order.count.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/order.count.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/order.count.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/order.count.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/order.count.json");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/order.count.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/order.count.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/order.count.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/order.count.json"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/order.count.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/order.count.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/order.count.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/order.count.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/order.count.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/order.count.json',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/order.count.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/order.count.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/order.count.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/order.count.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/order.count.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/order.count.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/order.count.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/order.count.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/order.count.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/order.count.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/order.count.json');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/order.count.json');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/order.count.json' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/order.count.json' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/order.count.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/order.count.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/order.count.json"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/order.count.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/order.count.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/order.count.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/order.count.json \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/order.count.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/order.count.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/order.count.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
OrderFinancialStatusList
{{baseUrl}}/order.financial_status.list.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/order.financial_status.list.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/order.financial_status.list.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/order.financial_status.list.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/order.financial_status.list.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/order.financial_status.list.json");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/order.financial_status.list.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/order.financial_status.list.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/order.financial_status.list.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/order.financial_status.list.json"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/order.financial_status.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/order.financial_status.list.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/order.financial_status.list.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/order.financial_status.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/order.financial_status.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/order.financial_status.list.json',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/order.financial_status.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/order.financial_status.list.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/order.financial_status.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/order.financial_status.list.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/order.financial_status.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/order.financial_status.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/order.financial_status.list.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/order.financial_status.list.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/order.financial_status.list.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/order.financial_status.list.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/order.financial_status.list.json');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/order.financial_status.list.json');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/order.financial_status.list.json' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/order.financial_status.list.json' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/order.financial_status.list.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/order.financial_status.list.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/order.financial_status.list.json"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/order.financial_status.list.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/order.financial_status.list.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/order.financial_status.list.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/order.financial_status.list.json \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/order.financial_status.list.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/order.financial_status.list.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/order.financial_status.list.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
OrderFind
{{baseUrl}}/order.find.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/order.find.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/order.find.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/order.find.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/order.find.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/order.find.json");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/order.find.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/order.find.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/order.find.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/order.find.json"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/order.find.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/order.find.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/order.find.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/order.find.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/order.find.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/order.find.json',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/order.find.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/order.find.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/order.find.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/order.find.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/order.find.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/order.find.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/order.find.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/order.find.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/order.find.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/order.find.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/order.find.json');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/order.find.json');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/order.find.json' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/order.find.json' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/order.find.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/order.find.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/order.find.json"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/order.find.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/order.find.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/order.find.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/order.find.json \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/order.find.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/order.find.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/order.find.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
OrderFulfillmentStatusList
{{baseUrl}}/order.fulfillment_status.list.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/order.fulfillment_status.list.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/order.fulfillment_status.list.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/order.fulfillment_status.list.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/order.fulfillment_status.list.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/order.fulfillment_status.list.json");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/order.fulfillment_status.list.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/order.fulfillment_status.list.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/order.fulfillment_status.list.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/order.fulfillment_status.list.json"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/order.fulfillment_status.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/order.fulfillment_status.list.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/order.fulfillment_status.list.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/order.fulfillment_status.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/order.fulfillment_status.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/order.fulfillment_status.list.json',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/order.fulfillment_status.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/order.fulfillment_status.list.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/order.fulfillment_status.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/order.fulfillment_status.list.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/order.fulfillment_status.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/order.fulfillment_status.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/order.fulfillment_status.list.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/order.fulfillment_status.list.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/order.fulfillment_status.list.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/order.fulfillment_status.list.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/order.fulfillment_status.list.json');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/order.fulfillment_status.list.json');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/order.fulfillment_status.list.json' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/order.fulfillment_status.list.json' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/order.fulfillment_status.list.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/order.fulfillment_status.list.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/order.fulfillment_status.list.json"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/order.fulfillment_status.list.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/order.fulfillment_status.list.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/order.fulfillment_status.list.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/order.fulfillment_status.list.json \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/order.fulfillment_status.list.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/order.fulfillment_status.list.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/order.fulfillment_status.list.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
OrderInfo
{{baseUrl}}/order.info.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/order.info.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/order.info.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/order.info.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/order.info.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/order.info.json");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/order.info.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/order.info.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/order.info.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/order.info.json"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/order.info.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/order.info.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/order.info.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/order.info.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/order.info.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/order.info.json',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/order.info.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/order.info.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/order.info.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/order.info.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/order.info.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/order.info.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/order.info.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/order.info.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/order.info.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/order.info.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/order.info.json');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/order.info.json');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/order.info.json' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/order.info.json' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/order.info.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/order.info.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/order.info.json"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/order.info.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/order.info.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/order.info.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/order.info.json \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/order.info.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/order.info.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/order.info.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
OrderList
{{baseUrl}}/order.list.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/order.list.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/order.list.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/order.list.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/order.list.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/order.list.json");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/order.list.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/order.list.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/order.list.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/order.list.json"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/order.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/order.list.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/order.list.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/order.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/order.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/order.list.json',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/order.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/order.list.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/order.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/order.list.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/order.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/order.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/order.list.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/order.list.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/order.list.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/order.list.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/order.list.json');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/order.list.json');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/order.list.json' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/order.list.json' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/order.list.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/order.list.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/order.list.json"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/order.list.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/order.list.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/order.list.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/order.list.json \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/order.list.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/order.list.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/order.list.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
OrderPreestimateShippingList
{{baseUrl}}/order.preestimate_shipping.list.json
HEADERS
x-api-key
{{apiKey}}
BODY json
{
"customer_email": "",
"customer_id": "",
"exclude": "",
"order_item": [
{
"order_item_id": "",
"order_item_model": "",
"order_item_option": [
{
"order_item_option_id": "",
"order_item_option_name": "",
"order_item_option_used_in_combinations": false,
"order_item_option_value": "",
"order_item_option_value_id": ""
}
],
"order_item_quantity": 0,
"order_item_variant_id": "",
"order_item_weight": ""
}
],
"params": "",
"shipp_address_1": "",
"shipp_city": "",
"shipp_country": "",
"shipp_postcode": "",
"shipp_state": "",
"store_id": "",
"warehouse_id": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/order.preestimate_shipping.list.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"customer_email\": \"\",\n \"customer_id\": \"\",\n \"exclude\": \"\",\n \"order_item\": [\n {\n \"order_item_id\": \"\",\n \"order_item_model\": \"\",\n \"order_item_option\": [\n {\n \"order_item_option_id\": \"\",\n \"order_item_option_name\": \"\",\n \"order_item_option_used_in_combinations\": false,\n \"order_item_option_value\": \"\",\n \"order_item_option_value_id\": \"\"\n }\n ],\n \"order_item_quantity\": 0,\n \"order_item_variant_id\": \"\",\n \"order_item_weight\": \"\"\n }\n ],\n \"params\": \"\",\n \"shipp_address_1\": \"\",\n \"shipp_city\": \"\",\n \"shipp_country\": \"\",\n \"shipp_postcode\": \"\",\n \"shipp_state\": \"\",\n \"store_id\": \"\",\n \"warehouse_id\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/order.preestimate_shipping.list.json" {:headers {:x-api-key "{{apiKey}}"}
:content-type :json
:form-params {:customer_email ""
:customer_id ""
:exclude ""
:order_item [{:order_item_id ""
:order_item_model ""
:order_item_option [{:order_item_option_id ""
:order_item_option_name ""
:order_item_option_used_in_combinations false
:order_item_option_value ""
:order_item_option_value_id ""}]
:order_item_quantity 0
:order_item_variant_id ""
:order_item_weight ""}]
:params ""
:shipp_address_1 ""
:shipp_city ""
:shipp_country ""
:shipp_postcode ""
:shipp_state ""
:store_id ""
:warehouse_id ""}})
require "http/client"
url = "{{baseUrl}}/order.preestimate_shipping.list.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"customer_email\": \"\",\n \"customer_id\": \"\",\n \"exclude\": \"\",\n \"order_item\": [\n {\n \"order_item_id\": \"\",\n \"order_item_model\": \"\",\n \"order_item_option\": [\n {\n \"order_item_option_id\": \"\",\n \"order_item_option_name\": \"\",\n \"order_item_option_used_in_combinations\": false,\n \"order_item_option_value\": \"\",\n \"order_item_option_value_id\": \"\"\n }\n ],\n \"order_item_quantity\": 0,\n \"order_item_variant_id\": \"\",\n \"order_item_weight\": \"\"\n }\n ],\n \"params\": \"\",\n \"shipp_address_1\": \"\",\n \"shipp_city\": \"\",\n \"shipp_country\": \"\",\n \"shipp_postcode\": \"\",\n \"shipp_state\": \"\",\n \"store_id\": \"\",\n \"warehouse_id\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/order.preestimate_shipping.list.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
Content = new StringContent("{\n \"customer_email\": \"\",\n \"customer_id\": \"\",\n \"exclude\": \"\",\n \"order_item\": [\n {\n \"order_item_id\": \"\",\n \"order_item_model\": \"\",\n \"order_item_option\": [\n {\n \"order_item_option_id\": \"\",\n \"order_item_option_name\": \"\",\n \"order_item_option_used_in_combinations\": false,\n \"order_item_option_value\": \"\",\n \"order_item_option_value_id\": \"\"\n }\n ],\n \"order_item_quantity\": 0,\n \"order_item_variant_id\": \"\",\n \"order_item_weight\": \"\"\n }\n ],\n \"params\": \"\",\n \"shipp_address_1\": \"\",\n \"shipp_city\": \"\",\n \"shipp_country\": \"\",\n \"shipp_postcode\": \"\",\n \"shipp_state\": \"\",\n \"store_id\": \"\",\n \"warehouse_id\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/order.preestimate_shipping.list.json");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"customer_email\": \"\",\n \"customer_id\": \"\",\n \"exclude\": \"\",\n \"order_item\": [\n {\n \"order_item_id\": \"\",\n \"order_item_model\": \"\",\n \"order_item_option\": [\n {\n \"order_item_option_id\": \"\",\n \"order_item_option_name\": \"\",\n \"order_item_option_used_in_combinations\": false,\n \"order_item_option_value\": \"\",\n \"order_item_option_value_id\": \"\"\n }\n ],\n \"order_item_quantity\": 0,\n \"order_item_variant_id\": \"\",\n \"order_item_weight\": \"\"\n }\n ],\n \"params\": \"\",\n \"shipp_address_1\": \"\",\n \"shipp_city\": \"\",\n \"shipp_country\": \"\",\n \"shipp_postcode\": \"\",\n \"shipp_state\": \"\",\n \"store_id\": \"\",\n \"warehouse_id\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/order.preestimate_shipping.list.json"
payload := strings.NewReader("{\n \"customer_email\": \"\",\n \"customer_id\": \"\",\n \"exclude\": \"\",\n \"order_item\": [\n {\n \"order_item_id\": \"\",\n \"order_item_model\": \"\",\n \"order_item_option\": [\n {\n \"order_item_option_id\": \"\",\n \"order_item_option_name\": \"\",\n \"order_item_option_used_in_combinations\": false,\n \"order_item_option_value\": \"\",\n \"order_item_option_value_id\": \"\"\n }\n ],\n \"order_item_quantity\": 0,\n \"order_item_variant_id\": \"\",\n \"order_item_weight\": \"\"\n }\n ],\n \"params\": \"\",\n \"shipp_address_1\": \"\",\n \"shipp_city\": \"\",\n \"shipp_country\": \"\",\n \"shipp_postcode\": \"\",\n \"shipp_state\": \"\",\n \"store_id\": \"\",\n \"warehouse_id\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/order.preestimate_shipping.list.json HTTP/1.1
X-Api-Key: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 701
{
"customer_email": "",
"customer_id": "",
"exclude": "",
"order_item": [
{
"order_item_id": "",
"order_item_model": "",
"order_item_option": [
{
"order_item_option_id": "",
"order_item_option_name": "",
"order_item_option_used_in_combinations": false,
"order_item_option_value": "",
"order_item_option_value_id": ""
}
],
"order_item_quantity": 0,
"order_item_variant_id": "",
"order_item_weight": ""
}
],
"params": "",
"shipp_address_1": "",
"shipp_city": "",
"shipp_country": "",
"shipp_postcode": "",
"shipp_state": "",
"store_id": "",
"warehouse_id": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/order.preestimate_shipping.list.json")
.setHeader("x-api-key", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"customer_email\": \"\",\n \"customer_id\": \"\",\n \"exclude\": \"\",\n \"order_item\": [\n {\n \"order_item_id\": \"\",\n \"order_item_model\": \"\",\n \"order_item_option\": [\n {\n \"order_item_option_id\": \"\",\n \"order_item_option_name\": \"\",\n \"order_item_option_used_in_combinations\": false,\n \"order_item_option_value\": \"\",\n \"order_item_option_value_id\": \"\"\n }\n ],\n \"order_item_quantity\": 0,\n \"order_item_variant_id\": \"\",\n \"order_item_weight\": \"\"\n }\n ],\n \"params\": \"\",\n \"shipp_address_1\": \"\",\n \"shipp_city\": \"\",\n \"shipp_country\": \"\",\n \"shipp_postcode\": \"\",\n \"shipp_state\": \"\",\n \"store_id\": \"\",\n \"warehouse_id\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/order.preestimate_shipping.list.json"))
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"customer_email\": \"\",\n \"customer_id\": \"\",\n \"exclude\": \"\",\n \"order_item\": [\n {\n \"order_item_id\": \"\",\n \"order_item_model\": \"\",\n \"order_item_option\": [\n {\n \"order_item_option_id\": \"\",\n \"order_item_option_name\": \"\",\n \"order_item_option_used_in_combinations\": false,\n \"order_item_option_value\": \"\",\n \"order_item_option_value_id\": \"\"\n }\n ],\n \"order_item_quantity\": 0,\n \"order_item_variant_id\": \"\",\n \"order_item_weight\": \"\"\n }\n ],\n \"params\": \"\",\n \"shipp_address_1\": \"\",\n \"shipp_city\": \"\",\n \"shipp_country\": \"\",\n \"shipp_postcode\": \"\",\n \"shipp_state\": \"\",\n \"store_id\": \"\",\n \"warehouse_id\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"customer_email\": \"\",\n \"customer_id\": \"\",\n \"exclude\": \"\",\n \"order_item\": [\n {\n \"order_item_id\": \"\",\n \"order_item_model\": \"\",\n \"order_item_option\": [\n {\n \"order_item_option_id\": \"\",\n \"order_item_option_name\": \"\",\n \"order_item_option_used_in_combinations\": false,\n \"order_item_option_value\": \"\",\n \"order_item_option_value_id\": \"\"\n }\n ],\n \"order_item_quantity\": 0,\n \"order_item_variant_id\": \"\",\n \"order_item_weight\": \"\"\n }\n ],\n \"params\": \"\",\n \"shipp_address_1\": \"\",\n \"shipp_city\": \"\",\n \"shipp_country\": \"\",\n \"shipp_postcode\": \"\",\n \"shipp_state\": \"\",\n \"store_id\": \"\",\n \"warehouse_id\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/order.preestimate_shipping.list.json")
.post(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/order.preestimate_shipping.list.json")
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"customer_email\": \"\",\n \"customer_id\": \"\",\n \"exclude\": \"\",\n \"order_item\": [\n {\n \"order_item_id\": \"\",\n \"order_item_model\": \"\",\n \"order_item_option\": [\n {\n \"order_item_option_id\": \"\",\n \"order_item_option_name\": \"\",\n \"order_item_option_used_in_combinations\": false,\n \"order_item_option_value\": \"\",\n \"order_item_option_value_id\": \"\"\n }\n ],\n \"order_item_quantity\": 0,\n \"order_item_variant_id\": \"\",\n \"order_item_weight\": \"\"\n }\n ],\n \"params\": \"\",\n \"shipp_address_1\": \"\",\n \"shipp_city\": \"\",\n \"shipp_country\": \"\",\n \"shipp_postcode\": \"\",\n \"shipp_state\": \"\",\n \"store_id\": \"\",\n \"warehouse_id\": \"\"\n}")
.asString();
const data = JSON.stringify({
customer_email: '',
customer_id: '',
exclude: '',
order_item: [
{
order_item_id: '',
order_item_model: '',
order_item_option: [
{
order_item_option_id: '',
order_item_option_name: '',
order_item_option_used_in_combinations: false,
order_item_option_value: '',
order_item_option_value_id: ''
}
],
order_item_quantity: 0,
order_item_variant_id: '',
order_item_weight: ''
}
],
params: '',
shipp_address_1: '',
shipp_city: '',
shipp_country: '',
shipp_postcode: '',
shipp_state: '',
store_id: '',
warehouse_id: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/order.preestimate_shipping.list.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/order.preestimate_shipping.list.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {
customer_email: '',
customer_id: '',
exclude: '',
order_item: [
{
order_item_id: '',
order_item_model: '',
order_item_option: [
{
order_item_option_id: '',
order_item_option_name: '',
order_item_option_used_in_combinations: false,
order_item_option_value: '',
order_item_option_value_id: ''
}
],
order_item_quantity: 0,
order_item_variant_id: '',
order_item_weight: ''
}
],
params: '',
shipp_address_1: '',
shipp_city: '',
shipp_country: '',
shipp_postcode: '',
shipp_state: '',
store_id: '',
warehouse_id: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/order.preestimate_shipping.list.json';
const options = {
method: 'POST',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"customer_email":"","customer_id":"","exclude":"","order_item":[{"order_item_id":"","order_item_model":"","order_item_option":[{"order_item_option_id":"","order_item_option_name":"","order_item_option_used_in_combinations":false,"order_item_option_value":"","order_item_option_value_id":""}],"order_item_quantity":0,"order_item_variant_id":"","order_item_weight":""}],"params":"","shipp_address_1":"","shipp_city":"","shipp_country":"","shipp_postcode":"","shipp_state":"","store_id":"","warehouse_id":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/order.preestimate_shipping.list.json',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "customer_email": "",\n "customer_id": "",\n "exclude": "",\n "order_item": [\n {\n "order_item_id": "",\n "order_item_model": "",\n "order_item_option": [\n {\n "order_item_option_id": "",\n "order_item_option_name": "",\n "order_item_option_used_in_combinations": false,\n "order_item_option_value": "",\n "order_item_option_value_id": ""\n }\n ],\n "order_item_quantity": 0,\n "order_item_variant_id": "",\n "order_item_weight": ""\n }\n ],\n "params": "",\n "shipp_address_1": "",\n "shipp_city": "",\n "shipp_country": "",\n "shipp_postcode": "",\n "shipp_state": "",\n "store_id": "",\n "warehouse_id": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"customer_email\": \"\",\n \"customer_id\": \"\",\n \"exclude\": \"\",\n \"order_item\": [\n {\n \"order_item_id\": \"\",\n \"order_item_model\": \"\",\n \"order_item_option\": [\n {\n \"order_item_option_id\": \"\",\n \"order_item_option_name\": \"\",\n \"order_item_option_used_in_combinations\": false,\n \"order_item_option_value\": \"\",\n \"order_item_option_value_id\": \"\"\n }\n ],\n \"order_item_quantity\": 0,\n \"order_item_variant_id\": \"\",\n \"order_item_weight\": \"\"\n }\n ],\n \"params\": \"\",\n \"shipp_address_1\": \"\",\n \"shipp_city\": \"\",\n \"shipp_country\": \"\",\n \"shipp_postcode\": \"\",\n \"shipp_state\": \"\",\n \"store_id\": \"\",\n \"warehouse_id\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/order.preestimate_shipping.list.json")
.post(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/order.preestimate_shipping.list.json',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
customer_email: '',
customer_id: '',
exclude: '',
order_item: [
{
order_item_id: '',
order_item_model: '',
order_item_option: [
{
order_item_option_id: '',
order_item_option_name: '',
order_item_option_used_in_combinations: false,
order_item_option_value: '',
order_item_option_value_id: ''
}
],
order_item_quantity: 0,
order_item_variant_id: '',
order_item_weight: ''
}
],
params: '',
shipp_address_1: '',
shipp_city: '',
shipp_country: '',
shipp_postcode: '',
shipp_state: '',
store_id: '',
warehouse_id: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/order.preestimate_shipping.list.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: {
customer_email: '',
customer_id: '',
exclude: '',
order_item: [
{
order_item_id: '',
order_item_model: '',
order_item_option: [
{
order_item_option_id: '',
order_item_option_name: '',
order_item_option_used_in_combinations: false,
order_item_option_value: '',
order_item_option_value_id: ''
}
],
order_item_quantity: 0,
order_item_variant_id: '',
order_item_weight: ''
}
],
params: '',
shipp_address_1: '',
shipp_city: '',
shipp_country: '',
shipp_postcode: '',
shipp_state: '',
store_id: '',
warehouse_id: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/order.preestimate_shipping.list.json');
req.headers({
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
customer_email: '',
customer_id: '',
exclude: '',
order_item: [
{
order_item_id: '',
order_item_model: '',
order_item_option: [
{
order_item_option_id: '',
order_item_option_name: '',
order_item_option_used_in_combinations: false,
order_item_option_value: '',
order_item_option_value_id: ''
}
],
order_item_quantity: 0,
order_item_variant_id: '',
order_item_weight: ''
}
],
params: '',
shipp_address_1: '',
shipp_city: '',
shipp_country: '',
shipp_postcode: '',
shipp_state: '',
store_id: '',
warehouse_id: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/order.preestimate_shipping.list.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {
customer_email: '',
customer_id: '',
exclude: '',
order_item: [
{
order_item_id: '',
order_item_model: '',
order_item_option: [
{
order_item_option_id: '',
order_item_option_name: '',
order_item_option_used_in_combinations: false,
order_item_option_value: '',
order_item_option_value_id: ''
}
],
order_item_quantity: 0,
order_item_variant_id: '',
order_item_weight: ''
}
],
params: '',
shipp_address_1: '',
shipp_city: '',
shipp_country: '',
shipp_postcode: '',
shipp_state: '',
store_id: '',
warehouse_id: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/order.preestimate_shipping.list.json';
const options = {
method: 'POST',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"customer_email":"","customer_id":"","exclude":"","order_item":[{"order_item_id":"","order_item_model":"","order_item_option":[{"order_item_option_id":"","order_item_option_name":"","order_item_option_used_in_combinations":false,"order_item_option_value":"","order_item_option_value_id":""}],"order_item_quantity":0,"order_item_variant_id":"","order_item_weight":""}],"params":"","shipp_address_1":"","shipp_city":"","shipp_country":"","shipp_postcode":"","shipp_state":"","store_id":"","warehouse_id":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"customer_email": @"",
@"customer_id": @"",
@"exclude": @"",
@"order_item": @[ @{ @"order_item_id": @"", @"order_item_model": @"", @"order_item_option": @[ @{ @"order_item_option_id": @"", @"order_item_option_name": @"", @"order_item_option_used_in_combinations": @NO, @"order_item_option_value": @"", @"order_item_option_value_id": @"" } ], @"order_item_quantity": @0, @"order_item_variant_id": @"", @"order_item_weight": @"" } ],
@"params": @"",
@"shipp_address_1": @"",
@"shipp_city": @"",
@"shipp_country": @"",
@"shipp_postcode": @"",
@"shipp_state": @"",
@"store_id": @"",
@"warehouse_id": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/order.preestimate_shipping.list.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/order.preestimate_shipping.list.json" in
let headers = Header.add_list (Header.init ()) [
("x-api-key", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"customer_email\": \"\",\n \"customer_id\": \"\",\n \"exclude\": \"\",\n \"order_item\": [\n {\n \"order_item_id\": \"\",\n \"order_item_model\": \"\",\n \"order_item_option\": [\n {\n \"order_item_option_id\": \"\",\n \"order_item_option_name\": \"\",\n \"order_item_option_used_in_combinations\": false,\n \"order_item_option_value\": \"\",\n \"order_item_option_value_id\": \"\"\n }\n ],\n \"order_item_quantity\": 0,\n \"order_item_variant_id\": \"\",\n \"order_item_weight\": \"\"\n }\n ],\n \"params\": \"\",\n \"shipp_address_1\": \"\",\n \"shipp_city\": \"\",\n \"shipp_country\": \"\",\n \"shipp_postcode\": \"\",\n \"shipp_state\": \"\",\n \"store_id\": \"\",\n \"warehouse_id\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/order.preestimate_shipping.list.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'customer_email' => '',
'customer_id' => '',
'exclude' => '',
'order_item' => [
[
'order_item_id' => '',
'order_item_model' => '',
'order_item_option' => [
[
'order_item_option_id' => '',
'order_item_option_name' => '',
'order_item_option_used_in_combinations' => null,
'order_item_option_value' => '',
'order_item_option_value_id' => ''
]
],
'order_item_quantity' => 0,
'order_item_variant_id' => '',
'order_item_weight' => ''
]
],
'params' => '',
'shipp_address_1' => '',
'shipp_city' => '',
'shipp_country' => '',
'shipp_postcode' => '',
'shipp_state' => '',
'store_id' => '',
'warehouse_id' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/order.preestimate_shipping.list.json', [
'body' => '{
"customer_email": "",
"customer_id": "",
"exclude": "",
"order_item": [
{
"order_item_id": "",
"order_item_model": "",
"order_item_option": [
{
"order_item_option_id": "",
"order_item_option_name": "",
"order_item_option_used_in_combinations": false,
"order_item_option_value": "",
"order_item_option_value_id": ""
}
],
"order_item_quantity": 0,
"order_item_variant_id": "",
"order_item_weight": ""
}
],
"params": "",
"shipp_address_1": "",
"shipp_city": "",
"shipp_country": "",
"shipp_postcode": "",
"shipp_state": "",
"store_id": "",
"warehouse_id": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/order.preestimate_shipping.list.json');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'customer_email' => '',
'customer_id' => '',
'exclude' => '',
'order_item' => [
[
'order_item_id' => '',
'order_item_model' => '',
'order_item_option' => [
[
'order_item_option_id' => '',
'order_item_option_name' => '',
'order_item_option_used_in_combinations' => null,
'order_item_option_value' => '',
'order_item_option_value_id' => ''
]
],
'order_item_quantity' => 0,
'order_item_variant_id' => '',
'order_item_weight' => ''
]
],
'params' => '',
'shipp_address_1' => '',
'shipp_city' => '',
'shipp_country' => '',
'shipp_postcode' => '',
'shipp_state' => '',
'store_id' => '',
'warehouse_id' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'customer_email' => '',
'customer_id' => '',
'exclude' => '',
'order_item' => [
[
'order_item_id' => '',
'order_item_model' => '',
'order_item_option' => [
[
'order_item_option_id' => '',
'order_item_option_name' => '',
'order_item_option_used_in_combinations' => null,
'order_item_option_value' => '',
'order_item_option_value_id' => ''
]
],
'order_item_quantity' => 0,
'order_item_variant_id' => '',
'order_item_weight' => ''
]
],
'params' => '',
'shipp_address_1' => '',
'shipp_city' => '',
'shipp_country' => '',
'shipp_postcode' => '',
'shipp_state' => '',
'store_id' => '',
'warehouse_id' => ''
]));
$request->setRequestUrl('{{baseUrl}}/order.preestimate_shipping.list.json');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/order.preestimate_shipping.list.json' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"customer_email": "",
"customer_id": "",
"exclude": "",
"order_item": [
{
"order_item_id": "",
"order_item_model": "",
"order_item_option": [
{
"order_item_option_id": "",
"order_item_option_name": "",
"order_item_option_used_in_combinations": false,
"order_item_option_value": "",
"order_item_option_value_id": ""
}
],
"order_item_quantity": 0,
"order_item_variant_id": "",
"order_item_weight": ""
}
],
"params": "",
"shipp_address_1": "",
"shipp_city": "",
"shipp_country": "",
"shipp_postcode": "",
"shipp_state": "",
"store_id": "",
"warehouse_id": ""
}'
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/order.preestimate_shipping.list.json' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"customer_email": "",
"customer_id": "",
"exclude": "",
"order_item": [
{
"order_item_id": "",
"order_item_model": "",
"order_item_option": [
{
"order_item_option_id": "",
"order_item_option_name": "",
"order_item_option_used_in_combinations": false,
"order_item_option_value": "",
"order_item_option_value_id": ""
}
],
"order_item_quantity": 0,
"order_item_variant_id": "",
"order_item_weight": ""
}
],
"params": "",
"shipp_address_1": "",
"shipp_city": "",
"shipp_country": "",
"shipp_postcode": "",
"shipp_state": "",
"store_id": "",
"warehouse_id": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"customer_email\": \"\",\n \"customer_id\": \"\",\n \"exclude\": \"\",\n \"order_item\": [\n {\n \"order_item_id\": \"\",\n \"order_item_model\": \"\",\n \"order_item_option\": [\n {\n \"order_item_option_id\": \"\",\n \"order_item_option_name\": \"\",\n \"order_item_option_used_in_combinations\": false,\n \"order_item_option_value\": \"\",\n \"order_item_option_value_id\": \"\"\n }\n ],\n \"order_item_quantity\": 0,\n \"order_item_variant_id\": \"\",\n \"order_item_weight\": \"\"\n }\n ],\n \"params\": \"\",\n \"shipp_address_1\": \"\",\n \"shipp_city\": \"\",\n \"shipp_country\": \"\",\n \"shipp_postcode\": \"\",\n \"shipp_state\": \"\",\n \"store_id\": \"\",\n \"warehouse_id\": \"\"\n}"
headers = {
'x-api-key': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/order.preestimate_shipping.list.json", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/order.preestimate_shipping.list.json"
payload = {
"customer_email": "",
"customer_id": "",
"exclude": "",
"order_item": [
{
"order_item_id": "",
"order_item_model": "",
"order_item_option": [
{
"order_item_option_id": "",
"order_item_option_name": "",
"order_item_option_used_in_combinations": False,
"order_item_option_value": "",
"order_item_option_value_id": ""
}
],
"order_item_quantity": 0,
"order_item_variant_id": "",
"order_item_weight": ""
}
],
"params": "",
"shipp_address_1": "",
"shipp_city": "",
"shipp_country": "",
"shipp_postcode": "",
"shipp_state": "",
"store_id": "",
"warehouse_id": ""
}
headers = {
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/order.preestimate_shipping.list.json"
payload <- "{\n \"customer_email\": \"\",\n \"customer_id\": \"\",\n \"exclude\": \"\",\n \"order_item\": [\n {\n \"order_item_id\": \"\",\n \"order_item_model\": \"\",\n \"order_item_option\": [\n {\n \"order_item_option_id\": \"\",\n \"order_item_option_name\": \"\",\n \"order_item_option_used_in_combinations\": false,\n \"order_item_option_value\": \"\",\n \"order_item_option_value_id\": \"\"\n }\n ],\n \"order_item_quantity\": 0,\n \"order_item_variant_id\": \"\",\n \"order_item_weight\": \"\"\n }\n ],\n \"params\": \"\",\n \"shipp_address_1\": \"\",\n \"shipp_city\": \"\",\n \"shipp_country\": \"\",\n \"shipp_postcode\": \"\",\n \"shipp_state\": \"\",\n \"store_id\": \"\",\n \"warehouse_id\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/order.preestimate_shipping.list.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"customer_email\": \"\",\n \"customer_id\": \"\",\n \"exclude\": \"\",\n \"order_item\": [\n {\n \"order_item_id\": \"\",\n \"order_item_model\": \"\",\n \"order_item_option\": [\n {\n \"order_item_option_id\": \"\",\n \"order_item_option_name\": \"\",\n \"order_item_option_used_in_combinations\": false,\n \"order_item_option_value\": \"\",\n \"order_item_option_value_id\": \"\"\n }\n ],\n \"order_item_quantity\": 0,\n \"order_item_variant_id\": \"\",\n \"order_item_weight\": \"\"\n }\n ],\n \"params\": \"\",\n \"shipp_address_1\": \"\",\n \"shipp_city\": \"\",\n \"shipp_country\": \"\",\n \"shipp_postcode\": \"\",\n \"shipp_state\": \"\",\n \"store_id\": \"\",\n \"warehouse_id\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/order.preestimate_shipping.list.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.body = "{\n \"customer_email\": \"\",\n \"customer_id\": \"\",\n \"exclude\": \"\",\n \"order_item\": [\n {\n \"order_item_id\": \"\",\n \"order_item_model\": \"\",\n \"order_item_option\": [\n {\n \"order_item_option_id\": \"\",\n \"order_item_option_name\": \"\",\n \"order_item_option_used_in_combinations\": false,\n \"order_item_option_value\": \"\",\n \"order_item_option_value_id\": \"\"\n }\n ],\n \"order_item_quantity\": 0,\n \"order_item_variant_id\": \"\",\n \"order_item_weight\": \"\"\n }\n ],\n \"params\": \"\",\n \"shipp_address_1\": \"\",\n \"shipp_city\": \"\",\n \"shipp_country\": \"\",\n \"shipp_postcode\": \"\",\n \"shipp_state\": \"\",\n \"store_id\": \"\",\n \"warehouse_id\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/order.preestimate_shipping.list.json";
let payload = json!({
"customer_email": "",
"customer_id": "",
"exclude": "",
"order_item": (
json!({
"order_item_id": "",
"order_item_model": "",
"order_item_option": (
json!({
"order_item_option_id": "",
"order_item_option_name": "",
"order_item_option_used_in_combinations": false,
"order_item_option_value": "",
"order_item_option_value_id": ""
})
),
"order_item_quantity": 0,
"order_item_variant_id": "",
"order_item_weight": ""
})
),
"params": "",
"shipp_address_1": "",
"shipp_city": "",
"shipp_country": "",
"shipp_postcode": "",
"shipp_state": "",
"store_id": "",
"warehouse_id": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/order.preestimate_shipping.list.json \
--header 'content-type: application/json' \
--header 'x-api-key: {{apiKey}}' \
--data '{
"customer_email": "",
"customer_id": "",
"exclude": "",
"order_item": [
{
"order_item_id": "",
"order_item_model": "",
"order_item_option": [
{
"order_item_option_id": "",
"order_item_option_name": "",
"order_item_option_used_in_combinations": false,
"order_item_option_value": "",
"order_item_option_value_id": ""
}
],
"order_item_quantity": 0,
"order_item_variant_id": "",
"order_item_weight": ""
}
],
"params": "",
"shipp_address_1": "",
"shipp_city": "",
"shipp_country": "",
"shipp_postcode": "",
"shipp_state": "",
"store_id": "",
"warehouse_id": ""
}'
echo '{
"customer_email": "",
"customer_id": "",
"exclude": "",
"order_item": [
{
"order_item_id": "",
"order_item_model": "",
"order_item_option": [
{
"order_item_option_id": "",
"order_item_option_name": "",
"order_item_option_used_in_combinations": false,
"order_item_option_value": "",
"order_item_option_value_id": ""
}
],
"order_item_quantity": 0,
"order_item_variant_id": "",
"order_item_weight": ""
}
],
"params": "",
"shipp_address_1": "",
"shipp_city": "",
"shipp_country": "",
"shipp_postcode": "",
"shipp_state": "",
"store_id": "",
"warehouse_id": ""
}' | \
http POST {{baseUrl}}/order.preestimate_shipping.list.json \
content-type:application/json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "customer_email": "",\n "customer_id": "",\n "exclude": "",\n "order_item": [\n {\n "order_item_id": "",\n "order_item_model": "",\n "order_item_option": [\n {\n "order_item_option_id": "",\n "order_item_option_name": "",\n "order_item_option_used_in_combinations": false,\n "order_item_option_value": "",\n "order_item_option_value_id": ""\n }\n ],\n "order_item_quantity": 0,\n "order_item_variant_id": "",\n "order_item_weight": ""\n }\n ],\n "params": "",\n "shipp_address_1": "",\n "shipp_city": "",\n "shipp_country": "",\n "shipp_postcode": "",\n "shipp_state": "",\n "store_id": "",\n "warehouse_id": ""\n}' \
--output-document \
- {{baseUrl}}/order.preestimate_shipping.list.json
import Foundation
let headers = [
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"customer_email": "",
"customer_id": "",
"exclude": "",
"order_item": [
[
"order_item_id": "",
"order_item_model": "",
"order_item_option": [
[
"order_item_option_id": "",
"order_item_option_name": "",
"order_item_option_used_in_combinations": false,
"order_item_option_value": "",
"order_item_option_value_id": ""
]
],
"order_item_quantity": 0,
"order_item_variant_id": "",
"order_item_weight": ""
]
],
"params": "",
"shipp_address_1": "",
"shipp_city": "",
"shipp_country": "",
"shipp_postcode": "",
"shipp_state": "",
"store_id": "",
"warehouse_id": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/order.preestimate_shipping.list.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
OrderRefundAdd
{{baseUrl}}/order.refund.add.json
HEADERS
x-api-key
{{apiKey}}
BODY json
{
"date": "",
"fee_price": "",
"is_online": false,
"item_restock": false,
"items": [
{
"order_product_id": "",
"price": "",
"quantity": 0
}
],
"message": "",
"order_id": "",
"send_notifications": false,
"shipping_price": "",
"total_price": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/order.refund.add.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"date\": \"\",\n \"fee_price\": \"\",\n \"is_online\": false,\n \"item_restock\": false,\n \"items\": [\n {\n \"order_product_id\": \"\",\n \"price\": \"\",\n \"quantity\": 0\n }\n ],\n \"message\": \"\",\n \"order_id\": \"\",\n \"send_notifications\": false,\n \"shipping_price\": \"\",\n \"total_price\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/order.refund.add.json" {:headers {:x-api-key "{{apiKey}}"}
:content-type :json
:form-params {:date ""
:fee_price ""
:is_online false
:item_restock false
:items [{:order_product_id ""
:price ""
:quantity 0}]
:message ""
:order_id ""
:send_notifications false
:shipping_price ""
:total_price ""}})
require "http/client"
url = "{{baseUrl}}/order.refund.add.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"date\": \"\",\n \"fee_price\": \"\",\n \"is_online\": false,\n \"item_restock\": false,\n \"items\": [\n {\n \"order_product_id\": \"\",\n \"price\": \"\",\n \"quantity\": 0\n }\n ],\n \"message\": \"\",\n \"order_id\": \"\",\n \"send_notifications\": false,\n \"shipping_price\": \"\",\n \"total_price\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/order.refund.add.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
Content = new StringContent("{\n \"date\": \"\",\n \"fee_price\": \"\",\n \"is_online\": false,\n \"item_restock\": false,\n \"items\": [\n {\n \"order_product_id\": \"\",\n \"price\": \"\",\n \"quantity\": 0\n }\n ],\n \"message\": \"\",\n \"order_id\": \"\",\n \"send_notifications\": false,\n \"shipping_price\": \"\",\n \"total_price\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/order.refund.add.json");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"date\": \"\",\n \"fee_price\": \"\",\n \"is_online\": false,\n \"item_restock\": false,\n \"items\": [\n {\n \"order_product_id\": \"\",\n \"price\": \"\",\n \"quantity\": 0\n }\n ],\n \"message\": \"\",\n \"order_id\": \"\",\n \"send_notifications\": false,\n \"shipping_price\": \"\",\n \"total_price\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/order.refund.add.json"
payload := strings.NewReader("{\n \"date\": \"\",\n \"fee_price\": \"\",\n \"is_online\": false,\n \"item_restock\": false,\n \"items\": [\n {\n \"order_product_id\": \"\",\n \"price\": \"\",\n \"quantity\": 0\n }\n ],\n \"message\": \"\",\n \"order_id\": \"\",\n \"send_notifications\": false,\n \"shipping_price\": \"\",\n \"total_price\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/order.refund.add.json HTTP/1.1
X-Api-Key: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 292
{
"date": "",
"fee_price": "",
"is_online": false,
"item_restock": false,
"items": [
{
"order_product_id": "",
"price": "",
"quantity": 0
}
],
"message": "",
"order_id": "",
"send_notifications": false,
"shipping_price": "",
"total_price": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/order.refund.add.json")
.setHeader("x-api-key", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"date\": \"\",\n \"fee_price\": \"\",\n \"is_online\": false,\n \"item_restock\": false,\n \"items\": [\n {\n \"order_product_id\": \"\",\n \"price\": \"\",\n \"quantity\": 0\n }\n ],\n \"message\": \"\",\n \"order_id\": \"\",\n \"send_notifications\": false,\n \"shipping_price\": \"\",\n \"total_price\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/order.refund.add.json"))
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"date\": \"\",\n \"fee_price\": \"\",\n \"is_online\": false,\n \"item_restock\": false,\n \"items\": [\n {\n \"order_product_id\": \"\",\n \"price\": \"\",\n \"quantity\": 0\n }\n ],\n \"message\": \"\",\n \"order_id\": \"\",\n \"send_notifications\": false,\n \"shipping_price\": \"\",\n \"total_price\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"date\": \"\",\n \"fee_price\": \"\",\n \"is_online\": false,\n \"item_restock\": false,\n \"items\": [\n {\n \"order_product_id\": \"\",\n \"price\": \"\",\n \"quantity\": 0\n }\n ],\n \"message\": \"\",\n \"order_id\": \"\",\n \"send_notifications\": false,\n \"shipping_price\": \"\",\n \"total_price\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/order.refund.add.json")
.post(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/order.refund.add.json")
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"date\": \"\",\n \"fee_price\": \"\",\n \"is_online\": false,\n \"item_restock\": false,\n \"items\": [\n {\n \"order_product_id\": \"\",\n \"price\": \"\",\n \"quantity\": 0\n }\n ],\n \"message\": \"\",\n \"order_id\": \"\",\n \"send_notifications\": false,\n \"shipping_price\": \"\",\n \"total_price\": \"\"\n}")
.asString();
const data = JSON.stringify({
date: '',
fee_price: '',
is_online: false,
item_restock: false,
items: [
{
order_product_id: '',
price: '',
quantity: 0
}
],
message: '',
order_id: '',
send_notifications: false,
shipping_price: '',
total_price: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/order.refund.add.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/order.refund.add.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {
date: '',
fee_price: '',
is_online: false,
item_restock: false,
items: [{order_product_id: '', price: '', quantity: 0}],
message: '',
order_id: '',
send_notifications: false,
shipping_price: '',
total_price: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/order.refund.add.json';
const options = {
method: 'POST',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"date":"","fee_price":"","is_online":false,"item_restock":false,"items":[{"order_product_id":"","price":"","quantity":0}],"message":"","order_id":"","send_notifications":false,"shipping_price":"","total_price":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/order.refund.add.json',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "date": "",\n "fee_price": "",\n "is_online": false,\n "item_restock": false,\n "items": [\n {\n "order_product_id": "",\n "price": "",\n "quantity": 0\n }\n ],\n "message": "",\n "order_id": "",\n "send_notifications": false,\n "shipping_price": "",\n "total_price": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"date\": \"\",\n \"fee_price\": \"\",\n \"is_online\": false,\n \"item_restock\": false,\n \"items\": [\n {\n \"order_product_id\": \"\",\n \"price\": \"\",\n \"quantity\": 0\n }\n ],\n \"message\": \"\",\n \"order_id\": \"\",\n \"send_notifications\": false,\n \"shipping_price\": \"\",\n \"total_price\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/order.refund.add.json")
.post(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/order.refund.add.json',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
date: '',
fee_price: '',
is_online: false,
item_restock: false,
items: [{order_product_id: '', price: '', quantity: 0}],
message: '',
order_id: '',
send_notifications: false,
shipping_price: '',
total_price: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/order.refund.add.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: {
date: '',
fee_price: '',
is_online: false,
item_restock: false,
items: [{order_product_id: '', price: '', quantity: 0}],
message: '',
order_id: '',
send_notifications: false,
shipping_price: '',
total_price: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/order.refund.add.json');
req.headers({
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
date: '',
fee_price: '',
is_online: false,
item_restock: false,
items: [
{
order_product_id: '',
price: '',
quantity: 0
}
],
message: '',
order_id: '',
send_notifications: false,
shipping_price: '',
total_price: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/order.refund.add.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {
date: '',
fee_price: '',
is_online: false,
item_restock: false,
items: [{order_product_id: '', price: '', quantity: 0}],
message: '',
order_id: '',
send_notifications: false,
shipping_price: '',
total_price: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/order.refund.add.json';
const options = {
method: 'POST',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"date":"","fee_price":"","is_online":false,"item_restock":false,"items":[{"order_product_id":"","price":"","quantity":0}],"message":"","order_id":"","send_notifications":false,"shipping_price":"","total_price":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"date": @"",
@"fee_price": @"",
@"is_online": @NO,
@"item_restock": @NO,
@"items": @[ @{ @"order_product_id": @"", @"price": @"", @"quantity": @0 } ],
@"message": @"",
@"order_id": @"",
@"send_notifications": @NO,
@"shipping_price": @"",
@"total_price": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/order.refund.add.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/order.refund.add.json" in
let headers = Header.add_list (Header.init ()) [
("x-api-key", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"date\": \"\",\n \"fee_price\": \"\",\n \"is_online\": false,\n \"item_restock\": false,\n \"items\": [\n {\n \"order_product_id\": \"\",\n \"price\": \"\",\n \"quantity\": 0\n }\n ],\n \"message\": \"\",\n \"order_id\": \"\",\n \"send_notifications\": false,\n \"shipping_price\": \"\",\n \"total_price\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/order.refund.add.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'date' => '',
'fee_price' => '',
'is_online' => null,
'item_restock' => null,
'items' => [
[
'order_product_id' => '',
'price' => '',
'quantity' => 0
]
],
'message' => '',
'order_id' => '',
'send_notifications' => null,
'shipping_price' => '',
'total_price' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/order.refund.add.json', [
'body' => '{
"date": "",
"fee_price": "",
"is_online": false,
"item_restock": false,
"items": [
{
"order_product_id": "",
"price": "",
"quantity": 0
}
],
"message": "",
"order_id": "",
"send_notifications": false,
"shipping_price": "",
"total_price": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/order.refund.add.json');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'date' => '',
'fee_price' => '',
'is_online' => null,
'item_restock' => null,
'items' => [
[
'order_product_id' => '',
'price' => '',
'quantity' => 0
]
],
'message' => '',
'order_id' => '',
'send_notifications' => null,
'shipping_price' => '',
'total_price' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'date' => '',
'fee_price' => '',
'is_online' => null,
'item_restock' => null,
'items' => [
[
'order_product_id' => '',
'price' => '',
'quantity' => 0
]
],
'message' => '',
'order_id' => '',
'send_notifications' => null,
'shipping_price' => '',
'total_price' => ''
]));
$request->setRequestUrl('{{baseUrl}}/order.refund.add.json');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/order.refund.add.json' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"date": "",
"fee_price": "",
"is_online": false,
"item_restock": false,
"items": [
{
"order_product_id": "",
"price": "",
"quantity": 0
}
],
"message": "",
"order_id": "",
"send_notifications": false,
"shipping_price": "",
"total_price": ""
}'
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/order.refund.add.json' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"date": "",
"fee_price": "",
"is_online": false,
"item_restock": false,
"items": [
{
"order_product_id": "",
"price": "",
"quantity": 0
}
],
"message": "",
"order_id": "",
"send_notifications": false,
"shipping_price": "",
"total_price": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"date\": \"\",\n \"fee_price\": \"\",\n \"is_online\": false,\n \"item_restock\": false,\n \"items\": [\n {\n \"order_product_id\": \"\",\n \"price\": \"\",\n \"quantity\": 0\n }\n ],\n \"message\": \"\",\n \"order_id\": \"\",\n \"send_notifications\": false,\n \"shipping_price\": \"\",\n \"total_price\": \"\"\n}"
headers = {
'x-api-key': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/order.refund.add.json", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/order.refund.add.json"
payload = {
"date": "",
"fee_price": "",
"is_online": False,
"item_restock": False,
"items": [
{
"order_product_id": "",
"price": "",
"quantity": 0
}
],
"message": "",
"order_id": "",
"send_notifications": False,
"shipping_price": "",
"total_price": ""
}
headers = {
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/order.refund.add.json"
payload <- "{\n \"date\": \"\",\n \"fee_price\": \"\",\n \"is_online\": false,\n \"item_restock\": false,\n \"items\": [\n {\n \"order_product_id\": \"\",\n \"price\": \"\",\n \"quantity\": 0\n }\n ],\n \"message\": \"\",\n \"order_id\": \"\",\n \"send_notifications\": false,\n \"shipping_price\": \"\",\n \"total_price\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/order.refund.add.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"date\": \"\",\n \"fee_price\": \"\",\n \"is_online\": false,\n \"item_restock\": false,\n \"items\": [\n {\n \"order_product_id\": \"\",\n \"price\": \"\",\n \"quantity\": 0\n }\n ],\n \"message\": \"\",\n \"order_id\": \"\",\n \"send_notifications\": false,\n \"shipping_price\": \"\",\n \"total_price\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/order.refund.add.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.body = "{\n \"date\": \"\",\n \"fee_price\": \"\",\n \"is_online\": false,\n \"item_restock\": false,\n \"items\": [\n {\n \"order_product_id\": \"\",\n \"price\": \"\",\n \"quantity\": 0\n }\n ],\n \"message\": \"\",\n \"order_id\": \"\",\n \"send_notifications\": false,\n \"shipping_price\": \"\",\n \"total_price\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/order.refund.add.json";
let payload = json!({
"date": "",
"fee_price": "",
"is_online": false,
"item_restock": false,
"items": (
json!({
"order_product_id": "",
"price": "",
"quantity": 0
})
),
"message": "",
"order_id": "",
"send_notifications": false,
"shipping_price": "",
"total_price": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/order.refund.add.json \
--header 'content-type: application/json' \
--header 'x-api-key: {{apiKey}}' \
--data '{
"date": "",
"fee_price": "",
"is_online": false,
"item_restock": false,
"items": [
{
"order_product_id": "",
"price": "",
"quantity": 0
}
],
"message": "",
"order_id": "",
"send_notifications": false,
"shipping_price": "",
"total_price": ""
}'
echo '{
"date": "",
"fee_price": "",
"is_online": false,
"item_restock": false,
"items": [
{
"order_product_id": "",
"price": "",
"quantity": 0
}
],
"message": "",
"order_id": "",
"send_notifications": false,
"shipping_price": "",
"total_price": ""
}' | \
http POST {{baseUrl}}/order.refund.add.json \
content-type:application/json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "date": "",\n "fee_price": "",\n "is_online": false,\n "item_restock": false,\n "items": [\n {\n "order_product_id": "",\n "price": "",\n "quantity": 0\n }\n ],\n "message": "",\n "order_id": "",\n "send_notifications": false,\n "shipping_price": "",\n "total_price": ""\n}' \
--output-document \
- {{baseUrl}}/order.refund.add.json
import Foundation
let headers = [
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"date": "",
"fee_price": "",
"is_online": false,
"item_restock": false,
"items": [
[
"order_product_id": "",
"price": "",
"quantity": 0
]
],
"message": "",
"order_id": "",
"send_notifications": false,
"shipping_price": "",
"total_price": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/order.refund.add.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
OrderShipmentAdd
{{baseUrl}}/order.shipment.add.json
HEADERS
x-api-key
{{apiKey}}
BODY json
{
"adjust_stock": false,
"enable_cache": false,
"is_shipped": false,
"items": [
{
"order_product_id": "",
"quantity": ""
}
],
"order_id": "",
"send_notifications": false,
"shipment_provider": "",
"shipping_method": "",
"store_id": "",
"tracking_link": "",
"tracking_numbers": [
{
"carrier_id": "",
"tracking_number": ""
}
],
"warehouse_id": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/order.shipment.add.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"adjust_stock\": false,\n \"enable_cache\": false,\n \"is_shipped\": false,\n \"items\": [\n {\n \"order_product_id\": \"\",\n \"quantity\": \"\"\n }\n ],\n \"order_id\": \"\",\n \"send_notifications\": false,\n \"shipment_provider\": \"\",\n \"shipping_method\": \"\",\n \"store_id\": \"\",\n \"tracking_link\": \"\",\n \"tracking_numbers\": [\n {\n \"carrier_id\": \"\",\n \"tracking_number\": \"\"\n }\n ],\n \"warehouse_id\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/order.shipment.add.json" {:headers {:x-api-key "{{apiKey}}"}
:content-type :json
:form-params {:adjust_stock false
:enable_cache false
:is_shipped false
:items [{:order_product_id ""
:quantity ""}]
:order_id ""
:send_notifications false
:shipment_provider ""
:shipping_method ""
:store_id ""
:tracking_link ""
:tracking_numbers [{:carrier_id ""
:tracking_number ""}]
:warehouse_id ""}})
require "http/client"
url = "{{baseUrl}}/order.shipment.add.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"adjust_stock\": false,\n \"enable_cache\": false,\n \"is_shipped\": false,\n \"items\": [\n {\n \"order_product_id\": \"\",\n \"quantity\": \"\"\n }\n ],\n \"order_id\": \"\",\n \"send_notifications\": false,\n \"shipment_provider\": \"\",\n \"shipping_method\": \"\",\n \"store_id\": \"\",\n \"tracking_link\": \"\",\n \"tracking_numbers\": [\n {\n \"carrier_id\": \"\",\n \"tracking_number\": \"\"\n }\n ],\n \"warehouse_id\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/order.shipment.add.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
Content = new StringContent("{\n \"adjust_stock\": false,\n \"enable_cache\": false,\n \"is_shipped\": false,\n \"items\": [\n {\n \"order_product_id\": \"\",\n \"quantity\": \"\"\n }\n ],\n \"order_id\": \"\",\n \"send_notifications\": false,\n \"shipment_provider\": \"\",\n \"shipping_method\": \"\",\n \"store_id\": \"\",\n \"tracking_link\": \"\",\n \"tracking_numbers\": [\n {\n \"carrier_id\": \"\",\n \"tracking_number\": \"\"\n }\n ],\n \"warehouse_id\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/order.shipment.add.json");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"adjust_stock\": false,\n \"enable_cache\": false,\n \"is_shipped\": false,\n \"items\": [\n {\n \"order_product_id\": \"\",\n \"quantity\": \"\"\n }\n ],\n \"order_id\": \"\",\n \"send_notifications\": false,\n \"shipment_provider\": \"\",\n \"shipping_method\": \"\",\n \"store_id\": \"\",\n \"tracking_link\": \"\",\n \"tracking_numbers\": [\n {\n \"carrier_id\": \"\",\n \"tracking_number\": \"\"\n }\n ],\n \"warehouse_id\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/order.shipment.add.json"
payload := strings.NewReader("{\n \"adjust_stock\": false,\n \"enable_cache\": false,\n \"is_shipped\": false,\n \"items\": [\n {\n \"order_product_id\": \"\",\n \"quantity\": \"\"\n }\n ],\n \"order_id\": \"\",\n \"send_notifications\": false,\n \"shipment_provider\": \"\",\n \"shipping_method\": \"\",\n \"store_id\": \"\",\n \"tracking_link\": \"\",\n \"tracking_numbers\": [\n {\n \"carrier_id\": \"\",\n \"tracking_number\": \"\"\n }\n ],\n \"warehouse_id\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/order.shipment.add.json HTTP/1.1
X-Api-Key: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 413
{
"adjust_stock": false,
"enable_cache": false,
"is_shipped": false,
"items": [
{
"order_product_id": "",
"quantity": ""
}
],
"order_id": "",
"send_notifications": false,
"shipment_provider": "",
"shipping_method": "",
"store_id": "",
"tracking_link": "",
"tracking_numbers": [
{
"carrier_id": "",
"tracking_number": ""
}
],
"warehouse_id": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/order.shipment.add.json")
.setHeader("x-api-key", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"adjust_stock\": false,\n \"enable_cache\": false,\n \"is_shipped\": false,\n \"items\": [\n {\n \"order_product_id\": \"\",\n \"quantity\": \"\"\n }\n ],\n \"order_id\": \"\",\n \"send_notifications\": false,\n \"shipment_provider\": \"\",\n \"shipping_method\": \"\",\n \"store_id\": \"\",\n \"tracking_link\": \"\",\n \"tracking_numbers\": [\n {\n \"carrier_id\": \"\",\n \"tracking_number\": \"\"\n }\n ],\n \"warehouse_id\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/order.shipment.add.json"))
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"adjust_stock\": false,\n \"enable_cache\": false,\n \"is_shipped\": false,\n \"items\": [\n {\n \"order_product_id\": \"\",\n \"quantity\": \"\"\n }\n ],\n \"order_id\": \"\",\n \"send_notifications\": false,\n \"shipment_provider\": \"\",\n \"shipping_method\": \"\",\n \"store_id\": \"\",\n \"tracking_link\": \"\",\n \"tracking_numbers\": [\n {\n \"carrier_id\": \"\",\n \"tracking_number\": \"\"\n }\n ],\n \"warehouse_id\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"adjust_stock\": false,\n \"enable_cache\": false,\n \"is_shipped\": false,\n \"items\": [\n {\n \"order_product_id\": \"\",\n \"quantity\": \"\"\n }\n ],\n \"order_id\": \"\",\n \"send_notifications\": false,\n \"shipment_provider\": \"\",\n \"shipping_method\": \"\",\n \"store_id\": \"\",\n \"tracking_link\": \"\",\n \"tracking_numbers\": [\n {\n \"carrier_id\": \"\",\n \"tracking_number\": \"\"\n }\n ],\n \"warehouse_id\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/order.shipment.add.json")
.post(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/order.shipment.add.json")
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"adjust_stock\": false,\n \"enable_cache\": false,\n \"is_shipped\": false,\n \"items\": [\n {\n \"order_product_id\": \"\",\n \"quantity\": \"\"\n }\n ],\n \"order_id\": \"\",\n \"send_notifications\": false,\n \"shipment_provider\": \"\",\n \"shipping_method\": \"\",\n \"store_id\": \"\",\n \"tracking_link\": \"\",\n \"tracking_numbers\": [\n {\n \"carrier_id\": \"\",\n \"tracking_number\": \"\"\n }\n ],\n \"warehouse_id\": \"\"\n}")
.asString();
const data = JSON.stringify({
adjust_stock: false,
enable_cache: false,
is_shipped: false,
items: [
{
order_product_id: '',
quantity: ''
}
],
order_id: '',
send_notifications: false,
shipment_provider: '',
shipping_method: '',
store_id: '',
tracking_link: '',
tracking_numbers: [
{
carrier_id: '',
tracking_number: ''
}
],
warehouse_id: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/order.shipment.add.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/order.shipment.add.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {
adjust_stock: false,
enable_cache: false,
is_shipped: false,
items: [{order_product_id: '', quantity: ''}],
order_id: '',
send_notifications: false,
shipment_provider: '',
shipping_method: '',
store_id: '',
tracking_link: '',
tracking_numbers: [{carrier_id: '', tracking_number: ''}],
warehouse_id: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/order.shipment.add.json';
const options = {
method: 'POST',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"adjust_stock":false,"enable_cache":false,"is_shipped":false,"items":[{"order_product_id":"","quantity":""}],"order_id":"","send_notifications":false,"shipment_provider":"","shipping_method":"","store_id":"","tracking_link":"","tracking_numbers":[{"carrier_id":"","tracking_number":""}],"warehouse_id":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/order.shipment.add.json',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "adjust_stock": false,\n "enable_cache": false,\n "is_shipped": false,\n "items": [\n {\n "order_product_id": "",\n "quantity": ""\n }\n ],\n "order_id": "",\n "send_notifications": false,\n "shipment_provider": "",\n "shipping_method": "",\n "store_id": "",\n "tracking_link": "",\n "tracking_numbers": [\n {\n "carrier_id": "",\n "tracking_number": ""\n }\n ],\n "warehouse_id": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"adjust_stock\": false,\n \"enable_cache\": false,\n \"is_shipped\": false,\n \"items\": [\n {\n \"order_product_id\": \"\",\n \"quantity\": \"\"\n }\n ],\n \"order_id\": \"\",\n \"send_notifications\": false,\n \"shipment_provider\": \"\",\n \"shipping_method\": \"\",\n \"store_id\": \"\",\n \"tracking_link\": \"\",\n \"tracking_numbers\": [\n {\n \"carrier_id\": \"\",\n \"tracking_number\": \"\"\n }\n ],\n \"warehouse_id\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/order.shipment.add.json")
.post(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/order.shipment.add.json',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
adjust_stock: false,
enable_cache: false,
is_shipped: false,
items: [{order_product_id: '', quantity: ''}],
order_id: '',
send_notifications: false,
shipment_provider: '',
shipping_method: '',
store_id: '',
tracking_link: '',
tracking_numbers: [{carrier_id: '', tracking_number: ''}],
warehouse_id: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/order.shipment.add.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: {
adjust_stock: false,
enable_cache: false,
is_shipped: false,
items: [{order_product_id: '', quantity: ''}],
order_id: '',
send_notifications: false,
shipment_provider: '',
shipping_method: '',
store_id: '',
tracking_link: '',
tracking_numbers: [{carrier_id: '', tracking_number: ''}],
warehouse_id: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/order.shipment.add.json');
req.headers({
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
adjust_stock: false,
enable_cache: false,
is_shipped: false,
items: [
{
order_product_id: '',
quantity: ''
}
],
order_id: '',
send_notifications: false,
shipment_provider: '',
shipping_method: '',
store_id: '',
tracking_link: '',
tracking_numbers: [
{
carrier_id: '',
tracking_number: ''
}
],
warehouse_id: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/order.shipment.add.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {
adjust_stock: false,
enable_cache: false,
is_shipped: false,
items: [{order_product_id: '', quantity: ''}],
order_id: '',
send_notifications: false,
shipment_provider: '',
shipping_method: '',
store_id: '',
tracking_link: '',
tracking_numbers: [{carrier_id: '', tracking_number: ''}],
warehouse_id: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/order.shipment.add.json';
const options = {
method: 'POST',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"adjust_stock":false,"enable_cache":false,"is_shipped":false,"items":[{"order_product_id":"","quantity":""}],"order_id":"","send_notifications":false,"shipment_provider":"","shipping_method":"","store_id":"","tracking_link":"","tracking_numbers":[{"carrier_id":"","tracking_number":""}],"warehouse_id":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"adjust_stock": @NO,
@"enable_cache": @NO,
@"is_shipped": @NO,
@"items": @[ @{ @"order_product_id": @"", @"quantity": @"" } ],
@"order_id": @"",
@"send_notifications": @NO,
@"shipment_provider": @"",
@"shipping_method": @"",
@"store_id": @"",
@"tracking_link": @"",
@"tracking_numbers": @[ @{ @"carrier_id": @"", @"tracking_number": @"" } ],
@"warehouse_id": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/order.shipment.add.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/order.shipment.add.json" in
let headers = Header.add_list (Header.init ()) [
("x-api-key", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"adjust_stock\": false,\n \"enable_cache\": false,\n \"is_shipped\": false,\n \"items\": [\n {\n \"order_product_id\": \"\",\n \"quantity\": \"\"\n }\n ],\n \"order_id\": \"\",\n \"send_notifications\": false,\n \"shipment_provider\": \"\",\n \"shipping_method\": \"\",\n \"store_id\": \"\",\n \"tracking_link\": \"\",\n \"tracking_numbers\": [\n {\n \"carrier_id\": \"\",\n \"tracking_number\": \"\"\n }\n ],\n \"warehouse_id\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/order.shipment.add.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'adjust_stock' => null,
'enable_cache' => null,
'is_shipped' => null,
'items' => [
[
'order_product_id' => '',
'quantity' => ''
]
],
'order_id' => '',
'send_notifications' => null,
'shipment_provider' => '',
'shipping_method' => '',
'store_id' => '',
'tracking_link' => '',
'tracking_numbers' => [
[
'carrier_id' => '',
'tracking_number' => ''
]
],
'warehouse_id' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/order.shipment.add.json', [
'body' => '{
"adjust_stock": false,
"enable_cache": false,
"is_shipped": false,
"items": [
{
"order_product_id": "",
"quantity": ""
}
],
"order_id": "",
"send_notifications": false,
"shipment_provider": "",
"shipping_method": "",
"store_id": "",
"tracking_link": "",
"tracking_numbers": [
{
"carrier_id": "",
"tracking_number": ""
}
],
"warehouse_id": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/order.shipment.add.json');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'adjust_stock' => null,
'enable_cache' => null,
'is_shipped' => null,
'items' => [
[
'order_product_id' => '',
'quantity' => ''
]
],
'order_id' => '',
'send_notifications' => null,
'shipment_provider' => '',
'shipping_method' => '',
'store_id' => '',
'tracking_link' => '',
'tracking_numbers' => [
[
'carrier_id' => '',
'tracking_number' => ''
]
],
'warehouse_id' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'adjust_stock' => null,
'enable_cache' => null,
'is_shipped' => null,
'items' => [
[
'order_product_id' => '',
'quantity' => ''
]
],
'order_id' => '',
'send_notifications' => null,
'shipment_provider' => '',
'shipping_method' => '',
'store_id' => '',
'tracking_link' => '',
'tracking_numbers' => [
[
'carrier_id' => '',
'tracking_number' => ''
]
],
'warehouse_id' => ''
]));
$request->setRequestUrl('{{baseUrl}}/order.shipment.add.json');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/order.shipment.add.json' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"adjust_stock": false,
"enable_cache": false,
"is_shipped": false,
"items": [
{
"order_product_id": "",
"quantity": ""
}
],
"order_id": "",
"send_notifications": false,
"shipment_provider": "",
"shipping_method": "",
"store_id": "",
"tracking_link": "",
"tracking_numbers": [
{
"carrier_id": "",
"tracking_number": ""
}
],
"warehouse_id": ""
}'
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/order.shipment.add.json' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"adjust_stock": false,
"enable_cache": false,
"is_shipped": false,
"items": [
{
"order_product_id": "",
"quantity": ""
}
],
"order_id": "",
"send_notifications": false,
"shipment_provider": "",
"shipping_method": "",
"store_id": "",
"tracking_link": "",
"tracking_numbers": [
{
"carrier_id": "",
"tracking_number": ""
}
],
"warehouse_id": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"adjust_stock\": false,\n \"enable_cache\": false,\n \"is_shipped\": false,\n \"items\": [\n {\n \"order_product_id\": \"\",\n \"quantity\": \"\"\n }\n ],\n \"order_id\": \"\",\n \"send_notifications\": false,\n \"shipment_provider\": \"\",\n \"shipping_method\": \"\",\n \"store_id\": \"\",\n \"tracking_link\": \"\",\n \"tracking_numbers\": [\n {\n \"carrier_id\": \"\",\n \"tracking_number\": \"\"\n }\n ],\n \"warehouse_id\": \"\"\n}"
headers = {
'x-api-key': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/order.shipment.add.json", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/order.shipment.add.json"
payload = {
"adjust_stock": False,
"enable_cache": False,
"is_shipped": False,
"items": [
{
"order_product_id": "",
"quantity": ""
}
],
"order_id": "",
"send_notifications": False,
"shipment_provider": "",
"shipping_method": "",
"store_id": "",
"tracking_link": "",
"tracking_numbers": [
{
"carrier_id": "",
"tracking_number": ""
}
],
"warehouse_id": ""
}
headers = {
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/order.shipment.add.json"
payload <- "{\n \"adjust_stock\": false,\n \"enable_cache\": false,\n \"is_shipped\": false,\n \"items\": [\n {\n \"order_product_id\": \"\",\n \"quantity\": \"\"\n }\n ],\n \"order_id\": \"\",\n \"send_notifications\": false,\n \"shipment_provider\": \"\",\n \"shipping_method\": \"\",\n \"store_id\": \"\",\n \"tracking_link\": \"\",\n \"tracking_numbers\": [\n {\n \"carrier_id\": \"\",\n \"tracking_number\": \"\"\n }\n ],\n \"warehouse_id\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/order.shipment.add.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"adjust_stock\": false,\n \"enable_cache\": false,\n \"is_shipped\": false,\n \"items\": [\n {\n \"order_product_id\": \"\",\n \"quantity\": \"\"\n }\n ],\n \"order_id\": \"\",\n \"send_notifications\": false,\n \"shipment_provider\": \"\",\n \"shipping_method\": \"\",\n \"store_id\": \"\",\n \"tracking_link\": \"\",\n \"tracking_numbers\": [\n {\n \"carrier_id\": \"\",\n \"tracking_number\": \"\"\n }\n ],\n \"warehouse_id\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/order.shipment.add.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.body = "{\n \"adjust_stock\": false,\n \"enable_cache\": false,\n \"is_shipped\": false,\n \"items\": [\n {\n \"order_product_id\": \"\",\n \"quantity\": \"\"\n }\n ],\n \"order_id\": \"\",\n \"send_notifications\": false,\n \"shipment_provider\": \"\",\n \"shipping_method\": \"\",\n \"store_id\": \"\",\n \"tracking_link\": \"\",\n \"tracking_numbers\": [\n {\n \"carrier_id\": \"\",\n \"tracking_number\": \"\"\n }\n ],\n \"warehouse_id\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/order.shipment.add.json";
let payload = json!({
"adjust_stock": false,
"enable_cache": false,
"is_shipped": false,
"items": (
json!({
"order_product_id": "",
"quantity": ""
})
),
"order_id": "",
"send_notifications": false,
"shipment_provider": "",
"shipping_method": "",
"store_id": "",
"tracking_link": "",
"tracking_numbers": (
json!({
"carrier_id": "",
"tracking_number": ""
})
),
"warehouse_id": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/order.shipment.add.json \
--header 'content-type: application/json' \
--header 'x-api-key: {{apiKey}}' \
--data '{
"adjust_stock": false,
"enable_cache": false,
"is_shipped": false,
"items": [
{
"order_product_id": "",
"quantity": ""
}
],
"order_id": "",
"send_notifications": false,
"shipment_provider": "",
"shipping_method": "",
"store_id": "",
"tracking_link": "",
"tracking_numbers": [
{
"carrier_id": "",
"tracking_number": ""
}
],
"warehouse_id": ""
}'
echo '{
"adjust_stock": false,
"enable_cache": false,
"is_shipped": false,
"items": [
{
"order_product_id": "",
"quantity": ""
}
],
"order_id": "",
"send_notifications": false,
"shipment_provider": "",
"shipping_method": "",
"store_id": "",
"tracking_link": "",
"tracking_numbers": [
{
"carrier_id": "",
"tracking_number": ""
}
],
"warehouse_id": ""
}' | \
http POST {{baseUrl}}/order.shipment.add.json \
content-type:application/json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "adjust_stock": false,\n "enable_cache": false,\n "is_shipped": false,\n "items": [\n {\n "order_product_id": "",\n "quantity": ""\n }\n ],\n "order_id": "",\n "send_notifications": false,\n "shipment_provider": "",\n "shipping_method": "",\n "store_id": "",\n "tracking_link": "",\n "tracking_numbers": [\n {\n "carrier_id": "",\n "tracking_number": ""\n }\n ],\n "warehouse_id": ""\n}' \
--output-document \
- {{baseUrl}}/order.shipment.add.json
import Foundation
let headers = [
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"adjust_stock": false,
"enable_cache": false,
"is_shipped": false,
"items": [
[
"order_product_id": "",
"quantity": ""
]
],
"order_id": "",
"send_notifications": false,
"shipment_provider": "",
"shipping_method": "",
"store_id": "",
"tracking_link": "",
"tracking_numbers": [
[
"carrier_id": "",
"tracking_number": ""
]
],
"warehouse_id": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/order.shipment.add.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
DELETE
OrderShipmentDelete
{{baseUrl}}/order.shipment.delete.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
shipment_id
order_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/order.shipment.delete.json?shipment_id=&order_id=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/order.shipment.delete.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:shipment_id ""
:order_id ""}})
require "http/client"
url = "{{baseUrl}}/order.shipment.delete.json?shipment_id=&order_id="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.delete url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/order.shipment.delete.json?shipment_id=&order_id="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/order.shipment.delete.json?shipment_id=&order_id=");
var request = new RestRequest("", Method.Delete);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/order.shipment.delete.json?shipment_id=&order_id="
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/order.shipment.delete.json?shipment_id=&order_id= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/order.shipment.delete.json?shipment_id=&order_id=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/order.shipment.delete.json?shipment_id=&order_id="))
.header("x-api-key", "{{apiKey}}")
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/order.shipment.delete.json?shipment_id=&order_id=")
.delete(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/order.shipment.delete.json?shipment_id=&order_id=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/order.shipment.delete.json?shipment_id=&order_id=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/order.shipment.delete.json',
params: {shipment_id: '', order_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/order.shipment.delete.json?shipment_id=&order_id=';
const options = {method: 'DELETE', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/order.shipment.delete.json?shipment_id=&order_id=',
method: 'DELETE',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/order.shipment.delete.json?shipment_id=&order_id=")
.delete(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/order.shipment.delete.json?shipment_id=&order_id=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/order.shipment.delete.json',
qs: {shipment_id: '', order_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/order.shipment.delete.json');
req.query({
shipment_id: '',
order_id: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/order.shipment.delete.json',
params: {shipment_id: '', order_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/order.shipment.delete.json?shipment_id=&order_id=';
const options = {method: 'DELETE', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/order.shipment.delete.json?shipment_id=&order_id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/order.shipment.delete.json?shipment_id=&order_id=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/order.shipment.delete.json?shipment_id=&order_id=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/order.shipment.delete.json?shipment_id=&order_id=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/order.shipment.delete.json');
$request->setMethod(HTTP_METH_DELETE);
$request->setQueryData([
'shipment_id' => '',
'order_id' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/order.shipment.delete.json');
$request->setRequestMethod('DELETE');
$request->setQuery(new http\QueryString([
'shipment_id' => '',
'order_id' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/order.shipment.delete.json?shipment_id=&order_id=' -Method DELETE -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/order.shipment.delete.json?shipment_id=&order_id=' -Method DELETE -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("DELETE", "/baseUrl/order.shipment.delete.json?shipment_id=&order_id=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/order.shipment.delete.json"
querystring = {"shipment_id":"","order_id":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.delete(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/order.shipment.delete.json"
queryString <- list(
shipment_id = "",
order_id = ""
)
response <- VERB("DELETE", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/order.shipment.delete.json?shipment_id=&order_id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/order.shipment.delete.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['shipment_id'] = ''
req.params['order_id'] = ''
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/order.shipment.delete.json";
let querystring = [
("shipment_id", ""),
("order_id", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url '{{baseUrl}}/order.shipment.delete.json?shipment_id=&order_id=' \
--header 'x-api-key: {{apiKey}}'
http DELETE '{{baseUrl}}/order.shipment.delete.json?shipment_id=&order_id=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method DELETE \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/order.shipment.delete.json?shipment_id=&order_id='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/order.shipment.delete.json?shipment_id=&order_id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
OrderShipmentInfo
{{baseUrl}}/order.shipment.info.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
id
order_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/order.shipment.info.json?id=&order_id=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/order.shipment.info.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:id ""
:order_id ""}})
require "http/client"
url = "{{baseUrl}}/order.shipment.info.json?id=&order_id="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/order.shipment.info.json?id=&order_id="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/order.shipment.info.json?id=&order_id=");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/order.shipment.info.json?id=&order_id="
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/order.shipment.info.json?id=&order_id= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/order.shipment.info.json?id=&order_id=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/order.shipment.info.json?id=&order_id="))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/order.shipment.info.json?id=&order_id=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/order.shipment.info.json?id=&order_id=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/order.shipment.info.json?id=&order_id=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/order.shipment.info.json',
params: {id: '', order_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/order.shipment.info.json?id=&order_id=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/order.shipment.info.json?id=&order_id=',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/order.shipment.info.json?id=&order_id=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/order.shipment.info.json?id=&order_id=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/order.shipment.info.json',
qs: {id: '', order_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/order.shipment.info.json');
req.query({
id: '',
order_id: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/order.shipment.info.json',
params: {id: '', order_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/order.shipment.info.json?id=&order_id=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/order.shipment.info.json?id=&order_id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/order.shipment.info.json?id=&order_id=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/order.shipment.info.json?id=&order_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 => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/order.shipment.info.json?id=&order_id=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/order.shipment.info.json');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'id' => '',
'order_id' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/order.shipment.info.json');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'id' => '',
'order_id' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/order.shipment.info.json?id=&order_id=' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/order.shipment.info.json?id=&order_id=' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/order.shipment.info.json?id=&order_id=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/order.shipment.info.json"
querystring = {"id":"","order_id":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/order.shipment.info.json"
queryString <- list(
id = "",
order_id = ""
)
response <- VERB("GET", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/order.shipment.info.json?id=&order_id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/order.shipment.info.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['id'] = ''
req.params['order_id'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/order.shipment.info.json";
let querystring = [
("id", ""),
("order_id", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/order.shipment.info.json?id=&order_id=' \
--header 'x-api-key: {{apiKey}}'
http GET '{{baseUrl}}/order.shipment.info.json?id=&order_id=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/order.shipment.info.json?id=&order_id='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/order.shipment.info.json?id=&order_id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
OrderShipmentList
{{baseUrl}}/order.shipment.list.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
order_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/order.shipment.list.json?order_id=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/order.shipment.list.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:order_id ""}})
require "http/client"
url = "{{baseUrl}}/order.shipment.list.json?order_id="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/order.shipment.list.json?order_id="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/order.shipment.list.json?order_id=");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/order.shipment.list.json?order_id="
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/order.shipment.list.json?order_id= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/order.shipment.list.json?order_id=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/order.shipment.list.json?order_id="))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/order.shipment.list.json?order_id=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/order.shipment.list.json?order_id=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/order.shipment.list.json?order_id=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/order.shipment.list.json',
params: {order_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/order.shipment.list.json?order_id=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/order.shipment.list.json?order_id=',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/order.shipment.list.json?order_id=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/order.shipment.list.json?order_id=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/order.shipment.list.json',
qs: {order_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/order.shipment.list.json');
req.query({
order_id: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/order.shipment.list.json',
params: {order_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/order.shipment.list.json?order_id=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/order.shipment.list.json?order_id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/order.shipment.list.json?order_id=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/order.shipment.list.json?order_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 => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/order.shipment.list.json?order_id=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/order.shipment.list.json');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'order_id' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/order.shipment.list.json');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'order_id' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/order.shipment.list.json?order_id=' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/order.shipment.list.json?order_id=' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/order.shipment.list.json?order_id=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/order.shipment.list.json"
querystring = {"order_id":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/order.shipment.list.json"
queryString <- list(order_id = "")
response <- VERB("GET", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/order.shipment.list.json?order_id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/order.shipment.list.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['order_id'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/order.shipment.list.json";
let querystring = [
("order_id", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/order.shipment.list.json?order_id=' \
--header 'x-api-key: {{apiKey}}'
http GET '{{baseUrl}}/order.shipment.list.json?order_id=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/order.shipment.list.json?order_id='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/order.shipment.list.json?order_id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
OrderShipmentTrackingAdd
{{baseUrl}}/order.shipment.tracking.add.json
HEADERS
x-api-key
{{apiKey}}
BODY json
{
"carrier_id": "",
"order_id": "",
"send_notifications": false,
"shipment_id": "",
"store_id": "",
"tracking_link": "",
"tracking_number": "",
"tracking_provider": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/order.shipment.tracking.add.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"carrier_id\": \"\",\n \"order_id\": \"\",\n \"send_notifications\": false,\n \"shipment_id\": \"\",\n \"store_id\": \"\",\n \"tracking_link\": \"\",\n \"tracking_number\": \"\",\n \"tracking_provider\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/order.shipment.tracking.add.json" {:headers {:x-api-key "{{apiKey}}"}
:content-type :json
:form-params {:carrier_id ""
:order_id ""
:send_notifications false
:shipment_id ""
:store_id ""
:tracking_link ""
:tracking_number ""
:tracking_provider ""}})
require "http/client"
url = "{{baseUrl}}/order.shipment.tracking.add.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"carrier_id\": \"\",\n \"order_id\": \"\",\n \"send_notifications\": false,\n \"shipment_id\": \"\",\n \"store_id\": \"\",\n \"tracking_link\": \"\",\n \"tracking_number\": \"\",\n \"tracking_provider\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/order.shipment.tracking.add.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
Content = new StringContent("{\n \"carrier_id\": \"\",\n \"order_id\": \"\",\n \"send_notifications\": false,\n \"shipment_id\": \"\",\n \"store_id\": \"\",\n \"tracking_link\": \"\",\n \"tracking_number\": \"\",\n \"tracking_provider\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/order.shipment.tracking.add.json");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"carrier_id\": \"\",\n \"order_id\": \"\",\n \"send_notifications\": false,\n \"shipment_id\": \"\",\n \"store_id\": \"\",\n \"tracking_link\": \"\",\n \"tracking_number\": \"\",\n \"tracking_provider\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/order.shipment.tracking.add.json"
payload := strings.NewReader("{\n \"carrier_id\": \"\",\n \"order_id\": \"\",\n \"send_notifications\": false,\n \"shipment_id\": \"\",\n \"store_id\": \"\",\n \"tracking_link\": \"\",\n \"tracking_number\": \"\",\n \"tracking_provider\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/order.shipment.tracking.add.json HTTP/1.1
X-Api-Key: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 185
{
"carrier_id": "",
"order_id": "",
"send_notifications": false,
"shipment_id": "",
"store_id": "",
"tracking_link": "",
"tracking_number": "",
"tracking_provider": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/order.shipment.tracking.add.json")
.setHeader("x-api-key", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"carrier_id\": \"\",\n \"order_id\": \"\",\n \"send_notifications\": false,\n \"shipment_id\": \"\",\n \"store_id\": \"\",\n \"tracking_link\": \"\",\n \"tracking_number\": \"\",\n \"tracking_provider\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/order.shipment.tracking.add.json"))
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"carrier_id\": \"\",\n \"order_id\": \"\",\n \"send_notifications\": false,\n \"shipment_id\": \"\",\n \"store_id\": \"\",\n \"tracking_link\": \"\",\n \"tracking_number\": \"\",\n \"tracking_provider\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"carrier_id\": \"\",\n \"order_id\": \"\",\n \"send_notifications\": false,\n \"shipment_id\": \"\",\n \"store_id\": \"\",\n \"tracking_link\": \"\",\n \"tracking_number\": \"\",\n \"tracking_provider\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/order.shipment.tracking.add.json")
.post(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/order.shipment.tracking.add.json")
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"carrier_id\": \"\",\n \"order_id\": \"\",\n \"send_notifications\": false,\n \"shipment_id\": \"\",\n \"store_id\": \"\",\n \"tracking_link\": \"\",\n \"tracking_number\": \"\",\n \"tracking_provider\": \"\"\n}")
.asString();
const data = JSON.stringify({
carrier_id: '',
order_id: '',
send_notifications: false,
shipment_id: '',
store_id: '',
tracking_link: '',
tracking_number: '',
tracking_provider: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/order.shipment.tracking.add.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/order.shipment.tracking.add.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {
carrier_id: '',
order_id: '',
send_notifications: false,
shipment_id: '',
store_id: '',
tracking_link: '',
tracking_number: '',
tracking_provider: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/order.shipment.tracking.add.json';
const options = {
method: 'POST',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"carrier_id":"","order_id":"","send_notifications":false,"shipment_id":"","store_id":"","tracking_link":"","tracking_number":"","tracking_provider":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/order.shipment.tracking.add.json',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "carrier_id": "",\n "order_id": "",\n "send_notifications": false,\n "shipment_id": "",\n "store_id": "",\n "tracking_link": "",\n "tracking_number": "",\n "tracking_provider": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"carrier_id\": \"\",\n \"order_id\": \"\",\n \"send_notifications\": false,\n \"shipment_id\": \"\",\n \"store_id\": \"\",\n \"tracking_link\": \"\",\n \"tracking_number\": \"\",\n \"tracking_provider\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/order.shipment.tracking.add.json")
.post(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/order.shipment.tracking.add.json',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
carrier_id: '',
order_id: '',
send_notifications: false,
shipment_id: '',
store_id: '',
tracking_link: '',
tracking_number: '',
tracking_provider: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/order.shipment.tracking.add.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: {
carrier_id: '',
order_id: '',
send_notifications: false,
shipment_id: '',
store_id: '',
tracking_link: '',
tracking_number: '',
tracking_provider: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/order.shipment.tracking.add.json');
req.headers({
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
carrier_id: '',
order_id: '',
send_notifications: false,
shipment_id: '',
store_id: '',
tracking_link: '',
tracking_number: '',
tracking_provider: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/order.shipment.tracking.add.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {
carrier_id: '',
order_id: '',
send_notifications: false,
shipment_id: '',
store_id: '',
tracking_link: '',
tracking_number: '',
tracking_provider: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/order.shipment.tracking.add.json';
const options = {
method: 'POST',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"carrier_id":"","order_id":"","send_notifications":false,"shipment_id":"","store_id":"","tracking_link":"","tracking_number":"","tracking_provider":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"carrier_id": @"",
@"order_id": @"",
@"send_notifications": @NO,
@"shipment_id": @"",
@"store_id": @"",
@"tracking_link": @"",
@"tracking_number": @"",
@"tracking_provider": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/order.shipment.tracking.add.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/order.shipment.tracking.add.json" in
let headers = Header.add_list (Header.init ()) [
("x-api-key", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"carrier_id\": \"\",\n \"order_id\": \"\",\n \"send_notifications\": false,\n \"shipment_id\": \"\",\n \"store_id\": \"\",\n \"tracking_link\": \"\",\n \"tracking_number\": \"\",\n \"tracking_provider\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/order.shipment.tracking.add.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'carrier_id' => '',
'order_id' => '',
'send_notifications' => null,
'shipment_id' => '',
'store_id' => '',
'tracking_link' => '',
'tracking_number' => '',
'tracking_provider' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/order.shipment.tracking.add.json', [
'body' => '{
"carrier_id": "",
"order_id": "",
"send_notifications": false,
"shipment_id": "",
"store_id": "",
"tracking_link": "",
"tracking_number": "",
"tracking_provider": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/order.shipment.tracking.add.json');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'carrier_id' => '',
'order_id' => '',
'send_notifications' => null,
'shipment_id' => '',
'store_id' => '',
'tracking_link' => '',
'tracking_number' => '',
'tracking_provider' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'carrier_id' => '',
'order_id' => '',
'send_notifications' => null,
'shipment_id' => '',
'store_id' => '',
'tracking_link' => '',
'tracking_number' => '',
'tracking_provider' => ''
]));
$request->setRequestUrl('{{baseUrl}}/order.shipment.tracking.add.json');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/order.shipment.tracking.add.json' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"carrier_id": "",
"order_id": "",
"send_notifications": false,
"shipment_id": "",
"store_id": "",
"tracking_link": "",
"tracking_number": "",
"tracking_provider": ""
}'
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/order.shipment.tracking.add.json' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"carrier_id": "",
"order_id": "",
"send_notifications": false,
"shipment_id": "",
"store_id": "",
"tracking_link": "",
"tracking_number": "",
"tracking_provider": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"carrier_id\": \"\",\n \"order_id\": \"\",\n \"send_notifications\": false,\n \"shipment_id\": \"\",\n \"store_id\": \"\",\n \"tracking_link\": \"\",\n \"tracking_number\": \"\",\n \"tracking_provider\": \"\"\n}"
headers = {
'x-api-key': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/order.shipment.tracking.add.json", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/order.shipment.tracking.add.json"
payload = {
"carrier_id": "",
"order_id": "",
"send_notifications": False,
"shipment_id": "",
"store_id": "",
"tracking_link": "",
"tracking_number": "",
"tracking_provider": ""
}
headers = {
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/order.shipment.tracking.add.json"
payload <- "{\n \"carrier_id\": \"\",\n \"order_id\": \"\",\n \"send_notifications\": false,\n \"shipment_id\": \"\",\n \"store_id\": \"\",\n \"tracking_link\": \"\",\n \"tracking_number\": \"\",\n \"tracking_provider\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/order.shipment.tracking.add.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"carrier_id\": \"\",\n \"order_id\": \"\",\n \"send_notifications\": false,\n \"shipment_id\": \"\",\n \"store_id\": \"\",\n \"tracking_link\": \"\",\n \"tracking_number\": \"\",\n \"tracking_provider\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/order.shipment.tracking.add.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.body = "{\n \"carrier_id\": \"\",\n \"order_id\": \"\",\n \"send_notifications\": false,\n \"shipment_id\": \"\",\n \"store_id\": \"\",\n \"tracking_link\": \"\",\n \"tracking_number\": \"\",\n \"tracking_provider\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/order.shipment.tracking.add.json";
let payload = json!({
"carrier_id": "",
"order_id": "",
"send_notifications": false,
"shipment_id": "",
"store_id": "",
"tracking_link": "",
"tracking_number": "",
"tracking_provider": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/order.shipment.tracking.add.json \
--header 'content-type: application/json' \
--header 'x-api-key: {{apiKey}}' \
--data '{
"carrier_id": "",
"order_id": "",
"send_notifications": false,
"shipment_id": "",
"store_id": "",
"tracking_link": "",
"tracking_number": "",
"tracking_provider": ""
}'
echo '{
"carrier_id": "",
"order_id": "",
"send_notifications": false,
"shipment_id": "",
"store_id": "",
"tracking_link": "",
"tracking_number": "",
"tracking_provider": ""
}' | \
http POST {{baseUrl}}/order.shipment.tracking.add.json \
content-type:application/json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "carrier_id": "",\n "order_id": "",\n "send_notifications": false,\n "shipment_id": "",\n "store_id": "",\n "tracking_link": "",\n "tracking_number": "",\n "tracking_provider": ""\n}' \
--output-document \
- {{baseUrl}}/order.shipment.tracking.add.json
import Foundation
let headers = [
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"carrier_id": "",
"order_id": "",
"send_notifications": false,
"shipment_id": "",
"store_id": "",
"tracking_link": "",
"tracking_number": "",
"tracking_provider": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/order.shipment.tracking.add.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PUT
OrderShipmentUpdate
{{baseUrl}}/order.shipment.update.json
HEADERS
x-api-key
{{apiKey}}
BODY json
{
"is_shipped": false,
"order_id": "",
"replace": false,
"shipment_id": "",
"store_id": "",
"tracking_link": "",
"tracking_numbers": [
{
"carrier_id": "",
"tracking_number": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/order.shipment.update.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"is_shipped\": false,\n \"order_id\": \"\",\n \"replace\": false,\n \"shipment_id\": \"\",\n \"store_id\": \"\",\n \"tracking_link\": \"\",\n \"tracking_numbers\": [\n {\n \"carrier_id\": \"\",\n \"tracking_number\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/order.shipment.update.json" {:headers {:x-api-key "{{apiKey}}"}
:content-type :json
:form-params {:is_shipped false
:order_id ""
:replace false
:shipment_id ""
:store_id ""
:tracking_link ""
:tracking_numbers [{:carrier_id ""
:tracking_number ""}]}})
require "http/client"
url = "{{baseUrl}}/order.shipment.update.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"is_shipped\": false,\n \"order_id\": \"\",\n \"replace\": false,\n \"shipment_id\": \"\",\n \"store_id\": \"\",\n \"tracking_link\": \"\",\n \"tracking_numbers\": [\n {\n \"carrier_id\": \"\",\n \"tracking_number\": \"\"\n }\n ]\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/order.shipment.update.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
Content = new StringContent("{\n \"is_shipped\": false,\n \"order_id\": \"\",\n \"replace\": false,\n \"shipment_id\": \"\",\n \"store_id\": \"\",\n \"tracking_link\": \"\",\n \"tracking_numbers\": [\n {\n \"carrier_id\": \"\",\n \"tracking_number\": \"\"\n }\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/order.shipment.update.json");
var request = new RestRequest("", Method.Put);
request.AddHeader("x-api-key", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"is_shipped\": false,\n \"order_id\": \"\",\n \"replace\": false,\n \"shipment_id\": \"\",\n \"store_id\": \"\",\n \"tracking_link\": \"\",\n \"tracking_numbers\": [\n {\n \"carrier_id\": \"\",\n \"tracking_number\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/order.shipment.update.json"
payload := strings.NewReader("{\n \"is_shipped\": false,\n \"order_id\": \"\",\n \"replace\": false,\n \"shipment_id\": \"\",\n \"store_id\": \"\",\n \"tracking_link\": \"\",\n \"tracking_numbers\": [\n {\n \"carrier_id\": \"\",\n \"tracking_number\": \"\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/order.shipment.update.json HTTP/1.1
X-Api-Key: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 218
{
"is_shipped": false,
"order_id": "",
"replace": false,
"shipment_id": "",
"store_id": "",
"tracking_link": "",
"tracking_numbers": [
{
"carrier_id": "",
"tracking_number": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/order.shipment.update.json")
.setHeader("x-api-key", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"is_shipped\": false,\n \"order_id\": \"\",\n \"replace\": false,\n \"shipment_id\": \"\",\n \"store_id\": \"\",\n \"tracking_link\": \"\",\n \"tracking_numbers\": [\n {\n \"carrier_id\": \"\",\n \"tracking_number\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/order.shipment.update.json"))
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"is_shipped\": false,\n \"order_id\": \"\",\n \"replace\": false,\n \"shipment_id\": \"\",\n \"store_id\": \"\",\n \"tracking_link\": \"\",\n \"tracking_numbers\": [\n {\n \"carrier_id\": \"\",\n \"tracking_number\": \"\"\n }\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"is_shipped\": false,\n \"order_id\": \"\",\n \"replace\": false,\n \"shipment_id\": \"\",\n \"store_id\": \"\",\n \"tracking_link\": \"\",\n \"tracking_numbers\": [\n {\n \"carrier_id\": \"\",\n \"tracking_number\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/order.shipment.update.json")
.put(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/order.shipment.update.json")
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"is_shipped\": false,\n \"order_id\": \"\",\n \"replace\": false,\n \"shipment_id\": \"\",\n \"store_id\": \"\",\n \"tracking_link\": \"\",\n \"tracking_numbers\": [\n {\n \"carrier_id\": \"\",\n \"tracking_number\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
is_shipped: false,
order_id: '',
replace: false,
shipment_id: '',
store_id: '',
tracking_link: '',
tracking_numbers: [
{
carrier_id: '',
tracking_number: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/order.shipment.update.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/order.shipment.update.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {
is_shipped: false,
order_id: '',
replace: false,
shipment_id: '',
store_id: '',
tracking_link: '',
tracking_numbers: [{carrier_id: '', tracking_number: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/order.shipment.update.json';
const options = {
method: 'PUT',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"is_shipped":false,"order_id":"","replace":false,"shipment_id":"","store_id":"","tracking_link":"","tracking_numbers":[{"carrier_id":"","tracking_number":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/order.shipment.update.json',
method: 'PUT',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "is_shipped": false,\n "order_id": "",\n "replace": false,\n "shipment_id": "",\n "store_id": "",\n "tracking_link": "",\n "tracking_numbers": [\n {\n "carrier_id": "",\n "tracking_number": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"is_shipped\": false,\n \"order_id\": \"\",\n \"replace\": false,\n \"shipment_id\": \"\",\n \"store_id\": \"\",\n \"tracking_link\": \"\",\n \"tracking_numbers\": [\n {\n \"carrier_id\": \"\",\n \"tracking_number\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/order.shipment.update.json")
.put(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/order.shipment.update.json',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
is_shipped: false,
order_id: '',
replace: false,
shipment_id: '',
store_id: '',
tracking_link: '',
tracking_numbers: [{carrier_id: '', tracking_number: ''}]
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/order.shipment.update.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: {
is_shipped: false,
order_id: '',
replace: false,
shipment_id: '',
store_id: '',
tracking_link: '',
tracking_numbers: [{carrier_id: '', tracking_number: ''}]
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/order.shipment.update.json');
req.headers({
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
is_shipped: false,
order_id: '',
replace: false,
shipment_id: '',
store_id: '',
tracking_link: '',
tracking_numbers: [
{
carrier_id: '',
tracking_number: ''
}
]
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/order.shipment.update.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {
is_shipped: false,
order_id: '',
replace: false,
shipment_id: '',
store_id: '',
tracking_link: '',
tracking_numbers: [{carrier_id: '', tracking_number: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/order.shipment.update.json';
const options = {
method: 'PUT',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"is_shipped":false,"order_id":"","replace":false,"shipment_id":"","store_id":"","tracking_link":"","tracking_numbers":[{"carrier_id":"","tracking_number":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"is_shipped": @NO,
@"order_id": @"",
@"replace": @NO,
@"shipment_id": @"",
@"store_id": @"",
@"tracking_link": @"",
@"tracking_numbers": @[ @{ @"carrier_id": @"", @"tracking_number": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/order.shipment.update.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/order.shipment.update.json" in
let headers = Header.add_list (Header.init ()) [
("x-api-key", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"is_shipped\": false,\n \"order_id\": \"\",\n \"replace\": false,\n \"shipment_id\": \"\",\n \"store_id\": \"\",\n \"tracking_link\": \"\",\n \"tracking_numbers\": [\n {\n \"carrier_id\": \"\",\n \"tracking_number\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/order.shipment.update.json",
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([
'is_shipped' => null,
'order_id' => '',
'replace' => null,
'shipment_id' => '',
'store_id' => '',
'tracking_link' => '',
'tracking_numbers' => [
[
'carrier_id' => '',
'tracking_number' => ''
]
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/order.shipment.update.json', [
'body' => '{
"is_shipped": false,
"order_id": "",
"replace": false,
"shipment_id": "",
"store_id": "",
"tracking_link": "",
"tracking_numbers": [
{
"carrier_id": "",
"tracking_number": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/order.shipment.update.json');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'is_shipped' => null,
'order_id' => '',
'replace' => null,
'shipment_id' => '',
'store_id' => '',
'tracking_link' => '',
'tracking_numbers' => [
[
'carrier_id' => '',
'tracking_number' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'is_shipped' => null,
'order_id' => '',
'replace' => null,
'shipment_id' => '',
'store_id' => '',
'tracking_link' => '',
'tracking_numbers' => [
[
'carrier_id' => '',
'tracking_number' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/order.shipment.update.json');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/order.shipment.update.json' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"is_shipped": false,
"order_id": "",
"replace": false,
"shipment_id": "",
"store_id": "",
"tracking_link": "",
"tracking_numbers": [
{
"carrier_id": "",
"tracking_number": ""
}
]
}'
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/order.shipment.update.json' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"is_shipped": false,
"order_id": "",
"replace": false,
"shipment_id": "",
"store_id": "",
"tracking_link": "",
"tracking_numbers": [
{
"carrier_id": "",
"tracking_number": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"is_shipped\": false,\n \"order_id\": \"\",\n \"replace\": false,\n \"shipment_id\": \"\",\n \"store_id\": \"\",\n \"tracking_link\": \"\",\n \"tracking_numbers\": [\n {\n \"carrier_id\": \"\",\n \"tracking_number\": \"\"\n }\n ]\n}"
headers = {
'x-api-key': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("PUT", "/baseUrl/order.shipment.update.json", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/order.shipment.update.json"
payload = {
"is_shipped": False,
"order_id": "",
"replace": False,
"shipment_id": "",
"store_id": "",
"tracking_link": "",
"tracking_numbers": [
{
"carrier_id": "",
"tracking_number": ""
}
]
}
headers = {
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/order.shipment.update.json"
payload <- "{\n \"is_shipped\": false,\n \"order_id\": \"\",\n \"replace\": false,\n \"shipment_id\": \"\",\n \"store_id\": \"\",\n \"tracking_link\": \"\",\n \"tracking_numbers\": [\n {\n \"carrier_id\": \"\",\n \"tracking_number\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/order.shipment.update.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"is_shipped\": false,\n \"order_id\": \"\",\n \"replace\": false,\n \"shipment_id\": \"\",\n \"store_id\": \"\",\n \"tracking_link\": \"\",\n \"tracking_numbers\": [\n {\n \"carrier_id\": \"\",\n \"tracking_number\": \"\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/order.shipment.update.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.body = "{\n \"is_shipped\": false,\n \"order_id\": \"\",\n \"replace\": false,\n \"shipment_id\": \"\",\n \"store_id\": \"\",\n \"tracking_link\": \"\",\n \"tracking_numbers\": [\n {\n \"carrier_id\": \"\",\n \"tracking_number\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/order.shipment.update.json";
let payload = json!({
"is_shipped": false,
"order_id": "",
"replace": false,
"shipment_id": "",
"store_id": "",
"tracking_link": "",
"tracking_numbers": (
json!({
"carrier_id": "",
"tracking_number": ""
})
)
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/order.shipment.update.json \
--header 'content-type: application/json' \
--header 'x-api-key: {{apiKey}}' \
--data '{
"is_shipped": false,
"order_id": "",
"replace": false,
"shipment_id": "",
"store_id": "",
"tracking_link": "",
"tracking_numbers": [
{
"carrier_id": "",
"tracking_number": ""
}
]
}'
echo '{
"is_shipped": false,
"order_id": "",
"replace": false,
"shipment_id": "",
"store_id": "",
"tracking_link": "",
"tracking_numbers": [
{
"carrier_id": "",
"tracking_number": ""
}
]
}' | \
http PUT {{baseUrl}}/order.shipment.update.json \
content-type:application/json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method PUT \
--header 'x-api-key: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "is_shipped": false,\n "order_id": "",\n "replace": false,\n "shipment_id": "",\n "store_id": "",\n "tracking_link": "",\n "tracking_numbers": [\n {\n "carrier_id": "",\n "tracking_number": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/order.shipment.update.json
import Foundation
let headers = [
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"is_shipped": false,
"order_id": "",
"replace": false,
"shipment_id": "",
"store_id": "",
"tracking_link": "",
"tracking_numbers": [
[
"carrier_id": "",
"tracking_number": ""
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/order.shipment.update.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
OrderStatusList
{{baseUrl}}/order.status.list.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/order.status.list.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/order.status.list.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/order.status.list.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/order.status.list.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/order.status.list.json");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/order.status.list.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/order.status.list.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/order.status.list.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/order.status.list.json"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/order.status.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/order.status.list.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/order.status.list.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/order.status.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/order.status.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/order.status.list.json',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/order.status.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/order.status.list.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/order.status.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/order.status.list.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/order.status.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/order.status.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/order.status.list.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/order.status.list.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/order.status.list.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/order.status.list.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/order.status.list.json');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/order.status.list.json');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/order.status.list.json' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/order.status.list.json' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/order.status.list.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/order.status.list.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/order.status.list.json"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/order.status.list.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/order.status.list.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/order.status.list.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/order.status.list.json \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/order.status.list.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/order.status.list.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/order.status.list.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
OrderTransactionList
{{baseUrl}}/order.transaction.list.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
order_ids
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/order.transaction.list.json?order_ids=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/order.transaction.list.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:order_ids ""}})
require "http/client"
url = "{{baseUrl}}/order.transaction.list.json?order_ids="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/order.transaction.list.json?order_ids="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/order.transaction.list.json?order_ids=");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/order.transaction.list.json?order_ids="
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/order.transaction.list.json?order_ids= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/order.transaction.list.json?order_ids=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/order.transaction.list.json?order_ids="))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/order.transaction.list.json?order_ids=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/order.transaction.list.json?order_ids=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/order.transaction.list.json?order_ids=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/order.transaction.list.json',
params: {order_ids: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/order.transaction.list.json?order_ids=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/order.transaction.list.json?order_ids=',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/order.transaction.list.json?order_ids=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/order.transaction.list.json?order_ids=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/order.transaction.list.json',
qs: {order_ids: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/order.transaction.list.json');
req.query({
order_ids: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/order.transaction.list.json',
params: {order_ids: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/order.transaction.list.json?order_ids=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/order.transaction.list.json?order_ids="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/order.transaction.list.json?order_ids=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/order.transaction.list.json?order_ids=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/order.transaction.list.json?order_ids=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/order.transaction.list.json');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'order_ids' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/order.transaction.list.json');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'order_ids' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/order.transaction.list.json?order_ids=' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/order.transaction.list.json?order_ids=' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/order.transaction.list.json?order_ids=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/order.transaction.list.json"
querystring = {"order_ids":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/order.transaction.list.json"
queryString <- list(order_ids = "")
response <- VERB("GET", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/order.transaction.list.json?order_ids=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/order.transaction.list.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['order_ids'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/order.transaction.list.json";
let querystring = [
("order_ids", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/order.transaction.list.json?order_ids=' \
--header 'x-api-key: {{apiKey}}'
http GET '{{baseUrl}}/order.transaction.list.json?order_ids=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/order.transaction.list.json?order_ids='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/order.transaction.list.json?order_ids=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PUT
OrderUpdate
{{baseUrl}}/order.update.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
order_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/order.update.json?order_id=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/order.update.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:order_id ""}})
require "http/client"
url = "{{baseUrl}}/order.update.json?order_id="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.put url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/order.update.json?order_id="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/order.update.json?order_id=");
var request = new RestRequest("", Method.Put);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/order.update.json?order_id="
req, _ := http.NewRequest("PUT", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/order.update.json?order_id= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/order.update.json?order_id=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/order.update.json?order_id="))
.header("x-api-key", "{{apiKey}}")
.method("PUT", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/order.update.json?order_id=")
.put(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/order.update.json?order_id=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/order.update.json?order_id=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/order.update.json',
params: {order_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/order.update.json?order_id=';
const options = {method: 'PUT', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/order.update.json?order_id=',
method: 'PUT',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/order.update.json?order_id=")
.put(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/order.update.json?order_id=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/order.update.json',
qs: {order_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/order.update.json');
req.query({
order_id: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/order.update.json',
params: {order_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/order.update.json?order_id=';
const options = {method: 'PUT', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/order.update.json?order_id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/order.update.json?order_id=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/order.update.json?order_id=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/order.update.json?order_id=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/order.update.json');
$request->setMethod(HTTP_METH_PUT);
$request->setQueryData([
'order_id' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/order.update.json');
$request->setRequestMethod('PUT');
$request->setQuery(new http\QueryString([
'order_id' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/order.update.json?order_id=' -Method PUT -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/order.update.json?order_id=' -Method PUT -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("PUT", "/baseUrl/order.update.json?order_id=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/order.update.json"
querystring = {"order_id":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.put(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/order.update.json"
queryString <- list(order_id = "")
response <- VERB("PUT", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/order.update.json?order_id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.put('/baseUrl/order.update.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['order_id'] = ''
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/order.update.json";
let querystring = [
("order_id", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url '{{baseUrl}}/order.update.json?order_id=' \
--header 'x-api-key: {{apiKey}}'
http PUT '{{baseUrl}}/order.update.json?order_id=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method PUT \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/order.update.json?order_id='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/order.update.json?order_id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
ProductAdd
{{baseUrl}}/product.add.json
HEADERS
x-api-key
{{apiKey}}
BODY json
{
"attribute_name": "",
"attribute_set_name": "",
"avail_from": "",
"available_for_sale": false,
"available_for_view": false,
"backorder_status": "",
"barcode": "",
"best_offer": [],
"brand_name": "",
"categories_ids": "",
"category_id": "",
"clear_cache": false,
"condition": "",
"cost_price": "",
"country_of_origin": "",
"created_at": "",
"description": "",
"downloadable": false,
"ean": "",
"files": [
{
"name": "",
"url": ""
}
],
"group_prices": [
{
"group_id": "",
"price": ""
}
],
"gtin": "",
"harmonized_system_code": "",
"height": "",
"image_name": "",
"image_url": "",
"isbn": "",
"lang_id": "",
"length": "",
"listing_duration": "",
"listing_type": "",
"manage_stock": false,
"manufacturer": "",
"marketplace_item_properties": "",
"meta_description": "",
"meta_keywords": "",
"meta_title": "",
"model": "",
"mpn": "",
"name": "",
"old_price": "",
"ordered_count": 0,
"package_details": [],
"payment_methods": [],
"paypal_email": "",
"price": "",
"product_class": "",
"quantity": "",
"return_accepted": false,
"sales_tax": [],
"search_keywords": "",
"seller_profiles": {
"payment_profile_id": "",
"return_profile_id": "",
"shipping_profile_id": ""
},
"seo_url": "",
"shipping_details": [
{
"shipping_cost": "",
"shipping_service": "",
"shipping_type": ""
}
],
"shipping_template_id": 0,
"short_description": "",
"sku": "",
"special_price": "",
"specifics": [],
"sprice_create": "",
"sprice_expire": "",
"sprice_modified": "",
"status": "",
"store_id": "",
"stores_ids": "",
"tags": "",
"tax_class_id": 0,
"taxable": false,
"tier_prices": [
{
"price": "",
"quantity": ""
}
],
"type": "",
"upc": "",
"url": "",
"viewed_count": 0,
"visible": "",
"warehouse_id": "",
"weight": "",
"weight_unit": "",
"wholesale_price": "",
"width": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/product.add.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"attribute_name\": \"\",\n \"attribute_set_name\": \"\",\n \"avail_from\": \"\",\n \"available_for_sale\": false,\n \"available_for_view\": false,\n \"backorder_status\": \"\",\n \"barcode\": \"\",\n \"best_offer\": [],\n \"brand_name\": \"\",\n \"categories_ids\": \"\",\n \"category_id\": \"\",\n \"clear_cache\": false,\n \"condition\": \"\",\n \"cost_price\": \"\",\n \"country_of_origin\": \"\",\n \"created_at\": \"\",\n \"description\": \"\",\n \"downloadable\": false,\n \"ean\": \"\",\n \"files\": [\n {\n \"name\": \"\",\n \"url\": \"\"\n }\n ],\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"price\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"harmonized_system_code\": \"\",\n \"height\": \"\",\n \"image_name\": \"\",\n \"image_url\": \"\",\n \"isbn\": \"\",\n \"lang_id\": \"\",\n \"length\": \"\",\n \"listing_duration\": \"\",\n \"listing_type\": \"\",\n \"manage_stock\": false,\n \"manufacturer\": \"\",\n \"marketplace_item_properties\": \"\",\n \"meta_description\": \"\",\n \"meta_keywords\": \"\",\n \"meta_title\": \"\",\n \"model\": \"\",\n \"mpn\": \"\",\n \"name\": \"\",\n \"old_price\": \"\",\n \"ordered_count\": 0,\n \"package_details\": [],\n \"payment_methods\": [],\n \"paypal_email\": \"\",\n \"price\": \"\",\n \"product_class\": \"\",\n \"quantity\": \"\",\n \"return_accepted\": false,\n \"sales_tax\": [],\n \"search_keywords\": \"\",\n \"seller_profiles\": {\n \"payment_profile_id\": \"\",\n \"return_profile_id\": \"\",\n \"shipping_profile_id\": \"\"\n },\n \"seo_url\": \"\",\n \"shipping_details\": [\n {\n \"shipping_cost\": \"\",\n \"shipping_service\": \"\",\n \"shipping_type\": \"\"\n }\n ],\n \"shipping_template_id\": 0,\n \"short_description\": \"\",\n \"sku\": \"\",\n \"special_price\": \"\",\n \"specifics\": [],\n \"sprice_create\": \"\",\n \"sprice_expire\": \"\",\n \"sprice_modified\": \"\",\n \"status\": \"\",\n \"store_id\": \"\",\n \"stores_ids\": \"\",\n \"tags\": \"\",\n \"tax_class_id\": 0,\n \"taxable\": false,\n \"tier_prices\": [\n {\n \"price\": \"\",\n \"quantity\": \"\"\n }\n ],\n \"type\": \"\",\n \"upc\": \"\",\n \"url\": \"\",\n \"viewed_count\": 0,\n \"visible\": \"\",\n \"warehouse_id\": \"\",\n \"weight\": \"\",\n \"weight_unit\": \"\",\n \"wholesale_price\": \"\",\n \"width\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/product.add.json" {:headers {:x-api-key "{{apiKey}}"}
:content-type :json
:form-params {:attribute_name ""
:attribute_set_name ""
:avail_from ""
:available_for_sale false
:available_for_view false
:backorder_status ""
:barcode ""
:best_offer []
:brand_name ""
:categories_ids ""
:category_id ""
:clear_cache false
:condition ""
:cost_price ""
:country_of_origin ""
:created_at ""
:description ""
:downloadable false
:ean ""
:files [{:name ""
:url ""}]
:group_prices [{:group_id ""
:price ""}]
:gtin ""
:harmonized_system_code ""
:height ""
:image_name ""
:image_url ""
:isbn ""
:lang_id ""
:length ""
:listing_duration ""
:listing_type ""
:manage_stock false
:manufacturer ""
:marketplace_item_properties ""
:meta_description ""
:meta_keywords ""
:meta_title ""
:model ""
:mpn ""
:name ""
:old_price ""
:ordered_count 0
:package_details []
:payment_methods []
:paypal_email ""
:price ""
:product_class ""
:quantity ""
:return_accepted false
:sales_tax []
:search_keywords ""
:seller_profiles {:payment_profile_id ""
:return_profile_id ""
:shipping_profile_id ""}
:seo_url ""
:shipping_details [{:shipping_cost ""
:shipping_service ""
:shipping_type ""}]
:shipping_template_id 0
:short_description ""
:sku ""
:special_price ""
:specifics []
:sprice_create ""
:sprice_expire ""
:sprice_modified ""
:status ""
:store_id ""
:stores_ids ""
:tags ""
:tax_class_id 0
:taxable false
:tier_prices [{:price ""
:quantity ""}]
:type ""
:upc ""
:url ""
:viewed_count 0
:visible ""
:warehouse_id ""
:weight ""
:weight_unit ""
:wholesale_price ""
:width ""}})
require "http/client"
url = "{{baseUrl}}/product.add.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"attribute_name\": \"\",\n \"attribute_set_name\": \"\",\n \"avail_from\": \"\",\n \"available_for_sale\": false,\n \"available_for_view\": false,\n \"backorder_status\": \"\",\n \"barcode\": \"\",\n \"best_offer\": [],\n \"brand_name\": \"\",\n \"categories_ids\": \"\",\n \"category_id\": \"\",\n \"clear_cache\": false,\n \"condition\": \"\",\n \"cost_price\": \"\",\n \"country_of_origin\": \"\",\n \"created_at\": \"\",\n \"description\": \"\",\n \"downloadable\": false,\n \"ean\": \"\",\n \"files\": [\n {\n \"name\": \"\",\n \"url\": \"\"\n }\n ],\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"price\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"harmonized_system_code\": \"\",\n \"height\": \"\",\n \"image_name\": \"\",\n \"image_url\": \"\",\n \"isbn\": \"\",\n \"lang_id\": \"\",\n \"length\": \"\",\n \"listing_duration\": \"\",\n \"listing_type\": \"\",\n \"manage_stock\": false,\n \"manufacturer\": \"\",\n \"marketplace_item_properties\": \"\",\n \"meta_description\": \"\",\n \"meta_keywords\": \"\",\n \"meta_title\": \"\",\n \"model\": \"\",\n \"mpn\": \"\",\n \"name\": \"\",\n \"old_price\": \"\",\n \"ordered_count\": 0,\n \"package_details\": [],\n \"payment_methods\": [],\n \"paypal_email\": \"\",\n \"price\": \"\",\n \"product_class\": \"\",\n \"quantity\": \"\",\n \"return_accepted\": false,\n \"sales_tax\": [],\n \"search_keywords\": \"\",\n \"seller_profiles\": {\n \"payment_profile_id\": \"\",\n \"return_profile_id\": \"\",\n \"shipping_profile_id\": \"\"\n },\n \"seo_url\": \"\",\n \"shipping_details\": [\n {\n \"shipping_cost\": \"\",\n \"shipping_service\": \"\",\n \"shipping_type\": \"\"\n }\n ],\n \"shipping_template_id\": 0,\n \"short_description\": \"\",\n \"sku\": \"\",\n \"special_price\": \"\",\n \"specifics\": [],\n \"sprice_create\": \"\",\n \"sprice_expire\": \"\",\n \"sprice_modified\": \"\",\n \"status\": \"\",\n \"store_id\": \"\",\n \"stores_ids\": \"\",\n \"tags\": \"\",\n \"tax_class_id\": 0,\n \"taxable\": false,\n \"tier_prices\": [\n {\n \"price\": \"\",\n \"quantity\": \"\"\n }\n ],\n \"type\": \"\",\n \"upc\": \"\",\n \"url\": \"\",\n \"viewed_count\": 0,\n \"visible\": \"\",\n \"warehouse_id\": \"\",\n \"weight\": \"\",\n \"weight_unit\": \"\",\n \"wholesale_price\": \"\",\n \"width\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/product.add.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
Content = new StringContent("{\n \"attribute_name\": \"\",\n \"attribute_set_name\": \"\",\n \"avail_from\": \"\",\n \"available_for_sale\": false,\n \"available_for_view\": false,\n \"backorder_status\": \"\",\n \"barcode\": \"\",\n \"best_offer\": [],\n \"brand_name\": \"\",\n \"categories_ids\": \"\",\n \"category_id\": \"\",\n \"clear_cache\": false,\n \"condition\": \"\",\n \"cost_price\": \"\",\n \"country_of_origin\": \"\",\n \"created_at\": \"\",\n \"description\": \"\",\n \"downloadable\": false,\n \"ean\": \"\",\n \"files\": [\n {\n \"name\": \"\",\n \"url\": \"\"\n }\n ],\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"price\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"harmonized_system_code\": \"\",\n \"height\": \"\",\n \"image_name\": \"\",\n \"image_url\": \"\",\n \"isbn\": \"\",\n \"lang_id\": \"\",\n \"length\": \"\",\n \"listing_duration\": \"\",\n \"listing_type\": \"\",\n \"manage_stock\": false,\n \"manufacturer\": \"\",\n \"marketplace_item_properties\": \"\",\n \"meta_description\": \"\",\n \"meta_keywords\": \"\",\n \"meta_title\": \"\",\n \"model\": \"\",\n \"mpn\": \"\",\n \"name\": \"\",\n \"old_price\": \"\",\n \"ordered_count\": 0,\n \"package_details\": [],\n \"payment_methods\": [],\n \"paypal_email\": \"\",\n \"price\": \"\",\n \"product_class\": \"\",\n \"quantity\": \"\",\n \"return_accepted\": false,\n \"sales_tax\": [],\n \"search_keywords\": \"\",\n \"seller_profiles\": {\n \"payment_profile_id\": \"\",\n \"return_profile_id\": \"\",\n \"shipping_profile_id\": \"\"\n },\n \"seo_url\": \"\",\n \"shipping_details\": [\n {\n \"shipping_cost\": \"\",\n \"shipping_service\": \"\",\n \"shipping_type\": \"\"\n }\n ],\n \"shipping_template_id\": 0,\n \"short_description\": \"\",\n \"sku\": \"\",\n \"special_price\": \"\",\n \"specifics\": [],\n \"sprice_create\": \"\",\n \"sprice_expire\": \"\",\n \"sprice_modified\": \"\",\n \"status\": \"\",\n \"store_id\": \"\",\n \"stores_ids\": \"\",\n \"tags\": \"\",\n \"tax_class_id\": 0,\n \"taxable\": false,\n \"tier_prices\": [\n {\n \"price\": \"\",\n \"quantity\": \"\"\n }\n ],\n \"type\": \"\",\n \"upc\": \"\",\n \"url\": \"\",\n \"viewed_count\": 0,\n \"visible\": \"\",\n \"warehouse_id\": \"\",\n \"weight\": \"\",\n \"weight_unit\": \"\",\n \"wholesale_price\": \"\",\n \"width\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/product.add.json");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"attribute_name\": \"\",\n \"attribute_set_name\": \"\",\n \"avail_from\": \"\",\n \"available_for_sale\": false,\n \"available_for_view\": false,\n \"backorder_status\": \"\",\n \"barcode\": \"\",\n \"best_offer\": [],\n \"brand_name\": \"\",\n \"categories_ids\": \"\",\n \"category_id\": \"\",\n \"clear_cache\": false,\n \"condition\": \"\",\n \"cost_price\": \"\",\n \"country_of_origin\": \"\",\n \"created_at\": \"\",\n \"description\": \"\",\n \"downloadable\": false,\n \"ean\": \"\",\n \"files\": [\n {\n \"name\": \"\",\n \"url\": \"\"\n }\n ],\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"price\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"harmonized_system_code\": \"\",\n \"height\": \"\",\n \"image_name\": \"\",\n \"image_url\": \"\",\n \"isbn\": \"\",\n \"lang_id\": \"\",\n \"length\": \"\",\n \"listing_duration\": \"\",\n \"listing_type\": \"\",\n \"manage_stock\": false,\n \"manufacturer\": \"\",\n \"marketplace_item_properties\": \"\",\n \"meta_description\": \"\",\n \"meta_keywords\": \"\",\n \"meta_title\": \"\",\n \"model\": \"\",\n \"mpn\": \"\",\n \"name\": \"\",\n \"old_price\": \"\",\n \"ordered_count\": 0,\n \"package_details\": [],\n \"payment_methods\": [],\n \"paypal_email\": \"\",\n \"price\": \"\",\n \"product_class\": \"\",\n \"quantity\": \"\",\n \"return_accepted\": false,\n \"sales_tax\": [],\n \"search_keywords\": \"\",\n \"seller_profiles\": {\n \"payment_profile_id\": \"\",\n \"return_profile_id\": \"\",\n \"shipping_profile_id\": \"\"\n },\n \"seo_url\": \"\",\n \"shipping_details\": [\n {\n \"shipping_cost\": \"\",\n \"shipping_service\": \"\",\n \"shipping_type\": \"\"\n }\n ],\n \"shipping_template_id\": 0,\n \"short_description\": \"\",\n \"sku\": \"\",\n \"special_price\": \"\",\n \"specifics\": [],\n \"sprice_create\": \"\",\n \"sprice_expire\": \"\",\n \"sprice_modified\": \"\",\n \"status\": \"\",\n \"store_id\": \"\",\n \"stores_ids\": \"\",\n \"tags\": \"\",\n \"tax_class_id\": 0,\n \"taxable\": false,\n \"tier_prices\": [\n {\n \"price\": \"\",\n \"quantity\": \"\"\n }\n ],\n \"type\": \"\",\n \"upc\": \"\",\n \"url\": \"\",\n \"viewed_count\": 0,\n \"visible\": \"\",\n \"warehouse_id\": \"\",\n \"weight\": \"\",\n \"weight_unit\": \"\",\n \"wholesale_price\": \"\",\n \"width\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/product.add.json"
payload := strings.NewReader("{\n \"attribute_name\": \"\",\n \"attribute_set_name\": \"\",\n \"avail_from\": \"\",\n \"available_for_sale\": false,\n \"available_for_view\": false,\n \"backorder_status\": \"\",\n \"barcode\": \"\",\n \"best_offer\": [],\n \"brand_name\": \"\",\n \"categories_ids\": \"\",\n \"category_id\": \"\",\n \"clear_cache\": false,\n \"condition\": \"\",\n \"cost_price\": \"\",\n \"country_of_origin\": \"\",\n \"created_at\": \"\",\n \"description\": \"\",\n \"downloadable\": false,\n \"ean\": \"\",\n \"files\": [\n {\n \"name\": \"\",\n \"url\": \"\"\n }\n ],\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"price\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"harmonized_system_code\": \"\",\n \"height\": \"\",\n \"image_name\": \"\",\n \"image_url\": \"\",\n \"isbn\": \"\",\n \"lang_id\": \"\",\n \"length\": \"\",\n \"listing_duration\": \"\",\n \"listing_type\": \"\",\n \"manage_stock\": false,\n \"manufacturer\": \"\",\n \"marketplace_item_properties\": \"\",\n \"meta_description\": \"\",\n \"meta_keywords\": \"\",\n \"meta_title\": \"\",\n \"model\": \"\",\n \"mpn\": \"\",\n \"name\": \"\",\n \"old_price\": \"\",\n \"ordered_count\": 0,\n \"package_details\": [],\n \"payment_methods\": [],\n \"paypal_email\": \"\",\n \"price\": \"\",\n \"product_class\": \"\",\n \"quantity\": \"\",\n \"return_accepted\": false,\n \"sales_tax\": [],\n \"search_keywords\": \"\",\n \"seller_profiles\": {\n \"payment_profile_id\": \"\",\n \"return_profile_id\": \"\",\n \"shipping_profile_id\": \"\"\n },\n \"seo_url\": \"\",\n \"shipping_details\": [\n {\n \"shipping_cost\": \"\",\n \"shipping_service\": \"\",\n \"shipping_type\": \"\"\n }\n ],\n \"shipping_template_id\": 0,\n \"short_description\": \"\",\n \"sku\": \"\",\n \"special_price\": \"\",\n \"specifics\": [],\n \"sprice_create\": \"\",\n \"sprice_expire\": \"\",\n \"sprice_modified\": \"\",\n \"status\": \"\",\n \"store_id\": \"\",\n \"stores_ids\": \"\",\n \"tags\": \"\",\n \"tax_class_id\": 0,\n \"taxable\": false,\n \"tier_prices\": [\n {\n \"price\": \"\",\n \"quantity\": \"\"\n }\n ],\n \"type\": \"\",\n \"upc\": \"\",\n \"url\": \"\",\n \"viewed_count\": 0,\n \"visible\": \"\",\n \"warehouse_id\": \"\",\n \"weight\": \"\",\n \"weight_unit\": \"\",\n \"wholesale_price\": \"\",\n \"width\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/product.add.json HTTP/1.1
X-Api-Key: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 2008
{
"attribute_name": "",
"attribute_set_name": "",
"avail_from": "",
"available_for_sale": false,
"available_for_view": false,
"backorder_status": "",
"barcode": "",
"best_offer": [],
"brand_name": "",
"categories_ids": "",
"category_id": "",
"clear_cache": false,
"condition": "",
"cost_price": "",
"country_of_origin": "",
"created_at": "",
"description": "",
"downloadable": false,
"ean": "",
"files": [
{
"name": "",
"url": ""
}
],
"group_prices": [
{
"group_id": "",
"price": ""
}
],
"gtin": "",
"harmonized_system_code": "",
"height": "",
"image_name": "",
"image_url": "",
"isbn": "",
"lang_id": "",
"length": "",
"listing_duration": "",
"listing_type": "",
"manage_stock": false,
"manufacturer": "",
"marketplace_item_properties": "",
"meta_description": "",
"meta_keywords": "",
"meta_title": "",
"model": "",
"mpn": "",
"name": "",
"old_price": "",
"ordered_count": 0,
"package_details": [],
"payment_methods": [],
"paypal_email": "",
"price": "",
"product_class": "",
"quantity": "",
"return_accepted": false,
"sales_tax": [],
"search_keywords": "",
"seller_profiles": {
"payment_profile_id": "",
"return_profile_id": "",
"shipping_profile_id": ""
},
"seo_url": "",
"shipping_details": [
{
"shipping_cost": "",
"shipping_service": "",
"shipping_type": ""
}
],
"shipping_template_id": 0,
"short_description": "",
"sku": "",
"special_price": "",
"specifics": [],
"sprice_create": "",
"sprice_expire": "",
"sprice_modified": "",
"status": "",
"store_id": "",
"stores_ids": "",
"tags": "",
"tax_class_id": 0,
"taxable": false,
"tier_prices": [
{
"price": "",
"quantity": ""
}
],
"type": "",
"upc": "",
"url": "",
"viewed_count": 0,
"visible": "",
"warehouse_id": "",
"weight": "",
"weight_unit": "",
"wholesale_price": "",
"width": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/product.add.json")
.setHeader("x-api-key", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"attribute_name\": \"\",\n \"attribute_set_name\": \"\",\n \"avail_from\": \"\",\n \"available_for_sale\": false,\n \"available_for_view\": false,\n \"backorder_status\": \"\",\n \"barcode\": \"\",\n \"best_offer\": [],\n \"brand_name\": \"\",\n \"categories_ids\": \"\",\n \"category_id\": \"\",\n \"clear_cache\": false,\n \"condition\": \"\",\n \"cost_price\": \"\",\n \"country_of_origin\": \"\",\n \"created_at\": \"\",\n \"description\": \"\",\n \"downloadable\": false,\n \"ean\": \"\",\n \"files\": [\n {\n \"name\": \"\",\n \"url\": \"\"\n }\n ],\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"price\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"harmonized_system_code\": \"\",\n \"height\": \"\",\n \"image_name\": \"\",\n \"image_url\": \"\",\n \"isbn\": \"\",\n \"lang_id\": \"\",\n \"length\": \"\",\n \"listing_duration\": \"\",\n \"listing_type\": \"\",\n \"manage_stock\": false,\n \"manufacturer\": \"\",\n \"marketplace_item_properties\": \"\",\n \"meta_description\": \"\",\n \"meta_keywords\": \"\",\n \"meta_title\": \"\",\n \"model\": \"\",\n \"mpn\": \"\",\n \"name\": \"\",\n \"old_price\": \"\",\n \"ordered_count\": 0,\n \"package_details\": [],\n \"payment_methods\": [],\n \"paypal_email\": \"\",\n \"price\": \"\",\n \"product_class\": \"\",\n \"quantity\": \"\",\n \"return_accepted\": false,\n \"sales_tax\": [],\n \"search_keywords\": \"\",\n \"seller_profiles\": {\n \"payment_profile_id\": \"\",\n \"return_profile_id\": \"\",\n \"shipping_profile_id\": \"\"\n },\n \"seo_url\": \"\",\n \"shipping_details\": [\n {\n \"shipping_cost\": \"\",\n \"shipping_service\": \"\",\n \"shipping_type\": \"\"\n }\n ],\n \"shipping_template_id\": 0,\n \"short_description\": \"\",\n \"sku\": \"\",\n \"special_price\": \"\",\n \"specifics\": [],\n \"sprice_create\": \"\",\n \"sprice_expire\": \"\",\n \"sprice_modified\": \"\",\n \"status\": \"\",\n \"store_id\": \"\",\n \"stores_ids\": \"\",\n \"tags\": \"\",\n \"tax_class_id\": 0,\n \"taxable\": false,\n \"tier_prices\": [\n {\n \"price\": \"\",\n \"quantity\": \"\"\n }\n ],\n \"type\": \"\",\n \"upc\": \"\",\n \"url\": \"\",\n \"viewed_count\": 0,\n \"visible\": \"\",\n \"warehouse_id\": \"\",\n \"weight\": \"\",\n \"weight_unit\": \"\",\n \"wholesale_price\": \"\",\n \"width\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/product.add.json"))
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"attribute_name\": \"\",\n \"attribute_set_name\": \"\",\n \"avail_from\": \"\",\n \"available_for_sale\": false,\n \"available_for_view\": false,\n \"backorder_status\": \"\",\n \"barcode\": \"\",\n \"best_offer\": [],\n \"brand_name\": \"\",\n \"categories_ids\": \"\",\n \"category_id\": \"\",\n \"clear_cache\": false,\n \"condition\": \"\",\n \"cost_price\": \"\",\n \"country_of_origin\": \"\",\n \"created_at\": \"\",\n \"description\": \"\",\n \"downloadable\": false,\n \"ean\": \"\",\n \"files\": [\n {\n \"name\": \"\",\n \"url\": \"\"\n }\n ],\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"price\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"harmonized_system_code\": \"\",\n \"height\": \"\",\n \"image_name\": \"\",\n \"image_url\": \"\",\n \"isbn\": \"\",\n \"lang_id\": \"\",\n \"length\": \"\",\n \"listing_duration\": \"\",\n \"listing_type\": \"\",\n \"manage_stock\": false,\n \"manufacturer\": \"\",\n \"marketplace_item_properties\": \"\",\n \"meta_description\": \"\",\n \"meta_keywords\": \"\",\n \"meta_title\": \"\",\n \"model\": \"\",\n \"mpn\": \"\",\n \"name\": \"\",\n \"old_price\": \"\",\n \"ordered_count\": 0,\n \"package_details\": [],\n \"payment_methods\": [],\n \"paypal_email\": \"\",\n \"price\": \"\",\n \"product_class\": \"\",\n \"quantity\": \"\",\n \"return_accepted\": false,\n \"sales_tax\": [],\n \"search_keywords\": \"\",\n \"seller_profiles\": {\n \"payment_profile_id\": \"\",\n \"return_profile_id\": \"\",\n \"shipping_profile_id\": \"\"\n },\n \"seo_url\": \"\",\n \"shipping_details\": [\n {\n \"shipping_cost\": \"\",\n \"shipping_service\": \"\",\n \"shipping_type\": \"\"\n }\n ],\n \"shipping_template_id\": 0,\n \"short_description\": \"\",\n \"sku\": \"\",\n \"special_price\": \"\",\n \"specifics\": [],\n \"sprice_create\": \"\",\n \"sprice_expire\": \"\",\n \"sprice_modified\": \"\",\n \"status\": \"\",\n \"store_id\": \"\",\n \"stores_ids\": \"\",\n \"tags\": \"\",\n \"tax_class_id\": 0,\n \"taxable\": false,\n \"tier_prices\": [\n {\n \"price\": \"\",\n \"quantity\": \"\"\n }\n ],\n \"type\": \"\",\n \"upc\": \"\",\n \"url\": \"\",\n \"viewed_count\": 0,\n \"visible\": \"\",\n \"warehouse_id\": \"\",\n \"weight\": \"\",\n \"weight_unit\": \"\",\n \"wholesale_price\": \"\",\n \"width\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"attribute_name\": \"\",\n \"attribute_set_name\": \"\",\n \"avail_from\": \"\",\n \"available_for_sale\": false,\n \"available_for_view\": false,\n \"backorder_status\": \"\",\n \"barcode\": \"\",\n \"best_offer\": [],\n \"brand_name\": \"\",\n \"categories_ids\": \"\",\n \"category_id\": \"\",\n \"clear_cache\": false,\n \"condition\": \"\",\n \"cost_price\": \"\",\n \"country_of_origin\": \"\",\n \"created_at\": \"\",\n \"description\": \"\",\n \"downloadable\": false,\n \"ean\": \"\",\n \"files\": [\n {\n \"name\": \"\",\n \"url\": \"\"\n }\n ],\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"price\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"harmonized_system_code\": \"\",\n \"height\": \"\",\n \"image_name\": \"\",\n \"image_url\": \"\",\n \"isbn\": \"\",\n \"lang_id\": \"\",\n \"length\": \"\",\n \"listing_duration\": \"\",\n \"listing_type\": \"\",\n \"manage_stock\": false,\n \"manufacturer\": \"\",\n \"marketplace_item_properties\": \"\",\n \"meta_description\": \"\",\n \"meta_keywords\": \"\",\n \"meta_title\": \"\",\n \"model\": \"\",\n \"mpn\": \"\",\n \"name\": \"\",\n \"old_price\": \"\",\n \"ordered_count\": 0,\n \"package_details\": [],\n \"payment_methods\": [],\n \"paypal_email\": \"\",\n \"price\": \"\",\n \"product_class\": \"\",\n \"quantity\": \"\",\n \"return_accepted\": false,\n \"sales_tax\": [],\n \"search_keywords\": \"\",\n \"seller_profiles\": {\n \"payment_profile_id\": \"\",\n \"return_profile_id\": \"\",\n \"shipping_profile_id\": \"\"\n },\n \"seo_url\": \"\",\n \"shipping_details\": [\n {\n \"shipping_cost\": \"\",\n \"shipping_service\": \"\",\n \"shipping_type\": \"\"\n }\n ],\n \"shipping_template_id\": 0,\n \"short_description\": \"\",\n \"sku\": \"\",\n \"special_price\": \"\",\n \"specifics\": [],\n \"sprice_create\": \"\",\n \"sprice_expire\": \"\",\n \"sprice_modified\": \"\",\n \"status\": \"\",\n \"store_id\": \"\",\n \"stores_ids\": \"\",\n \"tags\": \"\",\n \"tax_class_id\": 0,\n \"taxable\": false,\n \"tier_prices\": [\n {\n \"price\": \"\",\n \"quantity\": \"\"\n }\n ],\n \"type\": \"\",\n \"upc\": \"\",\n \"url\": \"\",\n \"viewed_count\": 0,\n \"visible\": \"\",\n \"warehouse_id\": \"\",\n \"weight\": \"\",\n \"weight_unit\": \"\",\n \"wholesale_price\": \"\",\n \"width\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/product.add.json")
.post(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/product.add.json")
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"attribute_name\": \"\",\n \"attribute_set_name\": \"\",\n \"avail_from\": \"\",\n \"available_for_sale\": false,\n \"available_for_view\": false,\n \"backorder_status\": \"\",\n \"barcode\": \"\",\n \"best_offer\": [],\n \"brand_name\": \"\",\n \"categories_ids\": \"\",\n \"category_id\": \"\",\n \"clear_cache\": false,\n \"condition\": \"\",\n \"cost_price\": \"\",\n \"country_of_origin\": \"\",\n \"created_at\": \"\",\n \"description\": \"\",\n \"downloadable\": false,\n \"ean\": \"\",\n \"files\": [\n {\n \"name\": \"\",\n \"url\": \"\"\n }\n ],\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"price\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"harmonized_system_code\": \"\",\n \"height\": \"\",\n \"image_name\": \"\",\n \"image_url\": \"\",\n \"isbn\": \"\",\n \"lang_id\": \"\",\n \"length\": \"\",\n \"listing_duration\": \"\",\n \"listing_type\": \"\",\n \"manage_stock\": false,\n \"manufacturer\": \"\",\n \"marketplace_item_properties\": \"\",\n \"meta_description\": \"\",\n \"meta_keywords\": \"\",\n \"meta_title\": \"\",\n \"model\": \"\",\n \"mpn\": \"\",\n \"name\": \"\",\n \"old_price\": \"\",\n \"ordered_count\": 0,\n \"package_details\": [],\n \"payment_methods\": [],\n \"paypal_email\": \"\",\n \"price\": \"\",\n \"product_class\": \"\",\n \"quantity\": \"\",\n \"return_accepted\": false,\n \"sales_tax\": [],\n \"search_keywords\": \"\",\n \"seller_profiles\": {\n \"payment_profile_id\": \"\",\n \"return_profile_id\": \"\",\n \"shipping_profile_id\": \"\"\n },\n \"seo_url\": \"\",\n \"shipping_details\": [\n {\n \"shipping_cost\": \"\",\n \"shipping_service\": \"\",\n \"shipping_type\": \"\"\n }\n ],\n \"shipping_template_id\": 0,\n \"short_description\": \"\",\n \"sku\": \"\",\n \"special_price\": \"\",\n \"specifics\": [],\n \"sprice_create\": \"\",\n \"sprice_expire\": \"\",\n \"sprice_modified\": \"\",\n \"status\": \"\",\n \"store_id\": \"\",\n \"stores_ids\": \"\",\n \"tags\": \"\",\n \"tax_class_id\": 0,\n \"taxable\": false,\n \"tier_prices\": [\n {\n \"price\": \"\",\n \"quantity\": \"\"\n }\n ],\n \"type\": \"\",\n \"upc\": \"\",\n \"url\": \"\",\n \"viewed_count\": 0,\n \"visible\": \"\",\n \"warehouse_id\": \"\",\n \"weight\": \"\",\n \"weight_unit\": \"\",\n \"wholesale_price\": \"\",\n \"width\": \"\"\n}")
.asString();
const data = JSON.stringify({
attribute_name: '',
attribute_set_name: '',
avail_from: '',
available_for_sale: false,
available_for_view: false,
backorder_status: '',
barcode: '',
best_offer: [],
brand_name: '',
categories_ids: '',
category_id: '',
clear_cache: false,
condition: '',
cost_price: '',
country_of_origin: '',
created_at: '',
description: '',
downloadable: false,
ean: '',
files: [
{
name: '',
url: ''
}
],
group_prices: [
{
group_id: '',
price: ''
}
],
gtin: '',
harmonized_system_code: '',
height: '',
image_name: '',
image_url: '',
isbn: '',
lang_id: '',
length: '',
listing_duration: '',
listing_type: '',
manage_stock: false,
manufacturer: '',
marketplace_item_properties: '',
meta_description: '',
meta_keywords: '',
meta_title: '',
model: '',
mpn: '',
name: '',
old_price: '',
ordered_count: 0,
package_details: [],
payment_methods: [],
paypal_email: '',
price: '',
product_class: '',
quantity: '',
return_accepted: false,
sales_tax: [],
search_keywords: '',
seller_profiles: {
payment_profile_id: '',
return_profile_id: '',
shipping_profile_id: ''
},
seo_url: '',
shipping_details: [
{
shipping_cost: '',
shipping_service: '',
shipping_type: ''
}
],
shipping_template_id: 0,
short_description: '',
sku: '',
special_price: '',
specifics: [],
sprice_create: '',
sprice_expire: '',
sprice_modified: '',
status: '',
store_id: '',
stores_ids: '',
tags: '',
tax_class_id: 0,
taxable: false,
tier_prices: [
{
price: '',
quantity: ''
}
],
type: '',
upc: '',
url: '',
viewed_count: 0,
visible: '',
warehouse_id: '',
weight: '',
weight_unit: '',
wholesale_price: '',
width: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/product.add.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/product.add.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {
attribute_name: '',
attribute_set_name: '',
avail_from: '',
available_for_sale: false,
available_for_view: false,
backorder_status: '',
barcode: '',
best_offer: [],
brand_name: '',
categories_ids: '',
category_id: '',
clear_cache: false,
condition: '',
cost_price: '',
country_of_origin: '',
created_at: '',
description: '',
downloadable: false,
ean: '',
files: [{name: '', url: ''}],
group_prices: [{group_id: '', price: ''}],
gtin: '',
harmonized_system_code: '',
height: '',
image_name: '',
image_url: '',
isbn: '',
lang_id: '',
length: '',
listing_duration: '',
listing_type: '',
manage_stock: false,
manufacturer: '',
marketplace_item_properties: '',
meta_description: '',
meta_keywords: '',
meta_title: '',
model: '',
mpn: '',
name: '',
old_price: '',
ordered_count: 0,
package_details: [],
payment_methods: [],
paypal_email: '',
price: '',
product_class: '',
quantity: '',
return_accepted: false,
sales_tax: [],
search_keywords: '',
seller_profiles: {payment_profile_id: '', return_profile_id: '', shipping_profile_id: ''},
seo_url: '',
shipping_details: [{shipping_cost: '', shipping_service: '', shipping_type: ''}],
shipping_template_id: 0,
short_description: '',
sku: '',
special_price: '',
specifics: [],
sprice_create: '',
sprice_expire: '',
sprice_modified: '',
status: '',
store_id: '',
stores_ids: '',
tags: '',
tax_class_id: 0,
taxable: false,
tier_prices: [{price: '', quantity: ''}],
type: '',
upc: '',
url: '',
viewed_count: 0,
visible: '',
warehouse_id: '',
weight: '',
weight_unit: '',
wholesale_price: '',
width: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/product.add.json';
const options = {
method: 'POST',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"attribute_name":"","attribute_set_name":"","avail_from":"","available_for_sale":false,"available_for_view":false,"backorder_status":"","barcode":"","best_offer":[],"brand_name":"","categories_ids":"","category_id":"","clear_cache":false,"condition":"","cost_price":"","country_of_origin":"","created_at":"","description":"","downloadable":false,"ean":"","files":[{"name":"","url":""}],"group_prices":[{"group_id":"","price":""}],"gtin":"","harmonized_system_code":"","height":"","image_name":"","image_url":"","isbn":"","lang_id":"","length":"","listing_duration":"","listing_type":"","manage_stock":false,"manufacturer":"","marketplace_item_properties":"","meta_description":"","meta_keywords":"","meta_title":"","model":"","mpn":"","name":"","old_price":"","ordered_count":0,"package_details":[],"payment_methods":[],"paypal_email":"","price":"","product_class":"","quantity":"","return_accepted":false,"sales_tax":[],"search_keywords":"","seller_profiles":{"payment_profile_id":"","return_profile_id":"","shipping_profile_id":""},"seo_url":"","shipping_details":[{"shipping_cost":"","shipping_service":"","shipping_type":""}],"shipping_template_id":0,"short_description":"","sku":"","special_price":"","specifics":[],"sprice_create":"","sprice_expire":"","sprice_modified":"","status":"","store_id":"","stores_ids":"","tags":"","tax_class_id":0,"taxable":false,"tier_prices":[{"price":"","quantity":""}],"type":"","upc":"","url":"","viewed_count":0,"visible":"","warehouse_id":"","weight":"","weight_unit":"","wholesale_price":"","width":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/product.add.json',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "attribute_name": "",\n "attribute_set_name": "",\n "avail_from": "",\n "available_for_sale": false,\n "available_for_view": false,\n "backorder_status": "",\n "barcode": "",\n "best_offer": [],\n "brand_name": "",\n "categories_ids": "",\n "category_id": "",\n "clear_cache": false,\n "condition": "",\n "cost_price": "",\n "country_of_origin": "",\n "created_at": "",\n "description": "",\n "downloadable": false,\n "ean": "",\n "files": [\n {\n "name": "",\n "url": ""\n }\n ],\n "group_prices": [\n {\n "group_id": "",\n "price": ""\n }\n ],\n "gtin": "",\n "harmonized_system_code": "",\n "height": "",\n "image_name": "",\n "image_url": "",\n "isbn": "",\n "lang_id": "",\n "length": "",\n "listing_duration": "",\n "listing_type": "",\n "manage_stock": false,\n "manufacturer": "",\n "marketplace_item_properties": "",\n "meta_description": "",\n "meta_keywords": "",\n "meta_title": "",\n "model": "",\n "mpn": "",\n "name": "",\n "old_price": "",\n "ordered_count": 0,\n "package_details": [],\n "payment_methods": [],\n "paypal_email": "",\n "price": "",\n "product_class": "",\n "quantity": "",\n "return_accepted": false,\n "sales_tax": [],\n "search_keywords": "",\n "seller_profiles": {\n "payment_profile_id": "",\n "return_profile_id": "",\n "shipping_profile_id": ""\n },\n "seo_url": "",\n "shipping_details": [\n {\n "shipping_cost": "",\n "shipping_service": "",\n "shipping_type": ""\n }\n ],\n "shipping_template_id": 0,\n "short_description": "",\n "sku": "",\n "special_price": "",\n "specifics": [],\n "sprice_create": "",\n "sprice_expire": "",\n "sprice_modified": "",\n "status": "",\n "store_id": "",\n "stores_ids": "",\n "tags": "",\n "tax_class_id": 0,\n "taxable": false,\n "tier_prices": [\n {\n "price": "",\n "quantity": ""\n }\n ],\n "type": "",\n "upc": "",\n "url": "",\n "viewed_count": 0,\n "visible": "",\n "warehouse_id": "",\n "weight": "",\n "weight_unit": "",\n "wholesale_price": "",\n "width": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"attribute_name\": \"\",\n \"attribute_set_name\": \"\",\n \"avail_from\": \"\",\n \"available_for_sale\": false,\n \"available_for_view\": false,\n \"backorder_status\": \"\",\n \"barcode\": \"\",\n \"best_offer\": [],\n \"brand_name\": \"\",\n \"categories_ids\": \"\",\n \"category_id\": \"\",\n \"clear_cache\": false,\n \"condition\": \"\",\n \"cost_price\": \"\",\n \"country_of_origin\": \"\",\n \"created_at\": \"\",\n \"description\": \"\",\n \"downloadable\": false,\n \"ean\": \"\",\n \"files\": [\n {\n \"name\": \"\",\n \"url\": \"\"\n }\n ],\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"price\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"harmonized_system_code\": \"\",\n \"height\": \"\",\n \"image_name\": \"\",\n \"image_url\": \"\",\n \"isbn\": \"\",\n \"lang_id\": \"\",\n \"length\": \"\",\n \"listing_duration\": \"\",\n \"listing_type\": \"\",\n \"manage_stock\": false,\n \"manufacturer\": \"\",\n \"marketplace_item_properties\": \"\",\n \"meta_description\": \"\",\n \"meta_keywords\": \"\",\n \"meta_title\": \"\",\n \"model\": \"\",\n \"mpn\": \"\",\n \"name\": \"\",\n \"old_price\": \"\",\n \"ordered_count\": 0,\n \"package_details\": [],\n \"payment_methods\": [],\n \"paypal_email\": \"\",\n \"price\": \"\",\n \"product_class\": \"\",\n \"quantity\": \"\",\n \"return_accepted\": false,\n \"sales_tax\": [],\n \"search_keywords\": \"\",\n \"seller_profiles\": {\n \"payment_profile_id\": \"\",\n \"return_profile_id\": \"\",\n \"shipping_profile_id\": \"\"\n },\n \"seo_url\": \"\",\n \"shipping_details\": [\n {\n \"shipping_cost\": \"\",\n \"shipping_service\": \"\",\n \"shipping_type\": \"\"\n }\n ],\n \"shipping_template_id\": 0,\n \"short_description\": \"\",\n \"sku\": \"\",\n \"special_price\": \"\",\n \"specifics\": [],\n \"sprice_create\": \"\",\n \"sprice_expire\": \"\",\n \"sprice_modified\": \"\",\n \"status\": \"\",\n \"store_id\": \"\",\n \"stores_ids\": \"\",\n \"tags\": \"\",\n \"tax_class_id\": 0,\n \"taxable\": false,\n \"tier_prices\": [\n {\n \"price\": \"\",\n \"quantity\": \"\"\n }\n ],\n \"type\": \"\",\n \"upc\": \"\",\n \"url\": \"\",\n \"viewed_count\": 0,\n \"visible\": \"\",\n \"warehouse_id\": \"\",\n \"weight\": \"\",\n \"weight_unit\": \"\",\n \"wholesale_price\": \"\",\n \"width\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/product.add.json")
.post(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/product.add.json',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
attribute_name: '',
attribute_set_name: '',
avail_from: '',
available_for_sale: false,
available_for_view: false,
backorder_status: '',
barcode: '',
best_offer: [],
brand_name: '',
categories_ids: '',
category_id: '',
clear_cache: false,
condition: '',
cost_price: '',
country_of_origin: '',
created_at: '',
description: '',
downloadable: false,
ean: '',
files: [{name: '', url: ''}],
group_prices: [{group_id: '', price: ''}],
gtin: '',
harmonized_system_code: '',
height: '',
image_name: '',
image_url: '',
isbn: '',
lang_id: '',
length: '',
listing_duration: '',
listing_type: '',
manage_stock: false,
manufacturer: '',
marketplace_item_properties: '',
meta_description: '',
meta_keywords: '',
meta_title: '',
model: '',
mpn: '',
name: '',
old_price: '',
ordered_count: 0,
package_details: [],
payment_methods: [],
paypal_email: '',
price: '',
product_class: '',
quantity: '',
return_accepted: false,
sales_tax: [],
search_keywords: '',
seller_profiles: {payment_profile_id: '', return_profile_id: '', shipping_profile_id: ''},
seo_url: '',
shipping_details: [{shipping_cost: '', shipping_service: '', shipping_type: ''}],
shipping_template_id: 0,
short_description: '',
sku: '',
special_price: '',
specifics: [],
sprice_create: '',
sprice_expire: '',
sprice_modified: '',
status: '',
store_id: '',
stores_ids: '',
tags: '',
tax_class_id: 0,
taxable: false,
tier_prices: [{price: '', quantity: ''}],
type: '',
upc: '',
url: '',
viewed_count: 0,
visible: '',
warehouse_id: '',
weight: '',
weight_unit: '',
wholesale_price: '',
width: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/product.add.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: {
attribute_name: '',
attribute_set_name: '',
avail_from: '',
available_for_sale: false,
available_for_view: false,
backorder_status: '',
barcode: '',
best_offer: [],
brand_name: '',
categories_ids: '',
category_id: '',
clear_cache: false,
condition: '',
cost_price: '',
country_of_origin: '',
created_at: '',
description: '',
downloadable: false,
ean: '',
files: [{name: '', url: ''}],
group_prices: [{group_id: '', price: ''}],
gtin: '',
harmonized_system_code: '',
height: '',
image_name: '',
image_url: '',
isbn: '',
lang_id: '',
length: '',
listing_duration: '',
listing_type: '',
manage_stock: false,
manufacturer: '',
marketplace_item_properties: '',
meta_description: '',
meta_keywords: '',
meta_title: '',
model: '',
mpn: '',
name: '',
old_price: '',
ordered_count: 0,
package_details: [],
payment_methods: [],
paypal_email: '',
price: '',
product_class: '',
quantity: '',
return_accepted: false,
sales_tax: [],
search_keywords: '',
seller_profiles: {payment_profile_id: '', return_profile_id: '', shipping_profile_id: ''},
seo_url: '',
shipping_details: [{shipping_cost: '', shipping_service: '', shipping_type: ''}],
shipping_template_id: 0,
short_description: '',
sku: '',
special_price: '',
specifics: [],
sprice_create: '',
sprice_expire: '',
sprice_modified: '',
status: '',
store_id: '',
stores_ids: '',
tags: '',
tax_class_id: 0,
taxable: false,
tier_prices: [{price: '', quantity: ''}],
type: '',
upc: '',
url: '',
viewed_count: 0,
visible: '',
warehouse_id: '',
weight: '',
weight_unit: '',
wholesale_price: '',
width: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/product.add.json');
req.headers({
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
attribute_name: '',
attribute_set_name: '',
avail_from: '',
available_for_sale: false,
available_for_view: false,
backorder_status: '',
barcode: '',
best_offer: [],
brand_name: '',
categories_ids: '',
category_id: '',
clear_cache: false,
condition: '',
cost_price: '',
country_of_origin: '',
created_at: '',
description: '',
downloadable: false,
ean: '',
files: [
{
name: '',
url: ''
}
],
group_prices: [
{
group_id: '',
price: ''
}
],
gtin: '',
harmonized_system_code: '',
height: '',
image_name: '',
image_url: '',
isbn: '',
lang_id: '',
length: '',
listing_duration: '',
listing_type: '',
manage_stock: false,
manufacturer: '',
marketplace_item_properties: '',
meta_description: '',
meta_keywords: '',
meta_title: '',
model: '',
mpn: '',
name: '',
old_price: '',
ordered_count: 0,
package_details: [],
payment_methods: [],
paypal_email: '',
price: '',
product_class: '',
quantity: '',
return_accepted: false,
sales_tax: [],
search_keywords: '',
seller_profiles: {
payment_profile_id: '',
return_profile_id: '',
shipping_profile_id: ''
},
seo_url: '',
shipping_details: [
{
shipping_cost: '',
shipping_service: '',
shipping_type: ''
}
],
shipping_template_id: 0,
short_description: '',
sku: '',
special_price: '',
specifics: [],
sprice_create: '',
sprice_expire: '',
sprice_modified: '',
status: '',
store_id: '',
stores_ids: '',
tags: '',
tax_class_id: 0,
taxable: false,
tier_prices: [
{
price: '',
quantity: ''
}
],
type: '',
upc: '',
url: '',
viewed_count: 0,
visible: '',
warehouse_id: '',
weight: '',
weight_unit: '',
wholesale_price: '',
width: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/product.add.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {
attribute_name: '',
attribute_set_name: '',
avail_from: '',
available_for_sale: false,
available_for_view: false,
backorder_status: '',
barcode: '',
best_offer: [],
brand_name: '',
categories_ids: '',
category_id: '',
clear_cache: false,
condition: '',
cost_price: '',
country_of_origin: '',
created_at: '',
description: '',
downloadable: false,
ean: '',
files: [{name: '', url: ''}],
group_prices: [{group_id: '', price: ''}],
gtin: '',
harmonized_system_code: '',
height: '',
image_name: '',
image_url: '',
isbn: '',
lang_id: '',
length: '',
listing_duration: '',
listing_type: '',
manage_stock: false,
manufacturer: '',
marketplace_item_properties: '',
meta_description: '',
meta_keywords: '',
meta_title: '',
model: '',
mpn: '',
name: '',
old_price: '',
ordered_count: 0,
package_details: [],
payment_methods: [],
paypal_email: '',
price: '',
product_class: '',
quantity: '',
return_accepted: false,
sales_tax: [],
search_keywords: '',
seller_profiles: {payment_profile_id: '', return_profile_id: '', shipping_profile_id: ''},
seo_url: '',
shipping_details: [{shipping_cost: '', shipping_service: '', shipping_type: ''}],
shipping_template_id: 0,
short_description: '',
sku: '',
special_price: '',
specifics: [],
sprice_create: '',
sprice_expire: '',
sprice_modified: '',
status: '',
store_id: '',
stores_ids: '',
tags: '',
tax_class_id: 0,
taxable: false,
tier_prices: [{price: '', quantity: ''}],
type: '',
upc: '',
url: '',
viewed_count: 0,
visible: '',
warehouse_id: '',
weight: '',
weight_unit: '',
wholesale_price: '',
width: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/product.add.json';
const options = {
method: 'POST',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"attribute_name":"","attribute_set_name":"","avail_from":"","available_for_sale":false,"available_for_view":false,"backorder_status":"","barcode":"","best_offer":[],"brand_name":"","categories_ids":"","category_id":"","clear_cache":false,"condition":"","cost_price":"","country_of_origin":"","created_at":"","description":"","downloadable":false,"ean":"","files":[{"name":"","url":""}],"group_prices":[{"group_id":"","price":""}],"gtin":"","harmonized_system_code":"","height":"","image_name":"","image_url":"","isbn":"","lang_id":"","length":"","listing_duration":"","listing_type":"","manage_stock":false,"manufacturer":"","marketplace_item_properties":"","meta_description":"","meta_keywords":"","meta_title":"","model":"","mpn":"","name":"","old_price":"","ordered_count":0,"package_details":[],"payment_methods":[],"paypal_email":"","price":"","product_class":"","quantity":"","return_accepted":false,"sales_tax":[],"search_keywords":"","seller_profiles":{"payment_profile_id":"","return_profile_id":"","shipping_profile_id":""},"seo_url":"","shipping_details":[{"shipping_cost":"","shipping_service":"","shipping_type":""}],"shipping_template_id":0,"short_description":"","sku":"","special_price":"","specifics":[],"sprice_create":"","sprice_expire":"","sprice_modified":"","status":"","store_id":"","stores_ids":"","tags":"","tax_class_id":0,"taxable":false,"tier_prices":[{"price":"","quantity":""}],"type":"","upc":"","url":"","viewed_count":0,"visible":"","warehouse_id":"","weight":"","weight_unit":"","wholesale_price":"","width":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"attribute_name": @"",
@"attribute_set_name": @"",
@"avail_from": @"",
@"available_for_sale": @NO,
@"available_for_view": @NO,
@"backorder_status": @"",
@"barcode": @"",
@"best_offer": @[ ],
@"brand_name": @"",
@"categories_ids": @"",
@"category_id": @"",
@"clear_cache": @NO,
@"condition": @"",
@"cost_price": @"",
@"country_of_origin": @"",
@"created_at": @"",
@"description": @"",
@"downloadable": @NO,
@"ean": @"",
@"files": @[ @{ @"name": @"", @"url": @"" } ],
@"group_prices": @[ @{ @"group_id": @"", @"price": @"" } ],
@"gtin": @"",
@"harmonized_system_code": @"",
@"height": @"",
@"image_name": @"",
@"image_url": @"",
@"isbn": @"",
@"lang_id": @"",
@"length": @"",
@"listing_duration": @"",
@"listing_type": @"",
@"manage_stock": @NO,
@"manufacturer": @"",
@"marketplace_item_properties": @"",
@"meta_description": @"",
@"meta_keywords": @"",
@"meta_title": @"",
@"model": @"",
@"mpn": @"",
@"name": @"",
@"old_price": @"",
@"ordered_count": @0,
@"package_details": @[ ],
@"payment_methods": @[ ],
@"paypal_email": @"",
@"price": @"",
@"product_class": @"",
@"quantity": @"",
@"return_accepted": @NO,
@"sales_tax": @[ ],
@"search_keywords": @"",
@"seller_profiles": @{ @"payment_profile_id": @"", @"return_profile_id": @"", @"shipping_profile_id": @"" },
@"seo_url": @"",
@"shipping_details": @[ @{ @"shipping_cost": @"", @"shipping_service": @"", @"shipping_type": @"" } ],
@"shipping_template_id": @0,
@"short_description": @"",
@"sku": @"",
@"special_price": @"",
@"specifics": @[ ],
@"sprice_create": @"",
@"sprice_expire": @"",
@"sprice_modified": @"",
@"status": @"",
@"store_id": @"",
@"stores_ids": @"",
@"tags": @"",
@"tax_class_id": @0,
@"taxable": @NO,
@"tier_prices": @[ @{ @"price": @"", @"quantity": @"" } ],
@"type": @"",
@"upc": @"",
@"url": @"",
@"viewed_count": @0,
@"visible": @"",
@"warehouse_id": @"",
@"weight": @"",
@"weight_unit": @"",
@"wholesale_price": @"",
@"width": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/product.add.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/product.add.json" in
let headers = Header.add_list (Header.init ()) [
("x-api-key", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"attribute_name\": \"\",\n \"attribute_set_name\": \"\",\n \"avail_from\": \"\",\n \"available_for_sale\": false,\n \"available_for_view\": false,\n \"backorder_status\": \"\",\n \"barcode\": \"\",\n \"best_offer\": [],\n \"brand_name\": \"\",\n \"categories_ids\": \"\",\n \"category_id\": \"\",\n \"clear_cache\": false,\n \"condition\": \"\",\n \"cost_price\": \"\",\n \"country_of_origin\": \"\",\n \"created_at\": \"\",\n \"description\": \"\",\n \"downloadable\": false,\n \"ean\": \"\",\n \"files\": [\n {\n \"name\": \"\",\n \"url\": \"\"\n }\n ],\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"price\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"harmonized_system_code\": \"\",\n \"height\": \"\",\n \"image_name\": \"\",\n \"image_url\": \"\",\n \"isbn\": \"\",\n \"lang_id\": \"\",\n \"length\": \"\",\n \"listing_duration\": \"\",\n \"listing_type\": \"\",\n \"manage_stock\": false,\n \"manufacturer\": \"\",\n \"marketplace_item_properties\": \"\",\n \"meta_description\": \"\",\n \"meta_keywords\": \"\",\n \"meta_title\": \"\",\n \"model\": \"\",\n \"mpn\": \"\",\n \"name\": \"\",\n \"old_price\": \"\",\n \"ordered_count\": 0,\n \"package_details\": [],\n \"payment_methods\": [],\n \"paypal_email\": \"\",\n \"price\": \"\",\n \"product_class\": \"\",\n \"quantity\": \"\",\n \"return_accepted\": false,\n \"sales_tax\": [],\n \"search_keywords\": \"\",\n \"seller_profiles\": {\n \"payment_profile_id\": \"\",\n \"return_profile_id\": \"\",\n \"shipping_profile_id\": \"\"\n },\n \"seo_url\": \"\",\n \"shipping_details\": [\n {\n \"shipping_cost\": \"\",\n \"shipping_service\": \"\",\n \"shipping_type\": \"\"\n }\n ],\n \"shipping_template_id\": 0,\n \"short_description\": \"\",\n \"sku\": \"\",\n \"special_price\": \"\",\n \"specifics\": [],\n \"sprice_create\": \"\",\n \"sprice_expire\": \"\",\n \"sprice_modified\": \"\",\n \"status\": \"\",\n \"store_id\": \"\",\n \"stores_ids\": \"\",\n \"tags\": \"\",\n \"tax_class_id\": 0,\n \"taxable\": false,\n \"tier_prices\": [\n {\n \"price\": \"\",\n \"quantity\": \"\"\n }\n ],\n \"type\": \"\",\n \"upc\": \"\",\n \"url\": \"\",\n \"viewed_count\": 0,\n \"visible\": \"\",\n \"warehouse_id\": \"\",\n \"weight\": \"\",\n \"weight_unit\": \"\",\n \"wholesale_price\": \"\",\n \"width\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/product.add.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'attribute_name' => '',
'attribute_set_name' => '',
'avail_from' => '',
'available_for_sale' => null,
'available_for_view' => null,
'backorder_status' => '',
'barcode' => '',
'best_offer' => [
],
'brand_name' => '',
'categories_ids' => '',
'category_id' => '',
'clear_cache' => null,
'condition' => '',
'cost_price' => '',
'country_of_origin' => '',
'created_at' => '',
'description' => '',
'downloadable' => null,
'ean' => '',
'files' => [
[
'name' => '',
'url' => ''
]
],
'group_prices' => [
[
'group_id' => '',
'price' => ''
]
],
'gtin' => '',
'harmonized_system_code' => '',
'height' => '',
'image_name' => '',
'image_url' => '',
'isbn' => '',
'lang_id' => '',
'length' => '',
'listing_duration' => '',
'listing_type' => '',
'manage_stock' => null,
'manufacturer' => '',
'marketplace_item_properties' => '',
'meta_description' => '',
'meta_keywords' => '',
'meta_title' => '',
'model' => '',
'mpn' => '',
'name' => '',
'old_price' => '',
'ordered_count' => 0,
'package_details' => [
],
'payment_methods' => [
],
'paypal_email' => '',
'price' => '',
'product_class' => '',
'quantity' => '',
'return_accepted' => null,
'sales_tax' => [
],
'search_keywords' => '',
'seller_profiles' => [
'payment_profile_id' => '',
'return_profile_id' => '',
'shipping_profile_id' => ''
],
'seo_url' => '',
'shipping_details' => [
[
'shipping_cost' => '',
'shipping_service' => '',
'shipping_type' => ''
]
],
'shipping_template_id' => 0,
'short_description' => '',
'sku' => '',
'special_price' => '',
'specifics' => [
],
'sprice_create' => '',
'sprice_expire' => '',
'sprice_modified' => '',
'status' => '',
'store_id' => '',
'stores_ids' => '',
'tags' => '',
'tax_class_id' => 0,
'taxable' => null,
'tier_prices' => [
[
'price' => '',
'quantity' => ''
]
],
'type' => '',
'upc' => '',
'url' => '',
'viewed_count' => 0,
'visible' => '',
'warehouse_id' => '',
'weight' => '',
'weight_unit' => '',
'wholesale_price' => '',
'width' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/product.add.json', [
'body' => '{
"attribute_name": "",
"attribute_set_name": "",
"avail_from": "",
"available_for_sale": false,
"available_for_view": false,
"backorder_status": "",
"barcode": "",
"best_offer": [],
"brand_name": "",
"categories_ids": "",
"category_id": "",
"clear_cache": false,
"condition": "",
"cost_price": "",
"country_of_origin": "",
"created_at": "",
"description": "",
"downloadable": false,
"ean": "",
"files": [
{
"name": "",
"url": ""
}
],
"group_prices": [
{
"group_id": "",
"price": ""
}
],
"gtin": "",
"harmonized_system_code": "",
"height": "",
"image_name": "",
"image_url": "",
"isbn": "",
"lang_id": "",
"length": "",
"listing_duration": "",
"listing_type": "",
"manage_stock": false,
"manufacturer": "",
"marketplace_item_properties": "",
"meta_description": "",
"meta_keywords": "",
"meta_title": "",
"model": "",
"mpn": "",
"name": "",
"old_price": "",
"ordered_count": 0,
"package_details": [],
"payment_methods": [],
"paypal_email": "",
"price": "",
"product_class": "",
"quantity": "",
"return_accepted": false,
"sales_tax": [],
"search_keywords": "",
"seller_profiles": {
"payment_profile_id": "",
"return_profile_id": "",
"shipping_profile_id": ""
},
"seo_url": "",
"shipping_details": [
{
"shipping_cost": "",
"shipping_service": "",
"shipping_type": ""
}
],
"shipping_template_id": 0,
"short_description": "",
"sku": "",
"special_price": "",
"specifics": [],
"sprice_create": "",
"sprice_expire": "",
"sprice_modified": "",
"status": "",
"store_id": "",
"stores_ids": "",
"tags": "",
"tax_class_id": 0,
"taxable": false,
"tier_prices": [
{
"price": "",
"quantity": ""
}
],
"type": "",
"upc": "",
"url": "",
"viewed_count": 0,
"visible": "",
"warehouse_id": "",
"weight": "",
"weight_unit": "",
"wholesale_price": "",
"width": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/product.add.json');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'attribute_name' => '',
'attribute_set_name' => '',
'avail_from' => '',
'available_for_sale' => null,
'available_for_view' => null,
'backorder_status' => '',
'barcode' => '',
'best_offer' => [
],
'brand_name' => '',
'categories_ids' => '',
'category_id' => '',
'clear_cache' => null,
'condition' => '',
'cost_price' => '',
'country_of_origin' => '',
'created_at' => '',
'description' => '',
'downloadable' => null,
'ean' => '',
'files' => [
[
'name' => '',
'url' => ''
]
],
'group_prices' => [
[
'group_id' => '',
'price' => ''
]
],
'gtin' => '',
'harmonized_system_code' => '',
'height' => '',
'image_name' => '',
'image_url' => '',
'isbn' => '',
'lang_id' => '',
'length' => '',
'listing_duration' => '',
'listing_type' => '',
'manage_stock' => null,
'manufacturer' => '',
'marketplace_item_properties' => '',
'meta_description' => '',
'meta_keywords' => '',
'meta_title' => '',
'model' => '',
'mpn' => '',
'name' => '',
'old_price' => '',
'ordered_count' => 0,
'package_details' => [
],
'payment_methods' => [
],
'paypal_email' => '',
'price' => '',
'product_class' => '',
'quantity' => '',
'return_accepted' => null,
'sales_tax' => [
],
'search_keywords' => '',
'seller_profiles' => [
'payment_profile_id' => '',
'return_profile_id' => '',
'shipping_profile_id' => ''
],
'seo_url' => '',
'shipping_details' => [
[
'shipping_cost' => '',
'shipping_service' => '',
'shipping_type' => ''
]
],
'shipping_template_id' => 0,
'short_description' => '',
'sku' => '',
'special_price' => '',
'specifics' => [
],
'sprice_create' => '',
'sprice_expire' => '',
'sprice_modified' => '',
'status' => '',
'store_id' => '',
'stores_ids' => '',
'tags' => '',
'tax_class_id' => 0,
'taxable' => null,
'tier_prices' => [
[
'price' => '',
'quantity' => ''
]
],
'type' => '',
'upc' => '',
'url' => '',
'viewed_count' => 0,
'visible' => '',
'warehouse_id' => '',
'weight' => '',
'weight_unit' => '',
'wholesale_price' => '',
'width' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'attribute_name' => '',
'attribute_set_name' => '',
'avail_from' => '',
'available_for_sale' => null,
'available_for_view' => null,
'backorder_status' => '',
'barcode' => '',
'best_offer' => [
],
'brand_name' => '',
'categories_ids' => '',
'category_id' => '',
'clear_cache' => null,
'condition' => '',
'cost_price' => '',
'country_of_origin' => '',
'created_at' => '',
'description' => '',
'downloadable' => null,
'ean' => '',
'files' => [
[
'name' => '',
'url' => ''
]
],
'group_prices' => [
[
'group_id' => '',
'price' => ''
]
],
'gtin' => '',
'harmonized_system_code' => '',
'height' => '',
'image_name' => '',
'image_url' => '',
'isbn' => '',
'lang_id' => '',
'length' => '',
'listing_duration' => '',
'listing_type' => '',
'manage_stock' => null,
'manufacturer' => '',
'marketplace_item_properties' => '',
'meta_description' => '',
'meta_keywords' => '',
'meta_title' => '',
'model' => '',
'mpn' => '',
'name' => '',
'old_price' => '',
'ordered_count' => 0,
'package_details' => [
],
'payment_methods' => [
],
'paypal_email' => '',
'price' => '',
'product_class' => '',
'quantity' => '',
'return_accepted' => null,
'sales_tax' => [
],
'search_keywords' => '',
'seller_profiles' => [
'payment_profile_id' => '',
'return_profile_id' => '',
'shipping_profile_id' => ''
],
'seo_url' => '',
'shipping_details' => [
[
'shipping_cost' => '',
'shipping_service' => '',
'shipping_type' => ''
]
],
'shipping_template_id' => 0,
'short_description' => '',
'sku' => '',
'special_price' => '',
'specifics' => [
],
'sprice_create' => '',
'sprice_expire' => '',
'sprice_modified' => '',
'status' => '',
'store_id' => '',
'stores_ids' => '',
'tags' => '',
'tax_class_id' => 0,
'taxable' => null,
'tier_prices' => [
[
'price' => '',
'quantity' => ''
]
],
'type' => '',
'upc' => '',
'url' => '',
'viewed_count' => 0,
'visible' => '',
'warehouse_id' => '',
'weight' => '',
'weight_unit' => '',
'wholesale_price' => '',
'width' => ''
]));
$request->setRequestUrl('{{baseUrl}}/product.add.json');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/product.add.json' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"attribute_name": "",
"attribute_set_name": "",
"avail_from": "",
"available_for_sale": false,
"available_for_view": false,
"backorder_status": "",
"barcode": "",
"best_offer": [],
"brand_name": "",
"categories_ids": "",
"category_id": "",
"clear_cache": false,
"condition": "",
"cost_price": "",
"country_of_origin": "",
"created_at": "",
"description": "",
"downloadable": false,
"ean": "",
"files": [
{
"name": "",
"url": ""
}
],
"group_prices": [
{
"group_id": "",
"price": ""
}
],
"gtin": "",
"harmonized_system_code": "",
"height": "",
"image_name": "",
"image_url": "",
"isbn": "",
"lang_id": "",
"length": "",
"listing_duration": "",
"listing_type": "",
"manage_stock": false,
"manufacturer": "",
"marketplace_item_properties": "",
"meta_description": "",
"meta_keywords": "",
"meta_title": "",
"model": "",
"mpn": "",
"name": "",
"old_price": "",
"ordered_count": 0,
"package_details": [],
"payment_methods": [],
"paypal_email": "",
"price": "",
"product_class": "",
"quantity": "",
"return_accepted": false,
"sales_tax": [],
"search_keywords": "",
"seller_profiles": {
"payment_profile_id": "",
"return_profile_id": "",
"shipping_profile_id": ""
},
"seo_url": "",
"shipping_details": [
{
"shipping_cost": "",
"shipping_service": "",
"shipping_type": ""
}
],
"shipping_template_id": 0,
"short_description": "",
"sku": "",
"special_price": "",
"specifics": [],
"sprice_create": "",
"sprice_expire": "",
"sprice_modified": "",
"status": "",
"store_id": "",
"stores_ids": "",
"tags": "",
"tax_class_id": 0,
"taxable": false,
"tier_prices": [
{
"price": "",
"quantity": ""
}
],
"type": "",
"upc": "",
"url": "",
"viewed_count": 0,
"visible": "",
"warehouse_id": "",
"weight": "",
"weight_unit": "",
"wholesale_price": "",
"width": ""
}'
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/product.add.json' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"attribute_name": "",
"attribute_set_name": "",
"avail_from": "",
"available_for_sale": false,
"available_for_view": false,
"backorder_status": "",
"barcode": "",
"best_offer": [],
"brand_name": "",
"categories_ids": "",
"category_id": "",
"clear_cache": false,
"condition": "",
"cost_price": "",
"country_of_origin": "",
"created_at": "",
"description": "",
"downloadable": false,
"ean": "",
"files": [
{
"name": "",
"url": ""
}
],
"group_prices": [
{
"group_id": "",
"price": ""
}
],
"gtin": "",
"harmonized_system_code": "",
"height": "",
"image_name": "",
"image_url": "",
"isbn": "",
"lang_id": "",
"length": "",
"listing_duration": "",
"listing_type": "",
"manage_stock": false,
"manufacturer": "",
"marketplace_item_properties": "",
"meta_description": "",
"meta_keywords": "",
"meta_title": "",
"model": "",
"mpn": "",
"name": "",
"old_price": "",
"ordered_count": 0,
"package_details": [],
"payment_methods": [],
"paypal_email": "",
"price": "",
"product_class": "",
"quantity": "",
"return_accepted": false,
"sales_tax": [],
"search_keywords": "",
"seller_profiles": {
"payment_profile_id": "",
"return_profile_id": "",
"shipping_profile_id": ""
},
"seo_url": "",
"shipping_details": [
{
"shipping_cost": "",
"shipping_service": "",
"shipping_type": ""
}
],
"shipping_template_id": 0,
"short_description": "",
"sku": "",
"special_price": "",
"specifics": [],
"sprice_create": "",
"sprice_expire": "",
"sprice_modified": "",
"status": "",
"store_id": "",
"stores_ids": "",
"tags": "",
"tax_class_id": 0,
"taxable": false,
"tier_prices": [
{
"price": "",
"quantity": ""
}
],
"type": "",
"upc": "",
"url": "",
"viewed_count": 0,
"visible": "",
"warehouse_id": "",
"weight": "",
"weight_unit": "",
"wholesale_price": "",
"width": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"attribute_name\": \"\",\n \"attribute_set_name\": \"\",\n \"avail_from\": \"\",\n \"available_for_sale\": false,\n \"available_for_view\": false,\n \"backorder_status\": \"\",\n \"barcode\": \"\",\n \"best_offer\": [],\n \"brand_name\": \"\",\n \"categories_ids\": \"\",\n \"category_id\": \"\",\n \"clear_cache\": false,\n \"condition\": \"\",\n \"cost_price\": \"\",\n \"country_of_origin\": \"\",\n \"created_at\": \"\",\n \"description\": \"\",\n \"downloadable\": false,\n \"ean\": \"\",\n \"files\": [\n {\n \"name\": \"\",\n \"url\": \"\"\n }\n ],\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"price\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"harmonized_system_code\": \"\",\n \"height\": \"\",\n \"image_name\": \"\",\n \"image_url\": \"\",\n \"isbn\": \"\",\n \"lang_id\": \"\",\n \"length\": \"\",\n \"listing_duration\": \"\",\n \"listing_type\": \"\",\n \"manage_stock\": false,\n \"manufacturer\": \"\",\n \"marketplace_item_properties\": \"\",\n \"meta_description\": \"\",\n \"meta_keywords\": \"\",\n \"meta_title\": \"\",\n \"model\": \"\",\n \"mpn\": \"\",\n \"name\": \"\",\n \"old_price\": \"\",\n \"ordered_count\": 0,\n \"package_details\": [],\n \"payment_methods\": [],\n \"paypal_email\": \"\",\n \"price\": \"\",\n \"product_class\": \"\",\n \"quantity\": \"\",\n \"return_accepted\": false,\n \"sales_tax\": [],\n \"search_keywords\": \"\",\n \"seller_profiles\": {\n \"payment_profile_id\": \"\",\n \"return_profile_id\": \"\",\n \"shipping_profile_id\": \"\"\n },\n \"seo_url\": \"\",\n \"shipping_details\": [\n {\n \"shipping_cost\": \"\",\n \"shipping_service\": \"\",\n \"shipping_type\": \"\"\n }\n ],\n \"shipping_template_id\": 0,\n \"short_description\": \"\",\n \"sku\": \"\",\n \"special_price\": \"\",\n \"specifics\": [],\n \"sprice_create\": \"\",\n \"sprice_expire\": \"\",\n \"sprice_modified\": \"\",\n \"status\": \"\",\n \"store_id\": \"\",\n \"stores_ids\": \"\",\n \"tags\": \"\",\n \"tax_class_id\": 0,\n \"taxable\": false,\n \"tier_prices\": [\n {\n \"price\": \"\",\n \"quantity\": \"\"\n }\n ],\n \"type\": \"\",\n \"upc\": \"\",\n \"url\": \"\",\n \"viewed_count\": 0,\n \"visible\": \"\",\n \"warehouse_id\": \"\",\n \"weight\": \"\",\n \"weight_unit\": \"\",\n \"wholesale_price\": \"\",\n \"width\": \"\"\n}"
headers = {
'x-api-key': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/product.add.json", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/product.add.json"
payload = {
"attribute_name": "",
"attribute_set_name": "",
"avail_from": "",
"available_for_sale": False,
"available_for_view": False,
"backorder_status": "",
"barcode": "",
"best_offer": [],
"brand_name": "",
"categories_ids": "",
"category_id": "",
"clear_cache": False,
"condition": "",
"cost_price": "",
"country_of_origin": "",
"created_at": "",
"description": "",
"downloadable": False,
"ean": "",
"files": [
{
"name": "",
"url": ""
}
],
"group_prices": [
{
"group_id": "",
"price": ""
}
],
"gtin": "",
"harmonized_system_code": "",
"height": "",
"image_name": "",
"image_url": "",
"isbn": "",
"lang_id": "",
"length": "",
"listing_duration": "",
"listing_type": "",
"manage_stock": False,
"manufacturer": "",
"marketplace_item_properties": "",
"meta_description": "",
"meta_keywords": "",
"meta_title": "",
"model": "",
"mpn": "",
"name": "",
"old_price": "",
"ordered_count": 0,
"package_details": [],
"payment_methods": [],
"paypal_email": "",
"price": "",
"product_class": "",
"quantity": "",
"return_accepted": False,
"sales_tax": [],
"search_keywords": "",
"seller_profiles": {
"payment_profile_id": "",
"return_profile_id": "",
"shipping_profile_id": ""
},
"seo_url": "",
"shipping_details": [
{
"shipping_cost": "",
"shipping_service": "",
"shipping_type": ""
}
],
"shipping_template_id": 0,
"short_description": "",
"sku": "",
"special_price": "",
"specifics": [],
"sprice_create": "",
"sprice_expire": "",
"sprice_modified": "",
"status": "",
"store_id": "",
"stores_ids": "",
"tags": "",
"tax_class_id": 0,
"taxable": False,
"tier_prices": [
{
"price": "",
"quantity": ""
}
],
"type": "",
"upc": "",
"url": "",
"viewed_count": 0,
"visible": "",
"warehouse_id": "",
"weight": "",
"weight_unit": "",
"wholesale_price": "",
"width": ""
}
headers = {
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/product.add.json"
payload <- "{\n \"attribute_name\": \"\",\n \"attribute_set_name\": \"\",\n \"avail_from\": \"\",\n \"available_for_sale\": false,\n \"available_for_view\": false,\n \"backorder_status\": \"\",\n \"barcode\": \"\",\n \"best_offer\": [],\n \"brand_name\": \"\",\n \"categories_ids\": \"\",\n \"category_id\": \"\",\n \"clear_cache\": false,\n \"condition\": \"\",\n \"cost_price\": \"\",\n \"country_of_origin\": \"\",\n \"created_at\": \"\",\n \"description\": \"\",\n \"downloadable\": false,\n \"ean\": \"\",\n \"files\": [\n {\n \"name\": \"\",\n \"url\": \"\"\n }\n ],\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"price\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"harmonized_system_code\": \"\",\n \"height\": \"\",\n \"image_name\": \"\",\n \"image_url\": \"\",\n \"isbn\": \"\",\n \"lang_id\": \"\",\n \"length\": \"\",\n \"listing_duration\": \"\",\n \"listing_type\": \"\",\n \"manage_stock\": false,\n \"manufacturer\": \"\",\n \"marketplace_item_properties\": \"\",\n \"meta_description\": \"\",\n \"meta_keywords\": \"\",\n \"meta_title\": \"\",\n \"model\": \"\",\n \"mpn\": \"\",\n \"name\": \"\",\n \"old_price\": \"\",\n \"ordered_count\": 0,\n \"package_details\": [],\n \"payment_methods\": [],\n \"paypal_email\": \"\",\n \"price\": \"\",\n \"product_class\": \"\",\n \"quantity\": \"\",\n \"return_accepted\": false,\n \"sales_tax\": [],\n \"search_keywords\": \"\",\n \"seller_profiles\": {\n \"payment_profile_id\": \"\",\n \"return_profile_id\": \"\",\n \"shipping_profile_id\": \"\"\n },\n \"seo_url\": \"\",\n \"shipping_details\": [\n {\n \"shipping_cost\": \"\",\n \"shipping_service\": \"\",\n \"shipping_type\": \"\"\n }\n ],\n \"shipping_template_id\": 0,\n \"short_description\": \"\",\n \"sku\": \"\",\n \"special_price\": \"\",\n \"specifics\": [],\n \"sprice_create\": \"\",\n \"sprice_expire\": \"\",\n \"sprice_modified\": \"\",\n \"status\": \"\",\n \"store_id\": \"\",\n \"stores_ids\": \"\",\n \"tags\": \"\",\n \"tax_class_id\": 0,\n \"taxable\": false,\n \"tier_prices\": [\n {\n \"price\": \"\",\n \"quantity\": \"\"\n }\n ],\n \"type\": \"\",\n \"upc\": \"\",\n \"url\": \"\",\n \"viewed_count\": 0,\n \"visible\": \"\",\n \"warehouse_id\": \"\",\n \"weight\": \"\",\n \"weight_unit\": \"\",\n \"wholesale_price\": \"\",\n \"width\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/product.add.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"attribute_name\": \"\",\n \"attribute_set_name\": \"\",\n \"avail_from\": \"\",\n \"available_for_sale\": false,\n \"available_for_view\": false,\n \"backorder_status\": \"\",\n \"barcode\": \"\",\n \"best_offer\": [],\n \"brand_name\": \"\",\n \"categories_ids\": \"\",\n \"category_id\": \"\",\n \"clear_cache\": false,\n \"condition\": \"\",\n \"cost_price\": \"\",\n \"country_of_origin\": \"\",\n \"created_at\": \"\",\n \"description\": \"\",\n \"downloadable\": false,\n \"ean\": \"\",\n \"files\": [\n {\n \"name\": \"\",\n \"url\": \"\"\n }\n ],\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"price\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"harmonized_system_code\": \"\",\n \"height\": \"\",\n \"image_name\": \"\",\n \"image_url\": \"\",\n \"isbn\": \"\",\n \"lang_id\": \"\",\n \"length\": \"\",\n \"listing_duration\": \"\",\n \"listing_type\": \"\",\n \"manage_stock\": false,\n \"manufacturer\": \"\",\n \"marketplace_item_properties\": \"\",\n \"meta_description\": \"\",\n \"meta_keywords\": \"\",\n \"meta_title\": \"\",\n \"model\": \"\",\n \"mpn\": \"\",\n \"name\": \"\",\n \"old_price\": \"\",\n \"ordered_count\": 0,\n \"package_details\": [],\n \"payment_methods\": [],\n \"paypal_email\": \"\",\n \"price\": \"\",\n \"product_class\": \"\",\n \"quantity\": \"\",\n \"return_accepted\": false,\n \"sales_tax\": [],\n \"search_keywords\": \"\",\n \"seller_profiles\": {\n \"payment_profile_id\": \"\",\n \"return_profile_id\": \"\",\n \"shipping_profile_id\": \"\"\n },\n \"seo_url\": \"\",\n \"shipping_details\": [\n {\n \"shipping_cost\": \"\",\n \"shipping_service\": \"\",\n \"shipping_type\": \"\"\n }\n ],\n \"shipping_template_id\": 0,\n \"short_description\": \"\",\n \"sku\": \"\",\n \"special_price\": \"\",\n \"specifics\": [],\n \"sprice_create\": \"\",\n \"sprice_expire\": \"\",\n \"sprice_modified\": \"\",\n \"status\": \"\",\n \"store_id\": \"\",\n \"stores_ids\": \"\",\n \"tags\": \"\",\n \"tax_class_id\": 0,\n \"taxable\": false,\n \"tier_prices\": [\n {\n \"price\": \"\",\n \"quantity\": \"\"\n }\n ],\n \"type\": \"\",\n \"upc\": \"\",\n \"url\": \"\",\n \"viewed_count\": 0,\n \"visible\": \"\",\n \"warehouse_id\": \"\",\n \"weight\": \"\",\n \"weight_unit\": \"\",\n \"wholesale_price\": \"\",\n \"width\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/product.add.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.body = "{\n \"attribute_name\": \"\",\n \"attribute_set_name\": \"\",\n \"avail_from\": \"\",\n \"available_for_sale\": false,\n \"available_for_view\": false,\n \"backorder_status\": \"\",\n \"barcode\": \"\",\n \"best_offer\": [],\n \"brand_name\": \"\",\n \"categories_ids\": \"\",\n \"category_id\": \"\",\n \"clear_cache\": false,\n \"condition\": \"\",\n \"cost_price\": \"\",\n \"country_of_origin\": \"\",\n \"created_at\": \"\",\n \"description\": \"\",\n \"downloadable\": false,\n \"ean\": \"\",\n \"files\": [\n {\n \"name\": \"\",\n \"url\": \"\"\n }\n ],\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"price\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"harmonized_system_code\": \"\",\n \"height\": \"\",\n \"image_name\": \"\",\n \"image_url\": \"\",\n \"isbn\": \"\",\n \"lang_id\": \"\",\n \"length\": \"\",\n \"listing_duration\": \"\",\n \"listing_type\": \"\",\n \"manage_stock\": false,\n \"manufacturer\": \"\",\n \"marketplace_item_properties\": \"\",\n \"meta_description\": \"\",\n \"meta_keywords\": \"\",\n \"meta_title\": \"\",\n \"model\": \"\",\n \"mpn\": \"\",\n \"name\": \"\",\n \"old_price\": \"\",\n \"ordered_count\": 0,\n \"package_details\": [],\n \"payment_methods\": [],\n \"paypal_email\": \"\",\n \"price\": \"\",\n \"product_class\": \"\",\n \"quantity\": \"\",\n \"return_accepted\": false,\n \"sales_tax\": [],\n \"search_keywords\": \"\",\n \"seller_profiles\": {\n \"payment_profile_id\": \"\",\n \"return_profile_id\": \"\",\n \"shipping_profile_id\": \"\"\n },\n \"seo_url\": \"\",\n \"shipping_details\": [\n {\n \"shipping_cost\": \"\",\n \"shipping_service\": \"\",\n \"shipping_type\": \"\"\n }\n ],\n \"shipping_template_id\": 0,\n \"short_description\": \"\",\n \"sku\": \"\",\n \"special_price\": \"\",\n \"specifics\": [],\n \"sprice_create\": \"\",\n \"sprice_expire\": \"\",\n \"sprice_modified\": \"\",\n \"status\": \"\",\n \"store_id\": \"\",\n \"stores_ids\": \"\",\n \"tags\": \"\",\n \"tax_class_id\": 0,\n \"taxable\": false,\n \"tier_prices\": [\n {\n \"price\": \"\",\n \"quantity\": \"\"\n }\n ],\n \"type\": \"\",\n \"upc\": \"\",\n \"url\": \"\",\n \"viewed_count\": 0,\n \"visible\": \"\",\n \"warehouse_id\": \"\",\n \"weight\": \"\",\n \"weight_unit\": \"\",\n \"wholesale_price\": \"\",\n \"width\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/product.add.json";
let payload = json!({
"attribute_name": "",
"attribute_set_name": "",
"avail_from": "",
"available_for_sale": false,
"available_for_view": false,
"backorder_status": "",
"barcode": "",
"best_offer": (),
"brand_name": "",
"categories_ids": "",
"category_id": "",
"clear_cache": false,
"condition": "",
"cost_price": "",
"country_of_origin": "",
"created_at": "",
"description": "",
"downloadable": false,
"ean": "",
"files": (
json!({
"name": "",
"url": ""
})
),
"group_prices": (
json!({
"group_id": "",
"price": ""
})
),
"gtin": "",
"harmonized_system_code": "",
"height": "",
"image_name": "",
"image_url": "",
"isbn": "",
"lang_id": "",
"length": "",
"listing_duration": "",
"listing_type": "",
"manage_stock": false,
"manufacturer": "",
"marketplace_item_properties": "",
"meta_description": "",
"meta_keywords": "",
"meta_title": "",
"model": "",
"mpn": "",
"name": "",
"old_price": "",
"ordered_count": 0,
"package_details": (),
"payment_methods": (),
"paypal_email": "",
"price": "",
"product_class": "",
"quantity": "",
"return_accepted": false,
"sales_tax": (),
"search_keywords": "",
"seller_profiles": json!({
"payment_profile_id": "",
"return_profile_id": "",
"shipping_profile_id": ""
}),
"seo_url": "",
"shipping_details": (
json!({
"shipping_cost": "",
"shipping_service": "",
"shipping_type": ""
})
),
"shipping_template_id": 0,
"short_description": "",
"sku": "",
"special_price": "",
"specifics": (),
"sprice_create": "",
"sprice_expire": "",
"sprice_modified": "",
"status": "",
"store_id": "",
"stores_ids": "",
"tags": "",
"tax_class_id": 0,
"taxable": false,
"tier_prices": (
json!({
"price": "",
"quantity": ""
})
),
"type": "",
"upc": "",
"url": "",
"viewed_count": 0,
"visible": "",
"warehouse_id": "",
"weight": "",
"weight_unit": "",
"wholesale_price": "",
"width": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/product.add.json \
--header 'content-type: application/json' \
--header 'x-api-key: {{apiKey}}' \
--data '{
"attribute_name": "",
"attribute_set_name": "",
"avail_from": "",
"available_for_sale": false,
"available_for_view": false,
"backorder_status": "",
"barcode": "",
"best_offer": [],
"brand_name": "",
"categories_ids": "",
"category_id": "",
"clear_cache": false,
"condition": "",
"cost_price": "",
"country_of_origin": "",
"created_at": "",
"description": "",
"downloadable": false,
"ean": "",
"files": [
{
"name": "",
"url": ""
}
],
"group_prices": [
{
"group_id": "",
"price": ""
}
],
"gtin": "",
"harmonized_system_code": "",
"height": "",
"image_name": "",
"image_url": "",
"isbn": "",
"lang_id": "",
"length": "",
"listing_duration": "",
"listing_type": "",
"manage_stock": false,
"manufacturer": "",
"marketplace_item_properties": "",
"meta_description": "",
"meta_keywords": "",
"meta_title": "",
"model": "",
"mpn": "",
"name": "",
"old_price": "",
"ordered_count": 0,
"package_details": [],
"payment_methods": [],
"paypal_email": "",
"price": "",
"product_class": "",
"quantity": "",
"return_accepted": false,
"sales_tax": [],
"search_keywords": "",
"seller_profiles": {
"payment_profile_id": "",
"return_profile_id": "",
"shipping_profile_id": ""
},
"seo_url": "",
"shipping_details": [
{
"shipping_cost": "",
"shipping_service": "",
"shipping_type": ""
}
],
"shipping_template_id": 0,
"short_description": "",
"sku": "",
"special_price": "",
"specifics": [],
"sprice_create": "",
"sprice_expire": "",
"sprice_modified": "",
"status": "",
"store_id": "",
"stores_ids": "",
"tags": "",
"tax_class_id": 0,
"taxable": false,
"tier_prices": [
{
"price": "",
"quantity": ""
}
],
"type": "",
"upc": "",
"url": "",
"viewed_count": 0,
"visible": "",
"warehouse_id": "",
"weight": "",
"weight_unit": "",
"wholesale_price": "",
"width": ""
}'
echo '{
"attribute_name": "",
"attribute_set_name": "",
"avail_from": "",
"available_for_sale": false,
"available_for_view": false,
"backorder_status": "",
"barcode": "",
"best_offer": [],
"brand_name": "",
"categories_ids": "",
"category_id": "",
"clear_cache": false,
"condition": "",
"cost_price": "",
"country_of_origin": "",
"created_at": "",
"description": "",
"downloadable": false,
"ean": "",
"files": [
{
"name": "",
"url": ""
}
],
"group_prices": [
{
"group_id": "",
"price": ""
}
],
"gtin": "",
"harmonized_system_code": "",
"height": "",
"image_name": "",
"image_url": "",
"isbn": "",
"lang_id": "",
"length": "",
"listing_duration": "",
"listing_type": "",
"manage_stock": false,
"manufacturer": "",
"marketplace_item_properties": "",
"meta_description": "",
"meta_keywords": "",
"meta_title": "",
"model": "",
"mpn": "",
"name": "",
"old_price": "",
"ordered_count": 0,
"package_details": [],
"payment_methods": [],
"paypal_email": "",
"price": "",
"product_class": "",
"quantity": "",
"return_accepted": false,
"sales_tax": [],
"search_keywords": "",
"seller_profiles": {
"payment_profile_id": "",
"return_profile_id": "",
"shipping_profile_id": ""
},
"seo_url": "",
"shipping_details": [
{
"shipping_cost": "",
"shipping_service": "",
"shipping_type": ""
}
],
"shipping_template_id": 0,
"short_description": "",
"sku": "",
"special_price": "",
"specifics": [],
"sprice_create": "",
"sprice_expire": "",
"sprice_modified": "",
"status": "",
"store_id": "",
"stores_ids": "",
"tags": "",
"tax_class_id": 0,
"taxable": false,
"tier_prices": [
{
"price": "",
"quantity": ""
}
],
"type": "",
"upc": "",
"url": "",
"viewed_count": 0,
"visible": "",
"warehouse_id": "",
"weight": "",
"weight_unit": "",
"wholesale_price": "",
"width": ""
}' | \
http POST {{baseUrl}}/product.add.json \
content-type:application/json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "attribute_name": "",\n "attribute_set_name": "",\n "avail_from": "",\n "available_for_sale": false,\n "available_for_view": false,\n "backorder_status": "",\n "barcode": "",\n "best_offer": [],\n "brand_name": "",\n "categories_ids": "",\n "category_id": "",\n "clear_cache": false,\n "condition": "",\n "cost_price": "",\n "country_of_origin": "",\n "created_at": "",\n "description": "",\n "downloadable": false,\n "ean": "",\n "files": [\n {\n "name": "",\n "url": ""\n }\n ],\n "group_prices": [\n {\n "group_id": "",\n "price": ""\n }\n ],\n "gtin": "",\n "harmonized_system_code": "",\n "height": "",\n "image_name": "",\n "image_url": "",\n "isbn": "",\n "lang_id": "",\n "length": "",\n "listing_duration": "",\n "listing_type": "",\n "manage_stock": false,\n "manufacturer": "",\n "marketplace_item_properties": "",\n "meta_description": "",\n "meta_keywords": "",\n "meta_title": "",\n "model": "",\n "mpn": "",\n "name": "",\n "old_price": "",\n "ordered_count": 0,\n "package_details": [],\n "payment_methods": [],\n "paypal_email": "",\n "price": "",\n "product_class": "",\n "quantity": "",\n "return_accepted": false,\n "sales_tax": [],\n "search_keywords": "",\n "seller_profiles": {\n "payment_profile_id": "",\n "return_profile_id": "",\n "shipping_profile_id": ""\n },\n "seo_url": "",\n "shipping_details": [\n {\n "shipping_cost": "",\n "shipping_service": "",\n "shipping_type": ""\n }\n ],\n "shipping_template_id": 0,\n "short_description": "",\n "sku": "",\n "special_price": "",\n "specifics": [],\n "sprice_create": "",\n "sprice_expire": "",\n "sprice_modified": "",\n "status": "",\n "store_id": "",\n "stores_ids": "",\n "tags": "",\n "tax_class_id": 0,\n "taxable": false,\n "tier_prices": [\n {\n "price": "",\n "quantity": ""\n }\n ],\n "type": "",\n "upc": "",\n "url": "",\n "viewed_count": 0,\n "visible": "",\n "warehouse_id": "",\n "weight": "",\n "weight_unit": "",\n "wholesale_price": "",\n "width": ""\n}' \
--output-document \
- {{baseUrl}}/product.add.json
import Foundation
let headers = [
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"attribute_name": "",
"attribute_set_name": "",
"avail_from": "",
"available_for_sale": false,
"available_for_view": false,
"backorder_status": "",
"barcode": "",
"best_offer": [],
"brand_name": "",
"categories_ids": "",
"category_id": "",
"clear_cache": false,
"condition": "",
"cost_price": "",
"country_of_origin": "",
"created_at": "",
"description": "",
"downloadable": false,
"ean": "",
"files": [
[
"name": "",
"url": ""
]
],
"group_prices": [
[
"group_id": "",
"price": ""
]
],
"gtin": "",
"harmonized_system_code": "",
"height": "",
"image_name": "",
"image_url": "",
"isbn": "",
"lang_id": "",
"length": "",
"listing_duration": "",
"listing_type": "",
"manage_stock": false,
"manufacturer": "",
"marketplace_item_properties": "",
"meta_description": "",
"meta_keywords": "",
"meta_title": "",
"model": "",
"mpn": "",
"name": "",
"old_price": "",
"ordered_count": 0,
"package_details": [],
"payment_methods": [],
"paypal_email": "",
"price": "",
"product_class": "",
"quantity": "",
"return_accepted": false,
"sales_tax": [],
"search_keywords": "",
"seller_profiles": [
"payment_profile_id": "",
"return_profile_id": "",
"shipping_profile_id": ""
],
"seo_url": "",
"shipping_details": [
[
"shipping_cost": "",
"shipping_service": "",
"shipping_type": ""
]
],
"shipping_template_id": 0,
"short_description": "",
"sku": "",
"special_price": "",
"specifics": [],
"sprice_create": "",
"sprice_expire": "",
"sprice_modified": "",
"status": "",
"store_id": "",
"stores_ids": "",
"tags": "",
"tax_class_id": 0,
"taxable": false,
"tier_prices": [
[
"price": "",
"quantity": ""
]
],
"type": "",
"upc": "",
"url": "",
"viewed_count": 0,
"visible": "",
"warehouse_id": "",
"weight": "",
"weight_unit": "",
"wholesale_price": "",
"width": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/product.add.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
ProductAttributeList
{{baseUrl}}/product.attribute.list.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
product_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/product.attribute.list.json?product_id=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/product.attribute.list.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:product_id ""}})
require "http/client"
url = "{{baseUrl}}/product.attribute.list.json?product_id="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/product.attribute.list.json?product_id="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/product.attribute.list.json?product_id=");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/product.attribute.list.json?product_id="
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/product.attribute.list.json?product_id= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/product.attribute.list.json?product_id=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/product.attribute.list.json?product_id="))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/product.attribute.list.json?product_id=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/product.attribute.list.json?product_id=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/product.attribute.list.json?product_id=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/product.attribute.list.json',
params: {product_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/product.attribute.list.json?product_id=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/product.attribute.list.json?product_id=',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/product.attribute.list.json?product_id=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/product.attribute.list.json?product_id=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/product.attribute.list.json',
qs: {product_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/product.attribute.list.json');
req.query({
product_id: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/product.attribute.list.json',
params: {product_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/product.attribute.list.json?product_id=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/product.attribute.list.json?product_id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/product.attribute.list.json?product_id=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/product.attribute.list.json?product_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 => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/product.attribute.list.json?product_id=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/product.attribute.list.json');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'product_id' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/product.attribute.list.json');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'product_id' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/product.attribute.list.json?product_id=' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/product.attribute.list.json?product_id=' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/product.attribute.list.json?product_id=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/product.attribute.list.json"
querystring = {"product_id":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/product.attribute.list.json"
queryString <- list(product_id = "")
response <- VERB("GET", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/product.attribute.list.json?product_id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/product.attribute.list.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['product_id'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/product.attribute.list.json";
let querystring = [
("product_id", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/product.attribute.list.json?product_id=' \
--header 'x-api-key: {{apiKey}}'
http GET '{{baseUrl}}/product.attribute.list.json?product_id=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/product.attribute.list.json?product_id='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/product.attribute.list.json?product_id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
ProductAttributeValueSet
{{baseUrl}}/product.attribute.value.set.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
product_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/product.attribute.value.set.json?product_id=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/product.attribute.value.set.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:product_id ""}})
require "http/client"
url = "{{baseUrl}}/product.attribute.value.set.json?product_id="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.post url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/product.attribute.value.set.json?product_id="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/product.attribute.value.set.json?product_id=");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/product.attribute.value.set.json?product_id="
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/product.attribute.value.set.json?product_id= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/product.attribute.value.set.json?product_id=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/product.attribute.value.set.json?product_id="))
.header("x-api-key", "{{apiKey}}")
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/product.attribute.value.set.json?product_id=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/product.attribute.value.set.json?product_id=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/product.attribute.value.set.json?product_id=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/product.attribute.value.set.json',
params: {product_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/product.attribute.value.set.json?product_id=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/product.attribute.value.set.json?product_id=',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/product.attribute.value.set.json?product_id=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/product.attribute.value.set.json?product_id=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/product.attribute.value.set.json',
qs: {product_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/product.attribute.value.set.json');
req.query({
product_id: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/product.attribute.value.set.json',
params: {product_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/product.attribute.value.set.json?product_id=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/product.attribute.value.set.json?product_id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/product.attribute.value.set.json?product_id=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/product.attribute.value.set.json?product_id=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/product.attribute.value.set.json?product_id=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/product.attribute.value.set.json');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'product_id' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/product.attribute.value.set.json');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'product_id' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/product.attribute.value.set.json?product_id=' -Method POST -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/product.attribute.value.set.json?product_id=' -Method POST -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("POST", "/baseUrl/product.attribute.value.set.json?product_id=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/product.attribute.value.set.json"
querystring = {"product_id":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.post(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/product.attribute.value.set.json"
queryString <- list(product_id = "")
response <- VERB("POST", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/product.attribute.value.set.json?product_id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/product.attribute.value.set.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['product_id'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/product.attribute.value.set.json";
let querystring = [
("product_id", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/product.attribute.value.set.json?product_id=' \
--header 'x-api-key: {{apiKey}}'
http POST '{{baseUrl}}/product.attribute.value.set.json?product_id=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/product.attribute.value.set.json?product_id='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/product.attribute.value.set.json?product_id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
ProductAttributeValueUnset
{{baseUrl}}/product.attribute.value.unset.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
product_id
attribute_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/product.attribute.value.unset.json?product_id=&attribute_id=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/product.attribute.value.unset.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:product_id ""
:attribute_id ""}})
require "http/client"
url = "{{baseUrl}}/product.attribute.value.unset.json?product_id=&attribute_id="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.post url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/product.attribute.value.unset.json?product_id=&attribute_id="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/product.attribute.value.unset.json?product_id=&attribute_id=");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/product.attribute.value.unset.json?product_id=&attribute_id="
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/product.attribute.value.unset.json?product_id=&attribute_id= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/product.attribute.value.unset.json?product_id=&attribute_id=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/product.attribute.value.unset.json?product_id=&attribute_id="))
.header("x-api-key", "{{apiKey}}")
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/product.attribute.value.unset.json?product_id=&attribute_id=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/product.attribute.value.unset.json?product_id=&attribute_id=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/product.attribute.value.unset.json?product_id=&attribute_id=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/product.attribute.value.unset.json',
params: {product_id: '', attribute_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/product.attribute.value.unset.json?product_id=&attribute_id=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/product.attribute.value.unset.json?product_id=&attribute_id=',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/product.attribute.value.unset.json?product_id=&attribute_id=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/product.attribute.value.unset.json?product_id=&attribute_id=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/product.attribute.value.unset.json',
qs: {product_id: '', attribute_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/product.attribute.value.unset.json');
req.query({
product_id: '',
attribute_id: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/product.attribute.value.unset.json',
params: {product_id: '', attribute_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/product.attribute.value.unset.json?product_id=&attribute_id=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/product.attribute.value.unset.json?product_id=&attribute_id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/product.attribute.value.unset.json?product_id=&attribute_id=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/product.attribute.value.unset.json?product_id=&attribute_id=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/product.attribute.value.unset.json?product_id=&attribute_id=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/product.attribute.value.unset.json');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'product_id' => '',
'attribute_id' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/product.attribute.value.unset.json');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'product_id' => '',
'attribute_id' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/product.attribute.value.unset.json?product_id=&attribute_id=' -Method POST -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/product.attribute.value.unset.json?product_id=&attribute_id=' -Method POST -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("POST", "/baseUrl/product.attribute.value.unset.json?product_id=&attribute_id=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/product.attribute.value.unset.json"
querystring = {"product_id":"","attribute_id":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.post(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/product.attribute.value.unset.json"
queryString <- list(
product_id = "",
attribute_id = ""
)
response <- VERB("POST", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/product.attribute.value.unset.json?product_id=&attribute_id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/product.attribute.value.unset.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['product_id'] = ''
req.params['attribute_id'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/product.attribute.value.unset.json";
let querystring = [
("product_id", ""),
("attribute_id", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/product.attribute.value.unset.json?product_id=&attribute_id=' \
--header 'x-api-key: {{apiKey}}'
http POST '{{baseUrl}}/product.attribute.value.unset.json?product_id=&attribute_id=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/product.attribute.value.unset.json?product_id=&attribute_id='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/product.attribute.value.unset.json?product_id=&attribute_id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
ProductBrandList
{{baseUrl}}/product.brand.list.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/product.brand.list.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/product.brand.list.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/product.brand.list.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/product.brand.list.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/product.brand.list.json");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/product.brand.list.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/product.brand.list.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/product.brand.list.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/product.brand.list.json"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/product.brand.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/product.brand.list.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/product.brand.list.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/product.brand.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/product.brand.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/product.brand.list.json',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/product.brand.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/product.brand.list.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/product.brand.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/product.brand.list.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/product.brand.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/product.brand.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/product.brand.list.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/product.brand.list.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/product.brand.list.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/product.brand.list.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/product.brand.list.json');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/product.brand.list.json');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/product.brand.list.json' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/product.brand.list.json' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/product.brand.list.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/product.brand.list.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/product.brand.list.json"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/product.brand.list.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/product.brand.list.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/product.brand.list.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/product.brand.list.json \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/product.brand.list.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/product.brand.list.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/product.brand.list.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
ProductChildItemFind
{{baseUrl}}/product.child_item.find.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
find_value
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/product.child_item.find.json?find_value=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/product.child_item.find.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:find_value ""}})
require "http/client"
url = "{{baseUrl}}/product.child_item.find.json?find_value="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/product.child_item.find.json?find_value="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/product.child_item.find.json?find_value=");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/product.child_item.find.json?find_value="
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/product.child_item.find.json?find_value= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/product.child_item.find.json?find_value=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/product.child_item.find.json?find_value="))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/product.child_item.find.json?find_value=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/product.child_item.find.json?find_value=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/product.child_item.find.json?find_value=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/product.child_item.find.json',
params: {find_value: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/product.child_item.find.json?find_value=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/product.child_item.find.json?find_value=',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/product.child_item.find.json?find_value=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/product.child_item.find.json?find_value=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/product.child_item.find.json',
qs: {find_value: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/product.child_item.find.json');
req.query({
find_value: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/product.child_item.find.json',
params: {find_value: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/product.child_item.find.json?find_value=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/product.child_item.find.json?find_value="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/product.child_item.find.json?find_value=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/product.child_item.find.json?find_value=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/product.child_item.find.json?find_value=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/product.child_item.find.json');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'find_value' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/product.child_item.find.json');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'find_value' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/product.child_item.find.json?find_value=' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/product.child_item.find.json?find_value=' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/product.child_item.find.json?find_value=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/product.child_item.find.json"
querystring = {"find_value":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/product.child_item.find.json"
queryString <- list(find_value = "")
response <- VERB("GET", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/product.child_item.find.json?find_value=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/product.child_item.find.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['find_value'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/product.child_item.find.json";
let querystring = [
("find_value", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/product.child_item.find.json?find_value=' \
--header 'x-api-key: {{apiKey}}'
http GET '{{baseUrl}}/product.child_item.find.json?find_value=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/product.child_item.find.json?find_value='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/product.child_item.find.json?find_value=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
ProductChildItemInfo
{{baseUrl}}/product.child_item.info.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
product_id
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/product.child_item.info.json?product_id=&id=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/product.child_item.info.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:product_id ""
:id ""}})
require "http/client"
url = "{{baseUrl}}/product.child_item.info.json?product_id=&id="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/product.child_item.info.json?product_id=&id="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/product.child_item.info.json?product_id=&id=");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/product.child_item.info.json?product_id=&id="
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/product.child_item.info.json?product_id=&id= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/product.child_item.info.json?product_id=&id=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/product.child_item.info.json?product_id=&id="))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/product.child_item.info.json?product_id=&id=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/product.child_item.info.json?product_id=&id=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/product.child_item.info.json?product_id=&id=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/product.child_item.info.json',
params: {product_id: '', id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/product.child_item.info.json?product_id=&id=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/product.child_item.info.json?product_id=&id=',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/product.child_item.info.json?product_id=&id=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/product.child_item.info.json?product_id=&id=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/product.child_item.info.json',
qs: {product_id: '', id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/product.child_item.info.json');
req.query({
product_id: '',
id: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/product.child_item.info.json',
params: {product_id: '', id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/product.child_item.info.json?product_id=&id=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/product.child_item.info.json?product_id=&id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/product.child_item.info.json?product_id=&id=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/product.child_item.info.json?product_id=&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 => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/product.child_item.info.json?product_id=&id=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/product.child_item.info.json');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'product_id' => '',
'id' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/product.child_item.info.json');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'product_id' => '',
'id' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/product.child_item.info.json?product_id=&id=' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/product.child_item.info.json?product_id=&id=' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/product.child_item.info.json?product_id=&id=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/product.child_item.info.json"
querystring = {"product_id":"","id":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/product.child_item.info.json"
queryString <- list(
product_id = "",
id = ""
)
response <- VERB("GET", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/product.child_item.info.json?product_id=&id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/product.child_item.info.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['product_id'] = ''
req.params['id'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/product.child_item.info.json";
let querystring = [
("product_id", ""),
("id", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/product.child_item.info.json?product_id=&id=' \
--header 'x-api-key: {{apiKey}}'
http GET '{{baseUrl}}/product.child_item.info.json?product_id=&id=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/product.child_item.info.json?product_id=&id='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/product.child_item.info.json?product_id=&id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
ProductChildItemList
{{baseUrl}}/product.child_item.list.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/product.child_item.list.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/product.child_item.list.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/product.child_item.list.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/product.child_item.list.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/product.child_item.list.json");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/product.child_item.list.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/product.child_item.list.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/product.child_item.list.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/product.child_item.list.json"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/product.child_item.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/product.child_item.list.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/product.child_item.list.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/product.child_item.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/product.child_item.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/product.child_item.list.json',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/product.child_item.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/product.child_item.list.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/product.child_item.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/product.child_item.list.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/product.child_item.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/product.child_item.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/product.child_item.list.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/product.child_item.list.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/product.child_item.list.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/product.child_item.list.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/product.child_item.list.json');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/product.child_item.list.json');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/product.child_item.list.json' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/product.child_item.list.json' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/product.child_item.list.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/product.child_item.list.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/product.child_item.list.json"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/product.child_item.list.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/product.child_item.list.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/product.child_item.list.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/product.child_item.list.json \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/product.child_item.list.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/product.child_item.list.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/product.child_item.list.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
ProductCount
{{baseUrl}}/product.count.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/product.count.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/product.count.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/product.count.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/product.count.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/product.count.json");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/product.count.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/product.count.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/product.count.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/product.count.json"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/product.count.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/product.count.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/product.count.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/product.count.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/product.count.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/product.count.json',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/product.count.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/product.count.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/product.count.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/product.count.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/product.count.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/product.count.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/product.count.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/product.count.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/product.count.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/product.count.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/product.count.json');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/product.count.json');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/product.count.json' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/product.count.json' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/product.count.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/product.count.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/product.count.json"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/product.count.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/product.count.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/product.count.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/product.count.json \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/product.count.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/product.count.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/product.count.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
ProductCurrencyAdd
{{baseUrl}}/product.currency.add.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
iso3
rate
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/product.currency.add.json?iso3=&rate=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/product.currency.add.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:iso3 ""
:rate ""}})
require "http/client"
url = "{{baseUrl}}/product.currency.add.json?iso3=&rate="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.post url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/product.currency.add.json?iso3=&rate="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/product.currency.add.json?iso3=&rate=");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/product.currency.add.json?iso3=&rate="
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/product.currency.add.json?iso3=&rate= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/product.currency.add.json?iso3=&rate=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/product.currency.add.json?iso3=&rate="))
.header("x-api-key", "{{apiKey}}")
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/product.currency.add.json?iso3=&rate=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/product.currency.add.json?iso3=&rate=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/product.currency.add.json?iso3=&rate=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/product.currency.add.json',
params: {iso3: '', rate: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/product.currency.add.json?iso3=&rate=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/product.currency.add.json?iso3=&rate=',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/product.currency.add.json?iso3=&rate=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/product.currency.add.json?iso3=&rate=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/product.currency.add.json',
qs: {iso3: '', rate: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/product.currency.add.json');
req.query({
iso3: '',
rate: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/product.currency.add.json',
params: {iso3: '', rate: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/product.currency.add.json?iso3=&rate=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/product.currency.add.json?iso3=&rate="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/product.currency.add.json?iso3=&rate=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/product.currency.add.json?iso3=&rate=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/product.currency.add.json?iso3=&rate=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/product.currency.add.json');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'iso3' => '',
'rate' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/product.currency.add.json');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'iso3' => '',
'rate' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/product.currency.add.json?iso3=&rate=' -Method POST -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/product.currency.add.json?iso3=&rate=' -Method POST -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("POST", "/baseUrl/product.currency.add.json?iso3=&rate=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/product.currency.add.json"
querystring = {"iso3":"","rate":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.post(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/product.currency.add.json"
queryString <- list(
iso3 = "",
rate = ""
)
response <- VERB("POST", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/product.currency.add.json?iso3=&rate=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/product.currency.add.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['iso3'] = ''
req.params['rate'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/product.currency.add.json";
let querystring = [
("iso3", ""),
("rate", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/product.currency.add.json?iso3=&rate=' \
--header 'x-api-key: {{apiKey}}'
http POST '{{baseUrl}}/product.currency.add.json?iso3=&rate=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/product.currency.add.json?iso3=&rate='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/product.currency.add.json?iso3=&rate=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
ProductCurrencyList
{{baseUrl}}/product.currency.list.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/product.currency.list.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/product.currency.list.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/product.currency.list.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/product.currency.list.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/product.currency.list.json");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/product.currency.list.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/product.currency.list.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/product.currency.list.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/product.currency.list.json"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/product.currency.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/product.currency.list.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/product.currency.list.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/product.currency.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/product.currency.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/product.currency.list.json',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/product.currency.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/product.currency.list.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/product.currency.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/product.currency.list.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/product.currency.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/product.currency.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/product.currency.list.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/product.currency.list.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/product.currency.list.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/product.currency.list.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/product.currency.list.json');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/product.currency.list.json');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/product.currency.list.json' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/product.currency.list.json' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/product.currency.list.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/product.currency.list.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/product.currency.list.json"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/product.currency.list.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/product.currency.list.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/product.currency.list.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/product.currency.list.json \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/product.currency.list.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/product.currency.list.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/product.currency.list.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
DELETE
ProductDelete
{{baseUrl}}/product.delete.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/product.delete.json?id=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/product.delete.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:id ""}})
require "http/client"
url = "{{baseUrl}}/product.delete.json?id="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.delete url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/product.delete.json?id="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/product.delete.json?id=");
var request = new RestRequest("", Method.Delete);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/product.delete.json?id="
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/product.delete.json?id= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/product.delete.json?id=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/product.delete.json?id="))
.header("x-api-key", "{{apiKey}}")
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/product.delete.json?id=")
.delete(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/product.delete.json?id=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/product.delete.json?id=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/product.delete.json',
params: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/product.delete.json?id=';
const options = {method: 'DELETE', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/product.delete.json?id=',
method: 'DELETE',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/product.delete.json?id=")
.delete(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/product.delete.json?id=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/product.delete.json',
qs: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/product.delete.json');
req.query({
id: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/product.delete.json',
params: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/product.delete.json?id=';
const options = {method: 'DELETE', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/product.delete.json?id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/product.delete.json?id=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/product.delete.json?id=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/product.delete.json?id=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/product.delete.json');
$request->setMethod(HTTP_METH_DELETE);
$request->setQueryData([
'id' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/product.delete.json');
$request->setRequestMethod('DELETE');
$request->setQuery(new http\QueryString([
'id' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/product.delete.json?id=' -Method DELETE -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/product.delete.json?id=' -Method DELETE -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("DELETE", "/baseUrl/product.delete.json?id=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/product.delete.json"
querystring = {"id":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.delete(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/product.delete.json"
queryString <- list(id = "")
response <- VERB("DELETE", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/product.delete.json?id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/product.delete.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['id'] = ''
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/product.delete.json";
let querystring = [
("id", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url '{{baseUrl}}/product.delete.json?id=' \
--header 'x-api-key: {{apiKey}}'
http DELETE '{{baseUrl}}/product.delete.json?id=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method DELETE \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/product.delete.json?id='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/product.delete.json?id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
ProductFields
{{baseUrl}}/product.fields.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/product.fields.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/product.fields.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/product.fields.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/product.fields.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/product.fields.json");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/product.fields.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/product.fields.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/product.fields.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/product.fields.json"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/product.fields.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/product.fields.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/product.fields.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/product.fields.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/product.fields.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/product.fields.json',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/product.fields.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/product.fields.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/product.fields.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/product.fields.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/product.fields.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/product.fields.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/product.fields.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/product.fields.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/product.fields.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/product.fields.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/product.fields.json');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/product.fields.json');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/product.fields.json' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/product.fields.json' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/product.fields.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/product.fields.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/product.fields.json"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/product.fields.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/product.fields.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/product.fields.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/product.fields.json \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/product.fields.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/product.fields.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/product.fields.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
ProductFind
{{baseUrl}}/product.find.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
find_value
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/product.find.json?find_value=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/product.find.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:find_value ""}})
require "http/client"
url = "{{baseUrl}}/product.find.json?find_value="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/product.find.json?find_value="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/product.find.json?find_value=");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/product.find.json?find_value="
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/product.find.json?find_value= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/product.find.json?find_value=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/product.find.json?find_value="))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/product.find.json?find_value=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/product.find.json?find_value=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/product.find.json?find_value=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/product.find.json',
params: {find_value: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/product.find.json?find_value=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/product.find.json?find_value=',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/product.find.json?find_value=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/product.find.json?find_value=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/product.find.json',
qs: {find_value: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/product.find.json');
req.query({
find_value: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/product.find.json',
params: {find_value: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/product.find.json?find_value=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/product.find.json?find_value="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/product.find.json?find_value=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/product.find.json?find_value=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/product.find.json?find_value=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/product.find.json');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'find_value' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/product.find.json');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'find_value' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/product.find.json?find_value=' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/product.find.json?find_value=' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/product.find.json?find_value=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/product.find.json"
querystring = {"find_value":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/product.find.json"
queryString <- list(find_value = "")
response <- VERB("GET", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/product.find.json?find_value=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/product.find.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['find_value'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/product.find.json";
let querystring = [
("find_value", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/product.find.json?find_value=' \
--header 'x-api-key: {{apiKey}}'
http GET '{{baseUrl}}/product.find.json?find_value=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/product.find.json?find_value='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/product.find.json?find_value=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
ProductImageAdd
{{baseUrl}}/product.image.add.json
HEADERS
x-api-key
{{apiKey}}
BODY json
{
"content": "",
"image_name": "",
"label": "",
"lang_id": "",
"mime": "",
"position": 0,
"product_id": "",
"product_variant_id": 0,
"store_id": "",
"type": "",
"url": "",
"variant_ids": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/product.image.add.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"content\": \"\",\n \"image_name\": \"\",\n \"label\": \"\",\n \"lang_id\": \"\",\n \"mime\": \"\",\n \"position\": 0,\n \"product_id\": \"\",\n \"product_variant_id\": 0,\n \"store_id\": \"\",\n \"type\": \"\",\n \"url\": \"\",\n \"variant_ids\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/product.image.add.json" {:headers {:x-api-key "{{apiKey}}"}
:content-type :json
:form-params {:content ""
:image_name ""
:label ""
:lang_id ""
:mime ""
:position 0
:product_id ""
:product_variant_id 0
:store_id ""
:type ""
:url ""
:variant_ids ""}})
require "http/client"
url = "{{baseUrl}}/product.image.add.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"content\": \"\",\n \"image_name\": \"\",\n \"label\": \"\",\n \"lang_id\": \"\",\n \"mime\": \"\",\n \"position\": 0,\n \"product_id\": \"\",\n \"product_variant_id\": 0,\n \"store_id\": \"\",\n \"type\": \"\",\n \"url\": \"\",\n \"variant_ids\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/product.image.add.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
Content = new StringContent("{\n \"content\": \"\",\n \"image_name\": \"\",\n \"label\": \"\",\n \"lang_id\": \"\",\n \"mime\": \"\",\n \"position\": 0,\n \"product_id\": \"\",\n \"product_variant_id\": 0,\n \"store_id\": \"\",\n \"type\": \"\",\n \"url\": \"\",\n \"variant_ids\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/product.image.add.json");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"content\": \"\",\n \"image_name\": \"\",\n \"label\": \"\",\n \"lang_id\": \"\",\n \"mime\": \"\",\n \"position\": 0,\n \"product_id\": \"\",\n \"product_variant_id\": 0,\n \"store_id\": \"\",\n \"type\": \"\",\n \"url\": \"\",\n \"variant_ids\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/product.image.add.json"
payload := strings.NewReader("{\n \"content\": \"\",\n \"image_name\": \"\",\n \"label\": \"\",\n \"lang_id\": \"\",\n \"mime\": \"\",\n \"position\": 0,\n \"product_id\": \"\",\n \"product_variant_id\": 0,\n \"store_id\": \"\",\n \"type\": \"\",\n \"url\": \"\",\n \"variant_ids\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/product.image.add.json HTTP/1.1
X-Api-Key: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 215
{
"content": "",
"image_name": "",
"label": "",
"lang_id": "",
"mime": "",
"position": 0,
"product_id": "",
"product_variant_id": 0,
"store_id": "",
"type": "",
"url": "",
"variant_ids": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/product.image.add.json")
.setHeader("x-api-key", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"content\": \"\",\n \"image_name\": \"\",\n \"label\": \"\",\n \"lang_id\": \"\",\n \"mime\": \"\",\n \"position\": 0,\n \"product_id\": \"\",\n \"product_variant_id\": 0,\n \"store_id\": \"\",\n \"type\": \"\",\n \"url\": \"\",\n \"variant_ids\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/product.image.add.json"))
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"content\": \"\",\n \"image_name\": \"\",\n \"label\": \"\",\n \"lang_id\": \"\",\n \"mime\": \"\",\n \"position\": 0,\n \"product_id\": \"\",\n \"product_variant_id\": 0,\n \"store_id\": \"\",\n \"type\": \"\",\n \"url\": \"\",\n \"variant_ids\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"content\": \"\",\n \"image_name\": \"\",\n \"label\": \"\",\n \"lang_id\": \"\",\n \"mime\": \"\",\n \"position\": 0,\n \"product_id\": \"\",\n \"product_variant_id\": 0,\n \"store_id\": \"\",\n \"type\": \"\",\n \"url\": \"\",\n \"variant_ids\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/product.image.add.json")
.post(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/product.image.add.json")
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"content\": \"\",\n \"image_name\": \"\",\n \"label\": \"\",\n \"lang_id\": \"\",\n \"mime\": \"\",\n \"position\": 0,\n \"product_id\": \"\",\n \"product_variant_id\": 0,\n \"store_id\": \"\",\n \"type\": \"\",\n \"url\": \"\",\n \"variant_ids\": \"\"\n}")
.asString();
const data = JSON.stringify({
content: '',
image_name: '',
label: '',
lang_id: '',
mime: '',
position: 0,
product_id: '',
product_variant_id: 0,
store_id: '',
type: '',
url: '',
variant_ids: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/product.image.add.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/product.image.add.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {
content: '',
image_name: '',
label: '',
lang_id: '',
mime: '',
position: 0,
product_id: '',
product_variant_id: 0,
store_id: '',
type: '',
url: '',
variant_ids: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/product.image.add.json';
const options = {
method: 'POST',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"content":"","image_name":"","label":"","lang_id":"","mime":"","position":0,"product_id":"","product_variant_id":0,"store_id":"","type":"","url":"","variant_ids":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/product.image.add.json',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "content": "",\n "image_name": "",\n "label": "",\n "lang_id": "",\n "mime": "",\n "position": 0,\n "product_id": "",\n "product_variant_id": 0,\n "store_id": "",\n "type": "",\n "url": "",\n "variant_ids": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"content\": \"\",\n \"image_name\": \"\",\n \"label\": \"\",\n \"lang_id\": \"\",\n \"mime\": \"\",\n \"position\": 0,\n \"product_id\": \"\",\n \"product_variant_id\": 0,\n \"store_id\": \"\",\n \"type\": \"\",\n \"url\": \"\",\n \"variant_ids\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/product.image.add.json")
.post(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/product.image.add.json',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
content: '',
image_name: '',
label: '',
lang_id: '',
mime: '',
position: 0,
product_id: '',
product_variant_id: 0,
store_id: '',
type: '',
url: '',
variant_ids: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/product.image.add.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: {
content: '',
image_name: '',
label: '',
lang_id: '',
mime: '',
position: 0,
product_id: '',
product_variant_id: 0,
store_id: '',
type: '',
url: '',
variant_ids: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/product.image.add.json');
req.headers({
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
content: '',
image_name: '',
label: '',
lang_id: '',
mime: '',
position: 0,
product_id: '',
product_variant_id: 0,
store_id: '',
type: '',
url: '',
variant_ids: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/product.image.add.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {
content: '',
image_name: '',
label: '',
lang_id: '',
mime: '',
position: 0,
product_id: '',
product_variant_id: 0,
store_id: '',
type: '',
url: '',
variant_ids: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/product.image.add.json';
const options = {
method: 'POST',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"content":"","image_name":"","label":"","lang_id":"","mime":"","position":0,"product_id":"","product_variant_id":0,"store_id":"","type":"","url":"","variant_ids":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"content": @"",
@"image_name": @"",
@"label": @"",
@"lang_id": @"",
@"mime": @"",
@"position": @0,
@"product_id": @"",
@"product_variant_id": @0,
@"store_id": @"",
@"type": @"",
@"url": @"",
@"variant_ids": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/product.image.add.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/product.image.add.json" in
let headers = Header.add_list (Header.init ()) [
("x-api-key", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"content\": \"\",\n \"image_name\": \"\",\n \"label\": \"\",\n \"lang_id\": \"\",\n \"mime\": \"\",\n \"position\": 0,\n \"product_id\": \"\",\n \"product_variant_id\": 0,\n \"store_id\": \"\",\n \"type\": \"\",\n \"url\": \"\",\n \"variant_ids\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/product.image.add.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'content' => '',
'image_name' => '',
'label' => '',
'lang_id' => '',
'mime' => '',
'position' => 0,
'product_id' => '',
'product_variant_id' => 0,
'store_id' => '',
'type' => '',
'url' => '',
'variant_ids' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/product.image.add.json', [
'body' => '{
"content": "",
"image_name": "",
"label": "",
"lang_id": "",
"mime": "",
"position": 0,
"product_id": "",
"product_variant_id": 0,
"store_id": "",
"type": "",
"url": "",
"variant_ids": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/product.image.add.json');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'content' => '',
'image_name' => '',
'label' => '',
'lang_id' => '',
'mime' => '',
'position' => 0,
'product_id' => '',
'product_variant_id' => 0,
'store_id' => '',
'type' => '',
'url' => '',
'variant_ids' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'content' => '',
'image_name' => '',
'label' => '',
'lang_id' => '',
'mime' => '',
'position' => 0,
'product_id' => '',
'product_variant_id' => 0,
'store_id' => '',
'type' => '',
'url' => '',
'variant_ids' => ''
]));
$request->setRequestUrl('{{baseUrl}}/product.image.add.json');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/product.image.add.json' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"content": "",
"image_name": "",
"label": "",
"lang_id": "",
"mime": "",
"position": 0,
"product_id": "",
"product_variant_id": 0,
"store_id": "",
"type": "",
"url": "",
"variant_ids": ""
}'
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/product.image.add.json' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"content": "",
"image_name": "",
"label": "",
"lang_id": "",
"mime": "",
"position": 0,
"product_id": "",
"product_variant_id": 0,
"store_id": "",
"type": "",
"url": "",
"variant_ids": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"content\": \"\",\n \"image_name\": \"\",\n \"label\": \"\",\n \"lang_id\": \"\",\n \"mime\": \"\",\n \"position\": 0,\n \"product_id\": \"\",\n \"product_variant_id\": 0,\n \"store_id\": \"\",\n \"type\": \"\",\n \"url\": \"\",\n \"variant_ids\": \"\"\n}"
headers = {
'x-api-key': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/product.image.add.json", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/product.image.add.json"
payload = {
"content": "",
"image_name": "",
"label": "",
"lang_id": "",
"mime": "",
"position": 0,
"product_id": "",
"product_variant_id": 0,
"store_id": "",
"type": "",
"url": "",
"variant_ids": ""
}
headers = {
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/product.image.add.json"
payload <- "{\n \"content\": \"\",\n \"image_name\": \"\",\n \"label\": \"\",\n \"lang_id\": \"\",\n \"mime\": \"\",\n \"position\": 0,\n \"product_id\": \"\",\n \"product_variant_id\": 0,\n \"store_id\": \"\",\n \"type\": \"\",\n \"url\": \"\",\n \"variant_ids\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/product.image.add.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"content\": \"\",\n \"image_name\": \"\",\n \"label\": \"\",\n \"lang_id\": \"\",\n \"mime\": \"\",\n \"position\": 0,\n \"product_id\": \"\",\n \"product_variant_id\": 0,\n \"store_id\": \"\",\n \"type\": \"\",\n \"url\": \"\",\n \"variant_ids\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/product.image.add.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.body = "{\n \"content\": \"\",\n \"image_name\": \"\",\n \"label\": \"\",\n \"lang_id\": \"\",\n \"mime\": \"\",\n \"position\": 0,\n \"product_id\": \"\",\n \"product_variant_id\": 0,\n \"store_id\": \"\",\n \"type\": \"\",\n \"url\": \"\",\n \"variant_ids\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/product.image.add.json";
let payload = json!({
"content": "",
"image_name": "",
"label": "",
"lang_id": "",
"mime": "",
"position": 0,
"product_id": "",
"product_variant_id": 0,
"store_id": "",
"type": "",
"url": "",
"variant_ids": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/product.image.add.json \
--header 'content-type: application/json' \
--header 'x-api-key: {{apiKey}}' \
--data '{
"content": "",
"image_name": "",
"label": "",
"lang_id": "",
"mime": "",
"position": 0,
"product_id": "",
"product_variant_id": 0,
"store_id": "",
"type": "",
"url": "",
"variant_ids": ""
}'
echo '{
"content": "",
"image_name": "",
"label": "",
"lang_id": "",
"mime": "",
"position": 0,
"product_id": "",
"product_variant_id": 0,
"store_id": "",
"type": "",
"url": "",
"variant_ids": ""
}' | \
http POST {{baseUrl}}/product.image.add.json \
content-type:application/json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "content": "",\n "image_name": "",\n "label": "",\n "lang_id": "",\n "mime": "",\n "position": 0,\n "product_id": "",\n "product_variant_id": 0,\n "store_id": "",\n "type": "",\n "url": "",\n "variant_ids": ""\n}' \
--output-document \
- {{baseUrl}}/product.image.add.json
import Foundation
let headers = [
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"content": "",
"image_name": "",
"label": "",
"lang_id": "",
"mime": "",
"position": 0,
"product_id": "",
"product_variant_id": 0,
"store_id": "",
"type": "",
"url": "",
"variant_ids": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/product.image.add.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
DELETE
ProductImageDelete
{{baseUrl}}/product.image.delete.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
product_id
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/product.image.delete.json?product_id=&id=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/product.image.delete.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:product_id ""
:id ""}})
require "http/client"
url = "{{baseUrl}}/product.image.delete.json?product_id=&id="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.delete url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/product.image.delete.json?product_id=&id="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/product.image.delete.json?product_id=&id=");
var request = new RestRequest("", Method.Delete);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/product.image.delete.json?product_id=&id="
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/product.image.delete.json?product_id=&id= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/product.image.delete.json?product_id=&id=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/product.image.delete.json?product_id=&id="))
.header("x-api-key", "{{apiKey}}")
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/product.image.delete.json?product_id=&id=")
.delete(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/product.image.delete.json?product_id=&id=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/product.image.delete.json?product_id=&id=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/product.image.delete.json',
params: {product_id: '', id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/product.image.delete.json?product_id=&id=';
const options = {method: 'DELETE', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/product.image.delete.json?product_id=&id=',
method: 'DELETE',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/product.image.delete.json?product_id=&id=")
.delete(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/product.image.delete.json?product_id=&id=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/product.image.delete.json',
qs: {product_id: '', id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/product.image.delete.json');
req.query({
product_id: '',
id: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/product.image.delete.json',
params: {product_id: '', id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/product.image.delete.json?product_id=&id=';
const options = {method: 'DELETE', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/product.image.delete.json?product_id=&id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/product.image.delete.json?product_id=&id=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/product.image.delete.json?product_id=&id=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/product.image.delete.json?product_id=&id=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/product.image.delete.json');
$request->setMethod(HTTP_METH_DELETE);
$request->setQueryData([
'product_id' => '',
'id' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/product.image.delete.json');
$request->setRequestMethod('DELETE');
$request->setQuery(new http\QueryString([
'product_id' => '',
'id' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/product.image.delete.json?product_id=&id=' -Method DELETE -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/product.image.delete.json?product_id=&id=' -Method DELETE -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("DELETE", "/baseUrl/product.image.delete.json?product_id=&id=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/product.image.delete.json"
querystring = {"product_id":"","id":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.delete(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/product.image.delete.json"
queryString <- list(
product_id = "",
id = ""
)
response <- VERB("DELETE", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/product.image.delete.json?product_id=&id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/product.image.delete.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['product_id'] = ''
req.params['id'] = ''
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/product.image.delete.json";
let querystring = [
("product_id", ""),
("id", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url '{{baseUrl}}/product.image.delete.json?product_id=&id=' \
--header 'x-api-key: {{apiKey}}'
http DELETE '{{baseUrl}}/product.image.delete.json?product_id=&id=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method DELETE \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/product.image.delete.json?product_id=&id='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/product.image.delete.json?product_id=&id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PUT
ProductImageUpdate
{{baseUrl}}/product.image.update.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
product_id
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/product.image.update.json?product_id=&id=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/product.image.update.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:product_id ""
:id ""}})
require "http/client"
url = "{{baseUrl}}/product.image.update.json?product_id=&id="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.put url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/product.image.update.json?product_id=&id="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/product.image.update.json?product_id=&id=");
var request = new RestRequest("", Method.Put);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/product.image.update.json?product_id=&id="
req, _ := http.NewRequest("PUT", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/product.image.update.json?product_id=&id= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/product.image.update.json?product_id=&id=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/product.image.update.json?product_id=&id="))
.header("x-api-key", "{{apiKey}}")
.method("PUT", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/product.image.update.json?product_id=&id=")
.put(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/product.image.update.json?product_id=&id=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/product.image.update.json?product_id=&id=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/product.image.update.json',
params: {product_id: '', id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/product.image.update.json?product_id=&id=';
const options = {method: 'PUT', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/product.image.update.json?product_id=&id=',
method: 'PUT',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/product.image.update.json?product_id=&id=")
.put(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/product.image.update.json?product_id=&id=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/product.image.update.json',
qs: {product_id: '', id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/product.image.update.json');
req.query({
product_id: '',
id: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/product.image.update.json',
params: {product_id: '', id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/product.image.update.json?product_id=&id=';
const options = {method: 'PUT', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/product.image.update.json?product_id=&id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/product.image.update.json?product_id=&id=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/product.image.update.json?product_id=&id=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/product.image.update.json?product_id=&id=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/product.image.update.json');
$request->setMethod(HTTP_METH_PUT);
$request->setQueryData([
'product_id' => '',
'id' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/product.image.update.json');
$request->setRequestMethod('PUT');
$request->setQuery(new http\QueryString([
'product_id' => '',
'id' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/product.image.update.json?product_id=&id=' -Method PUT -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/product.image.update.json?product_id=&id=' -Method PUT -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("PUT", "/baseUrl/product.image.update.json?product_id=&id=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/product.image.update.json"
querystring = {"product_id":"","id":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.put(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/product.image.update.json"
queryString <- list(
product_id = "",
id = ""
)
response <- VERB("PUT", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/product.image.update.json?product_id=&id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.put('/baseUrl/product.image.update.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['product_id'] = ''
req.params['id'] = ''
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/product.image.update.json";
let querystring = [
("product_id", ""),
("id", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url '{{baseUrl}}/product.image.update.json?product_id=&id=' \
--header 'x-api-key: {{apiKey}}'
http PUT '{{baseUrl}}/product.image.update.json?product_id=&id=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method PUT \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/product.image.update.json?product_id=&id='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/product.image.update.json?product_id=&id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
ProductInfo
{{baseUrl}}/product.info.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/product.info.json?id=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/product.info.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:id ""}})
require "http/client"
url = "{{baseUrl}}/product.info.json?id="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/product.info.json?id="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/product.info.json?id=");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/product.info.json?id="
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/product.info.json?id= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/product.info.json?id=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/product.info.json?id="))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/product.info.json?id=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/product.info.json?id=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/product.info.json?id=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/product.info.json',
params: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/product.info.json?id=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/product.info.json?id=',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/product.info.json?id=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/product.info.json?id=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/product.info.json',
qs: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/product.info.json');
req.query({
id: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/product.info.json',
params: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/product.info.json?id=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/product.info.json?id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/product.info.json?id=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/product.info.json?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 => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/product.info.json?id=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/product.info.json');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'id' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/product.info.json');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'id' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/product.info.json?id=' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/product.info.json?id=' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/product.info.json?id=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/product.info.json"
querystring = {"id":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/product.info.json"
queryString <- list(id = "")
response <- VERB("GET", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/product.info.json?id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/product.info.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['id'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/product.info.json";
let querystring = [
("id", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/product.info.json?id=' \
--header 'x-api-key: {{apiKey}}'
http GET '{{baseUrl}}/product.info.json?id=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/product.info.json?id='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/product.info.json?id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
ProductList
{{baseUrl}}/product.list.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/product.list.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/product.list.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/product.list.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/product.list.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/product.list.json");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/product.list.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/product.list.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/product.list.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/product.list.json"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/product.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/product.list.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/product.list.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/product.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/product.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/product.list.json',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/product.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/product.list.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/product.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/product.list.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/product.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/product.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/product.list.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/product.list.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/product.list.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/product.list.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/product.list.json');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/product.list.json');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/product.list.json' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/product.list.json' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/product.list.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/product.list.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/product.list.json"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/product.list.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/product.list.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/product.list.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/product.list.json \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/product.list.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/product.list.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/product.list.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
ProductManufacturerAdd
{{baseUrl}}/product.manufacturer.add.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
product_id
manufacturer
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/product.manufacturer.add.json?product_id=&manufacturer=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/product.manufacturer.add.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:product_id ""
:manufacturer ""}})
require "http/client"
url = "{{baseUrl}}/product.manufacturer.add.json?product_id=&manufacturer="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.post url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/product.manufacturer.add.json?product_id=&manufacturer="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/product.manufacturer.add.json?product_id=&manufacturer=");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/product.manufacturer.add.json?product_id=&manufacturer="
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/product.manufacturer.add.json?product_id=&manufacturer= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/product.manufacturer.add.json?product_id=&manufacturer=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/product.manufacturer.add.json?product_id=&manufacturer="))
.header("x-api-key", "{{apiKey}}")
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/product.manufacturer.add.json?product_id=&manufacturer=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/product.manufacturer.add.json?product_id=&manufacturer=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/product.manufacturer.add.json?product_id=&manufacturer=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/product.manufacturer.add.json',
params: {product_id: '', manufacturer: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/product.manufacturer.add.json?product_id=&manufacturer=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/product.manufacturer.add.json?product_id=&manufacturer=',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/product.manufacturer.add.json?product_id=&manufacturer=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/product.manufacturer.add.json?product_id=&manufacturer=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/product.manufacturer.add.json',
qs: {product_id: '', manufacturer: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/product.manufacturer.add.json');
req.query({
product_id: '',
manufacturer: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/product.manufacturer.add.json',
params: {product_id: '', manufacturer: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/product.manufacturer.add.json?product_id=&manufacturer=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/product.manufacturer.add.json?product_id=&manufacturer="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/product.manufacturer.add.json?product_id=&manufacturer=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/product.manufacturer.add.json?product_id=&manufacturer=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/product.manufacturer.add.json?product_id=&manufacturer=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/product.manufacturer.add.json');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'product_id' => '',
'manufacturer' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/product.manufacturer.add.json');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'product_id' => '',
'manufacturer' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/product.manufacturer.add.json?product_id=&manufacturer=' -Method POST -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/product.manufacturer.add.json?product_id=&manufacturer=' -Method POST -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("POST", "/baseUrl/product.manufacturer.add.json?product_id=&manufacturer=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/product.manufacturer.add.json"
querystring = {"product_id":"","manufacturer":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.post(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/product.manufacturer.add.json"
queryString <- list(
product_id = "",
manufacturer = ""
)
response <- VERB("POST", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/product.manufacturer.add.json?product_id=&manufacturer=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/product.manufacturer.add.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['product_id'] = ''
req.params['manufacturer'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/product.manufacturer.add.json";
let querystring = [
("product_id", ""),
("manufacturer", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/product.manufacturer.add.json?product_id=&manufacturer=' \
--header 'x-api-key: {{apiKey}}'
http POST '{{baseUrl}}/product.manufacturer.add.json?product_id=&manufacturer=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/product.manufacturer.add.json?product_id=&manufacturer='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/product.manufacturer.add.json?product_id=&manufacturer=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
ProductOptionAdd
{{baseUrl}}/product.option.add.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
name
type
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/product.option.add.json?name=&type=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/product.option.add.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:name ""
:type ""}})
require "http/client"
url = "{{baseUrl}}/product.option.add.json?name=&type="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.post url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/product.option.add.json?name=&type="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/product.option.add.json?name=&type=");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/product.option.add.json?name=&type="
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/product.option.add.json?name=&type= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/product.option.add.json?name=&type=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/product.option.add.json?name=&type="))
.header("x-api-key", "{{apiKey}}")
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/product.option.add.json?name=&type=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/product.option.add.json?name=&type=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/product.option.add.json?name=&type=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/product.option.add.json',
params: {name: '', type: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/product.option.add.json?name=&type=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/product.option.add.json?name=&type=',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/product.option.add.json?name=&type=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/product.option.add.json?name=&type=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/product.option.add.json',
qs: {name: '', type: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/product.option.add.json');
req.query({
name: '',
type: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/product.option.add.json',
params: {name: '', type: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/product.option.add.json?name=&type=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/product.option.add.json?name=&type="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/product.option.add.json?name=&type=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/product.option.add.json?name=&type=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/product.option.add.json?name=&type=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/product.option.add.json');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'name' => '',
'type' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/product.option.add.json');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'name' => '',
'type' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/product.option.add.json?name=&type=' -Method POST -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/product.option.add.json?name=&type=' -Method POST -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("POST", "/baseUrl/product.option.add.json?name=&type=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/product.option.add.json"
querystring = {"name":"","type":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.post(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/product.option.add.json"
queryString <- list(
name = "",
type = ""
)
response <- VERB("POST", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/product.option.add.json?name=&type=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/product.option.add.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['name'] = ''
req.params['type'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/product.option.add.json";
let querystring = [
("name", ""),
("type", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/product.option.add.json?name=&type=' \
--header 'x-api-key: {{apiKey}}'
http POST '{{baseUrl}}/product.option.add.json?name=&type=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/product.option.add.json?name=&type='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/product.option.add.json?name=&type=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
ProductOptionAssign
{{baseUrl}}/product.option.assign.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
product_id
option_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/product.option.assign.json?product_id=&option_id=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/product.option.assign.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:product_id ""
:option_id ""}})
require "http/client"
url = "{{baseUrl}}/product.option.assign.json?product_id=&option_id="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.post url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/product.option.assign.json?product_id=&option_id="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/product.option.assign.json?product_id=&option_id=");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/product.option.assign.json?product_id=&option_id="
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/product.option.assign.json?product_id=&option_id= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/product.option.assign.json?product_id=&option_id=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/product.option.assign.json?product_id=&option_id="))
.header("x-api-key", "{{apiKey}}")
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/product.option.assign.json?product_id=&option_id=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/product.option.assign.json?product_id=&option_id=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/product.option.assign.json?product_id=&option_id=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/product.option.assign.json',
params: {product_id: '', option_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/product.option.assign.json?product_id=&option_id=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/product.option.assign.json?product_id=&option_id=',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/product.option.assign.json?product_id=&option_id=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/product.option.assign.json?product_id=&option_id=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/product.option.assign.json',
qs: {product_id: '', option_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/product.option.assign.json');
req.query({
product_id: '',
option_id: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/product.option.assign.json',
params: {product_id: '', option_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/product.option.assign.json?product_id=&option_id=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/product.option.assign.json?product_id=&option_id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/product.option.assign.json?product_id=&option_id=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/product.option.assign.json?product_id=&option_id=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/product.option.assign.json?product_id=&option_id=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/product.option.assign.json');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'product_id' => '',
'option_id' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/product.option.assign.json');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'product_id' => '',
'option_id' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/product.option.assign.json?product_id=&option_id=' -Method POST -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/product.option.assign.json?product_id=&option_id=' -Method POST -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("POST", "/baseUrl/product.option.assign.json?product_id=&option_id=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/product.option.assign.json"
querystring = {"product_id":"","option_id":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.post(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/product.option.assign.json"
queryString <- list(
product_id = "",
option_id = ""
)
response <- VERB("POST", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/product.option.assign.json?product_id=&option_id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/product.option.assign.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['product_id'] = ''
req.params['option_id'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/product.option.assign.json";
let querystring = [
("product_id", ""),
("option_id", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/product.option.assign.json?product_id=&option_id=' \
--header 'x-api-key: {{apiKey}}'
http POST '{{baseUrl}}/product.option.assign.json?product_id=&option_id=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/product.option.assign.json?product_id=&option_id='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/product.option.assign.json?product_id=&option_id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
ProductOptionList
{{baseUrl}}/product.option.list.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/product.option.list.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/product.option.list.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/product.option.list.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/product.option.list.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/product.option.list.json");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/product.option.list.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/product.option.list.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/product.option.list.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/product.option.list.json"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/product.option.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/product.option.list.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/product.option.list.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/product.option.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/product.option.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/product.option.list.json',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/product.option.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/product.option.list.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/product.option.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/product.option.list.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/product.option.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/product.option.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/product.option.list.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/product.option.list.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/product.option.list.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/product.option.list.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/product.option.list.json');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/product.option.list.json');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/product.option.list.json' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/product.option.list.json' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/product.option.list.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/product.option.list.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/product.option.list.json"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/product.option.list.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/product.option.list.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/product.option.list.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/product.option.list.json \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/product.option.list.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/product.option.list.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/product.option.list.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
ProductOptionValueAdd
{{baseUrl}}/product.option.value.add.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
product_id
option_id
option_value
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/product.option.value.add.json?product_id=&option_id=&option_value=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/product.option.value.add.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:product_id ""
:option_id ""
:option_value ""}})
require "http/client"
url = "{{baseUrl}}/product.option.value.add.json?product_id=&option_id=&option_value="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.post url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/product.option.value.add.json?product_id=&option_id=&option_value="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/product.option.value.add.json?product_id=&option_id=&option_value=");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/product.option.value.add.json?product_id=&option_id=&option_value="
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/product.option.value.add.json?product_id=&option_id=&option_value= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/product.option.value.add.json?product_id=&option_id=&option_value=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/product.option.value.add.json?product_id=&option_id=&option_value="))
.header("x-api-key", "{{apiKey}}")
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/product.option.value.add.json?product_id=&option_id=&option_value=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/product.option.value.add.json?product_id=&option_id=&option_value=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/product.option.value.add.json?product_id=&option_id=&option_value=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/product.option.value.add.json',
params: {product_id: '', option_id: '', option_value: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/product.option.value.add.json?product_id=&option_id=&option_value=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/product.option.value.add.json?product_id=&option_id=&option_value=',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/product.option.value.add.json?product_id=&option_id=&option_value=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/product.option.value.add.json?product_id=&option_id=&option_value=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/product.option.value.add.json',
qs: {product_id: '', option_id: '', option_value: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/product.option.value.add.json');
req.query({
product_id: '',
option_id: '',
option_value: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/product.option.value.add.json',
params: {product_id: '', option_id: '', option_value: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/product.option.value.add.json?product_id=&option_id=&option_value=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/product.option.value.add.json?product_id=&option_id=&option_value="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/product.option.value.add.json?product_id=&option_id=&option_value=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/product.option.value.add.json?product_id=&option_id=&option_value=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/product.option.value.add.json?product_id=&option_id=&option_value=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/product.option.value.add.json');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'product_id' => '',
'option_id' => '',
'option_value' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/product.option.value.add.json');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'product_id' => '',
'option_id' => '',
'option_value' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/product.option.value.add.json?product_id=&option_id=&option_value=' -Method POST -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/product.option.value.add.json?product_id=&option_id=&option_value=' -Method POST -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("POST", "/baseUrl/product.option.value.add.json?product_id=&option_id=&option_value=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/product.option.value.add.json"
querystring = {"product_id":"","option_id":"","option_value":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.post(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/product.option.value.add.json"
queryString <- list(
product_id = "",
option_id = "",
option_value = ""
)
response <- VERB("POST", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/product.option.value.add.json?product_id=&option_id=&option_value=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/product.option.value.add.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['product_id'] = ''
req.params['option_id'] = ''
req.params['option_value'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/product.option.value.add.json";
let querystring = [
("product_id", ""),
("option_id", ""),
("option_value", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/product.option.value.add.json?product_id=&option_id=&option_value=' \
--header 'x-api-key: {{apiKey}}'
http POST '{{baseUrl}}/product.option.value.add.json?product_id=&option_id=&option_value=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/product.option.value.add.json?product_id=&option_id=&option_value='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/product.option.value.add.json?product_id=&option_id=&option_value=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
ProductOptionValueAssign
{{baseUrl}}/product.option.value.assign.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
product_option_id
option_value_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/product.option.value.assign.json?product_option_id=&option_value_id=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/product.option.value.assign.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:product_option_id ""
:option_value_id ""}})
require "http/client"
url = "{{baseUrl}}/product.option.value.assign.json?product_option_id=&option_value_id="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.post url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/product.option.value.assign.json?product_option_id=&option_value_id="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/product.option.value.assign.json?product_option_id=&option_value_id=");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/product.option.value.assign.json?product_option_id=&option_value_id="
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/product.option.value.assign.json?product_option_id=&option_value_id= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/product.option.value.assign.json?product_option_id=&option_value_id=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/product.option.value.assign.json?product_option_id=&option_value_id="))
.header("x-api-key", "{{apiKey}}")
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/product.option.value.assign.json?product_option_id=&option_value_id=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/product.option.value.assign.json?product_option_id=&option_value_id=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/product.option.value.assign.json?product_option_id=&option_value_id=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/product.option.value.assign.json',
params: {product_option_id: '', option_value_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/product.option.value.assign.json?product_option_id=&option_value_id=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/product.option.value.assign.json?product_option_id=&option_value_id=',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/product.option.value.assign.json?product_option_id=&option_value_id=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/product.option.value.assign.json?product_option_id=&option_value_id=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/product.option.value.assign.json',
qs: {product_option_id: '', option_value_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/product.option.value.assign.json');
req.query({
product_option_id: '',
option_value_id: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/product.option.value.assign.json',
params: {product_option_id: '', option_value_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/product.option.value.assign.json?product_option_id=&option_value_id=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/product.option.value.assign.json?product_option_id=&option_value_id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/product.option.value.assign.json?product_option_id=&option_value_id=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/product.option.value.assign.json?product_option_id=&option_value_id=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/product.option.value.assign.json?product_option_id=&option_value_id=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/product.option.value.assign.json');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'product_option_id' => '',
'option_value_id' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/product.option.value.assign.json');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'product_option_id' => '',
'option_value_id' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/product.option.value.assign.json?product_option_id=&option_value_id=' -Method POST -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/product.option.value.assign.json?product_option_id=&option_value_id=' -Method POST -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("POST", "/baseUrl/product.option.value.assign.json?product_option_id=&option_value_id=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/product.option.value.assign.json"
querystring = {"product_option_id":"","option_value_id":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.post(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/product.option.value.assign.json"
queryString <- list(
product_option_id = "",
option_value_id = ""
)
response <- VERB("POST", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/product.option.value.assign.json?product_option_id=&option_value_id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/product.option.value.assign.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['product_option_id'] = ''
req.params['option_value_id'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/product.option.value.assign.json";
let querystring = [
("product_option_id", ""),
("option_value_id", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/product.option.value.assign.json?product_option_id=&option_value_id=' \
--header 'x-api-key: {{apiKey}}'
http POST '{{baseUrl}}/product.option.value.assign.json?product_option_id=&option_value_id=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/product.option.value.assign.json?product_option_id=&option_value_id='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/product.option.value.assign.json?product_option_id=&option_value_id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PUT
ProductOptionValueUpdate
{{baseUrl}}/product.option.value.update.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
product_id
option_id
option_value_id
option_value
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/product.option.value.update.json?product_id=&option_id=&option_value_id=&option_value=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/product.option.value.update.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:product_id ""
:option_id ""
:option_value_id ""
:option_value ""}})
require "http/client"
url = "{{baseUrl}}/product.option.value.update.json?product_id=&option_id=&option_value_id=&option_value="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.put url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/product.option.value.update.json?product_id=&option_id=&option_value_id=&option_value="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/product.option.value.update.json?product_id=&option_id=&option_value_id=&option_value=");
var request = new RestRequest("", Method.Put);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/product.option.value.update.json?product_id=&option_id=&option_value_id=&option_value="
req, _ := http.NewRequest("PUT", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/product.option.value.update.json?product_id=&option_id=&option_value_id=&option_value= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/product.option.value.update.json?product_id=&option_id=&option_value_id=&option_value=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/product.option.value.update.json?product_id=&option_id=&option_value_id=&option_value="))
.header("x-api-key", "{{apiKey}}")
.method("PUT", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/product.option.value.update.json?product_id=&option_id=&option_value_id=&option_value=")
.put(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/product.option.value.update.json?product_id=&option_id=&option_value_id=&option_value=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/product.option.value.update.json?product_id=&option_id=&option_value_id=&option_value=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/product.option.value.update.json',
params: {product_id: '', option_id: '', option_value_id: '', option_value: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/product.option.value.update.json?product_id=&option_id=&option_value_id=&option_value=';
const options = {method: 'PUT', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/product.option.value.update.json?product_id=&option_id=&option_value_id=&option_value=',
method: 'PUT',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/product.option.value.update.json?product_id=&option_id=&option_value_id=&option_value=")
.put(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/product.option.value.update.json?product_id=&option_id=&option_value_id=&option_value=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/product.option.value.update.json',
qs: {product_id: '', option_id: '', option_value_id: '', option_value: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/product.option.value.update.json');
req.query({
product_id: '',
option_id: '',
option_value_id: '',
option_value: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/product.option.value.update.json',
params: {product_id: '', option_id: '', option_value_id: '', option_value: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/product.option.value.update.json?product_id=&option_id=&option_value_id=&option_value=';
const options = {method: 'PUT', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/product.option.value.update.json?product_id=&option_id=&option_value_id=&option_value="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/product.option.value.update.json?product_id=&option_id=&option_value_id=&option_value=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/product.option.value.update.json?product_id=&option_id=&option_value_id=&option_value=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/product.option.value.update.json?product_id=&option_id=&option_value_id=&option_value=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/product.option.value.update.json');
$request->setMethod(HTTP_METH_PUT);
$request->setQueryData([
'product_id' => '',
'option_id' => '',
'option_value_id' => '',
'option_value' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/product.option.value.update.json');
$request->setRequestMethod('PUT');
$request->setQuery(new http\QueryString([
'product_id' => '',
'option_id' => '',
'option_value_id' => '',
'option_value' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/product.option.value.update.json?product_id=&option_id=&option_value_id=&option_value=' -Method PUT -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/product.option.value.update.json?product_id=&option_id=&option_value_id=&option_value=' -Method PUT -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("PUT", "/baseUrl/product.option.value.update.json?product_id=&option_id=&option_value_id=&option_value=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/product.option.value.update.json"
querystring = {"product_id":"","option_id":"","option_value_id":"","option_value":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.put(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/product.option.value.update.json"
queryString <- list(
product_id = "",
option_id = "",
option_value_id = "",
option_value = ""
)
response <- VERB("PUT", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/product.option.value.update.json?product_id=&option_id=&option_value_id=&option_value=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.put('/baseUrl/product.option.value.update.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['product_id'] = ''
req.params['option_id'] = ''
req.params['option_value_id'] = ''
req.params['option_value'] = ''
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/product.option.value.update.json";
let querystring = [
("product_id", ""),
("option_id", ""),
("option_value_id", ""),
("option_value", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url '{{baseUrl}}/product.option.value.update.json?product_id=&option_id=&option_value_id=&option_value=' \
--header 'x-api-key: {{apiKey}}'
http PUT '{{baseUrl}}/product.option.value.update.json?product_id=&option_id=&option_value_id=&option_value=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method PUT \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/product.option.value.update.json?product_id=&option_id=&option_value_id=&option_value='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/product.option.value.update.json?product_id=&option_id=&option_value_id=&option_value=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
ProductPriceAdd
{{baseUrl}}/product.price.add.json
HEADERS
x-api-key
{{apiKey}}
BODY json
{
"group_prices": [
{
"group_id": "",
"price": ""
}
],
"product_id": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/product.price.add.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"price\": \"\"\n }\n ],\n \"product_id\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/product.price.add.json" {:headers {:x-api-key "{{apiKey}}"}
:content-type :json
:form-params {:group_prices [{:group_id ""
:price ""}]
:product_id ""}})
require "http/client"
url = "{{baseUrl}}/product.price.add.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"price\": \"\"\n }\n ],\n \"product_id\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/product.price.add.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
Content = new StringContent("{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"price\": \"\"\n }\n ],\n \"product_id\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/product.price.add.json");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"price\": \"\"\n }\n ],\n \"product_id\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/product.price.add.json"
payload := strings.NewReader("{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"price\": \"\"\n }\n ],\n \"product_id\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/product.price.add.json HTTP/1.1
X-Api-Key: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 99
{
"group_prices": [
{
"group_id": "",
"price": ""
}
],
"product_id": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/product.price.add.json")
.setHeader("x-api-key", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"price\": \"\"\n }\n ],\n \"product_id\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/product.price.add.json"))
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"price\": \"\"\n }\n ],\n \"product_id\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"price\": \"\"\n }\n ],\n \"product_id\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/product.price.add.json")
.post(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/product.price.add.json")
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"price\": \"\"\n }\n ],\n \"product_id\": \"\"\n}")
.asString();
const data = JSON.stringify({
group_prices: [
{
group_id: '',
price: ''
}
],
product_id: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/product.price.add.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/product.price.add.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {group_prices: [{group_id: '', price: ''}], product_id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/product.price.add.json';
const options = {
method: 'POST',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"group_prices":[{"group_id":"","price":""}],"product_id":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/product.price.add.json',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "group_prices": [\n {\n "group_id": "",\n "price": ""\n }\n ],\n "product_id": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"price\": \"\"\n }\n ],\n \"product_id\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/product.price.add.json")
.post(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/product.price.add.json',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({group_prices: [{group_id: '', price: ''}], product_id: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/product.price.add.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: {group_prices: [{group_id: '', price: ''}], product_id: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/product.price.add.json');
req.headers({
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
group_prices: [
{
group_id: '',
price: ''
}
],
product_id: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/product.price.add.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {group_prices: [{group_id: '', price: ''}], product_id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/product.price.add.json';
const options = {
method: 'POST',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"group_prices":[{"group_id":"","price":""}],"product_id":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"group_prices": @[ @{ @"group_id": @"", @"price": @"" } ],
@"product_id": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/product.price.add.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/product.price.add.json" in
let headers = Header.add_list (Header.init ()) [
("x-api-key", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"price\": \"\"\n }\n ],\n \"product_id\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/product.price.add.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'group_prices' => [
[
'group_id' => '',
'price' => ''
]
],
'product_id' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/product.price.add.json', [
'body' => '{
"group_prices": [
{
"group_id": "",
"price": ""
}
],
"product_id": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/product.price.add.json');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'group_prices' => [
[
'group_id' => '',
'price' => ''
]
],
'product_id' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'group_prices' => [
[
'group_id' => '',
'price' => ''
]
],
'product_id' => ''
]));
$request->setRequestUrl('{{baseUrl}}/product.price.add.json');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/product.price.add.json' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"group_prices": [
{
"group_id": "",
"price": ""
}
],
"product_id": ""
}'
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/product.price.add.json' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"group_prices": [
{
"group_id": "",
"price": ""
}
],
"product_id": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"price\": \"\"\n }\n ],\n \"product_id\": \"\"\n}"
headers = {
'x-api-key': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/product.price.add.json", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/product.price.add.json"
payload = {
"group_prices": [
{
"group_id": "",
"price": ""
}
],
"product_id": ""
}
headers = {
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/product.price.add.json"
payload <- "{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"price\": \"\"\n }\n ],\n \"product_id\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/product.price.add.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"price\": \"\"\n }\n ],\n \"product_id\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/product.price.add.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.body = "{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"price\": \"\"\n }\n ],\n \"product_id\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/product.price.add.json";
let payload = json!({
"group_prices": (
json!({
"group_id": "",
"price": ""
})
),
"product_id": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/product.price.add.json \
--header 'content-type: application/json' \
--header 'x-api-key: {{apiKey}}' \
--data '{
"group_prices": [
{
"group_id": "",
"price": ""
}
],
"product_id": ""
}'
echo '{
"group_prices": [
{
"group_id": "",
"price": ""
}
],
"product_id": ""
}' | \
http POST {{baseUrl}}/product.price.add.json \
content-type:application/json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "group_prices": [\n {\n "group_id": "",\n "price": ""\n }\n ],\n "product_id": ""\n}' \
--output-document \
- {{baseUrl}}/product.price.add.json
import Foundation
let headers = [
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"group_prices": [
[
"group_id": "",
"price": ""
]
],
"product_id": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/product.price.add.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
DELETE
ProductPriceDelete
{{baseUrl}}/product.price.delete.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
product_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/product.price.delete.json?product_id=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/product.price.delete.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:product_id ""}})
require "http/client"
url = "{{baseUrl}}/product.price.delete.json?product_id="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.delete url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/product.price.delete.json?product_id="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/product.price.delete.json?product_id=");
var request = new RestRequest("", Method.Delete);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/product.price.delete.json?product_id="
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/product.price.delete.json?product_id= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/product.price.delete.json?product_id=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/product.price.delete.json?product_id="))
.header("x-api-key", "{{apiKey}}")
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/product.price.delete.json?product_id=")
.delete(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/product.price.delete.json?product_id=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/product.price.delete.json?product_id=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/product.price.delete.json',
params: {product_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/product.price.delete.json?product_id=';
const options = {method: 'DELETE', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/product.price.delete.json?product_id=',
method: 'DELETE',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/product.price.delete.json?product_id=")
.delete(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/product.price.delete.json?product_id=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/product.price.delete.json',
qs: {product_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/product.price.delete.json');
req.query({
product_id: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/product.price.delete.json',
params: {product_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/product.price.delete.json?product_id=';
const options = {method: 'DELETE', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/product.price.delete.json?product_id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/product.price.delete.json?product_id=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/product.price.delete.json?product_id=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/product.price.delete.json?product_id=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/product.price.delete.json');
$request->setMethod(HTTP_METH_DELETE);
$request->setQueryData([
'product_id' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/product.price.delete.json');
$request->setRequestMethod('DELETE');
$request->setQuery(new http\QueryString([
'product_id' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/product.price.delete.json?product_id=' -Method DELETE -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/product.price.delete.json?product_id=' -Method DELETE -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("DELETE", "/baseUrl/product.price.delete.json?product_id=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/product.price.delete.json"
querystring = {"product_id":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.delete(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/product.price.delete.json"
queryString <- list(product_id = "")
response <- VERB("DELETE", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/product.price.delete.json?product_id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/product.price.delete.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['product_id'] = ''
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/product.price.delete.json";
let querystring = [
("product_id", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url '{{baseUrl}}/product.price.delete.json?product_id=' \
--header 'x-api-key: {{apiKey}}'
http DELETE '{{baseUrl}}/product.price.delete.json?product_id=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method DELETE \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/product.price.delete.json?product_id='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/product.price.delete.json?product_id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PUT
ProductPriceUpdate
{{baseUrl}}/product.price.update.json
HEADERS
x-api-key
{{apiKey}}
BODY json
{
"group_prices": [
{
"group_id": "",
"id": 0,
"price": ""
}
],
"product_id": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/product.price.update.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"id\": 0,\n \"price\": \"\"\n }\n ],\n \"product_id\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/product.price.update.json" {:headers {:x-api-key "{{apiKey}}"}
:content-type :json
:form-params {:group_prices [{:group_id ""
:id 0
:price ""}]
:product_id ""}})
require "http/client"
url = "{{baseUrl}}/product.price.update.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"id\": 0,\n \"price\": \"\"\n }\n ],\n \"product_id\": \"\"\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/product.price.update.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
Content = new StringContent("{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"id\": 0,\n \"price\": \"\"\n }\n ],\n \"product_id\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/product.price.update.json");
var request = new RestRequest("", Method.Put);
request.AddHeader("x-api-key", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"id\": 0,\n \"price\": \"\"\n }\n ],\n \"product_id\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/product.price.update.json"
payload := strings.NewReader("{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"id\": 0,\n \"price\": \"\"\n }\n ],\n \"product_id\": \"\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/product.price.update.json HTTP/1.1
X-Api-Key: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 114
{
"group_prices": [
{
"group_id": "",
"id": 0,
"price": ""
}
],
"product_id": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/product.price.update.json")
.setHeader("x-api-key", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"id\": 0,\n \"price\": \"\"\n }\n ],\n \"product_id\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/product.price.update.json"))
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"id\": 0,\n \"price\": \"\"\n }\n ],\n \"product_id\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"id\": 0,\n \"price\": \"\"\n }\n ],\n \"product_id\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/product.price.update.json")
.put(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/product.price.update.json")
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"id\": 0,\n \"price\": \"\"\n }\n ],\n \"product_id\": \"\"\n}")
.asString();
const data = JSON.stringify({
group_prices: [
{
group_id: '',
id: 0,
price: ''
}
],
product_id: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/product.price.update.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/product.price.update.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {group_prices: [{group_id: '', id: 0, price: ''}], product_id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/product.price.update.json';
const options = {
method: 'PUT',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"group_prices":[{"group_id":"","id":0,"price":""}],"product_id":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/product.price.update.json',
method: 'PUT',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "group_prices": [\n {\n "group_id": "",\n "id": 0,\n "price": ""\n }\n ],\n "product_id": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"id\": 0,\n \"price\": \"\"\n }\n ],\n \"product_id\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/product.price.update.json")
.put(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/product.price.update.json',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({group_prices: [{group_id: '', id: 0, price: ''}], product_id: ''}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/product.price.update.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: {group_prices: [{group_id: '', id: 0, price: ''}], product_id: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/product.price.update.json');
req.headers({
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
group_prices: [
{
group_id: '',
id: 0,
price: ''
}
],
product_id: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/product.price.update.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {group_prices: [{group_id: '', id: 0, price: ''}], product_id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/product.price.update.json';
const options = {
method: 'PUT',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"group_prices":[{"group_id":"","id":0,"price":""}],"product_id":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"group_prices": @[ @{ @"group_id": @"", @"id": @0, @"price": @"" } ],
@"product_id": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/product.price.update.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/product.price.update.json" in
let headers = Header.add_list (Header.init ()) [
("x-api-key", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"id\": 0,\n \"price\": \"\"\n }\n ],\n \"product_id\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/product.price.update.json",
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([
'group_prices' => [
[
'group_id' => '',
'id' => 0,
'price' => ''
]
],
'product_id' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/product.price.update.json', [
'body' => '{
"group_prices": [
{
"group_id": "",
"id": 0,
"price": ""
}
],
"product_id": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/product.price.update.json');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'group_prices' => [
[
'group_id' => '',
'id' => 0,
'price' => ''
]
],
'product_id' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'group_prices' => [
[
'group_id' => '',
'id' => 0,
'price' => ''
]
],
'product_id' => ''
]));
$request->setRequestUrl('{{baseUrl}}/product.price.update.json');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/product.price.update.json' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"group_prices": [
{
"group_id": "",
"id": 0,
"price": ""
}
],
"product_id": ""
}'
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/product.price.update.json' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"group_prices": [
{
"group_id": "",
"id": 0,
"price": ""
}
],
"product_id": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"id\": 0,\n \"price\": \"\"\n }\n ],\n \"product_id\": \"\"\n}"
headers = {
'x-api-key': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("PUT", "/baseUrl/product.price.update.json", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/product.price.update.json"
payload = {
"group_prices": [
{
"group_id": "",
"id": 0,
"price": ""
}
],
"product_id": ""
}
headers = {
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/product.price.update.json"
payload <- "{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"id\": 0,\n \"price\": \"\"\n }\n ],\n \"product_id\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/product.price.update.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"id\": 0,\n \"price\": \"\"\n }\n ],\n \"product_id\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/product.price.update.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.body = "{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"id\": 0,\n \"price\": \"\"\n }\n ],\n \"product_id\": \"\"\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/product.price.update.json";
let payload = json!({
"group_prices": (
json!({
"group_id": "",
"id": 0,
"price": ""
})
),
"product_id": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/product.price.update.json \
--header 'content-type: application/json' \
--header 'x-api-key: {{apiKey}}' \
--data '{
"group_prices": [
{
"group_id": "",
"id": 0,
"price": ""
}
],
"product_id": ""
}'
echo '{
"group_prices": [
{
"group_id": "",
"id": 0,
"price": ""
}
],
"product_id": ""
}' | \
http PUT {{baseUrl}}/product.price.update.json \
content-type:application/json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method PUT \
--header 'x-api-key: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "group_prices": [\n {\n "group_id": "",\n "id": 0,\n "price": ""\n }\n ],\n "product_id": ""\n}' \
--output-document \
- {{baseUrl}}/product.price.update.json
import Foundation
let headers = [
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"group_prices": [
[
"group_id": "",
"id": 0,
"price": ""
]
],
"product_id": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/product.price.update.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
ProductReviewList
{{baseUrl}}/product.review.list.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
product_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/product.review.list.json?product_id=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/product.review.list.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:product_id ""}})
require "http/client"
url = "{{baseUrl}}/product.review.list.json?product_id="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/product.review.list.json?product_id="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/product.review.list.json?product_id=");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/product.review.list.json?product_id="
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/product.review.list.json?product_id= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/product.review.list.json?product_id=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/product.review.list.json?product_id="))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/product.review.list.json?product_id=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/product.review.list.json?product_id=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/product.review.list.json?product_id=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/product.review.list.json',
params: {product_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/product.review.list.json?product_id=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/product.review.list.json?product_id=',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/product.review.list.json?product_id=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/product.review.list.json?product_id=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/product.review.list.json',
qs: {product_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/product.review.list.json');
req.query({
product_id: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/product.review.list.json',
params: {product_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/product.review.list.json?product_id=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/product.review.list.json?product_id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/product.review.list.json?product_id=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/product.review.list.json?product_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 => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/product.review.list.json?product_id=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/product.review.list.json');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'product_id' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/product.review.list.json');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'product_id' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/product.review.list.json?product_id=' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/product.review.list.json?product_id=' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/product.review.list.json?product_id=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/product.review.list.json"
querystring = {"product_id":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/product.review.list.json"
queryString <- list(product_id = "")
response <- VERB("GET", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/product.review.list.json?product_id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/product.review.list.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['product_id'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/product.review.list.json";
let querystring = [
("product_id", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/product.review.list.json?product_id=' \
--header 'x-api-key: {{apiKey}}'
http GET '{{baseUrl}}/product.review.list.json?product_id=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/product.review.list.json?product_id='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/product.review.list.json?product_id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
ProductStoreAssign
{{baseUrl}}/product.store.assign.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
product_id
store_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/product.store.assign.json?product_id=&store_id=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/product.store.assign.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:product_id ""
:store_id ""}})
require "http/client"
url = "{{baseUrl}}/product.store.assign.json?product_id=&store_id="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.post url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/product.store.assign.json?product_id=&store_id="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/product.store.assign.json?product_id=&store_id=");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/product.store.assign.json?product_id=&store_id="
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/product.store.assign.json?product_id=&store_id= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/product.store.assign.json?product_id=&store_id=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/product.store.assign.json?product_id=&store_id="))
.header("x-api-key", "{{apiKey}}")
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/product.store.assign.json?product_id=&store_id=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/product.store.assign.json?product_id=&store_id=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/product.store.assign.json?product_id=&store_id=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/product.store.assign.json',
params: {product_id: '', store_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/product.store.assign.json?product_id=&store_id=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/product.store.assign.json?product_id=&store_id=',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/product.store.assign.json?product_id=&store_id=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/product.store.assign.json?product_id=&store_id=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/product.store.assign.json',
qs: {product_id: '', store_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/product.store.assign.json');
req.query({
product_id: '',
store_id: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/product.store.assign.json',
params: {product_id: '', store_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/product.store.assign.json?product_id=&store_id=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/product.store.assign.json?product_id=&store_id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/product.store.assign.json?product_id=&store_id=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/product.store.assign.json?product_id=&store_id=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/product.store.assign.json?product_id=&store_id=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/product.store.assign.json');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'product_id' => '',
'store_id' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/product.store.assign.json');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'product_id' => '',
'store_id' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/product.store.assign.json?product_id=&store_id=' -Method POST -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/product.store.assign.json?product_id=&store_id=' -Method POST -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("POST", "/baseUrl/product.store.assign.json?product_id=&store_id=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/product.store.assign.json"
querystring = {"product_id":"","store_id":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.post(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/product.store.assign.json"
queryString <- list(
product_id = "",
store_id = ""
)
response <- VERB("POST", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/product.store.assign.json?product_id=&store_id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/product.store.assign.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['product_id'] = ''
req.params['store_id'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/product.store.assign.json";
let querystring = [
("product_id", ""),
("store_id", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/product.store.assign.json?product_id=&store_id=' \
--header 'x-api-key: {{apiKey}}'
http POST '{{baseUrl}}/product.store.assign.json?product_id=&store_id=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/product.store.assign.json?product_id=&store_id='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/product.store.assign.json?product_id=&store_id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
ProductTaxAdd
{{baseUrl}}/product.tax.add.json
HEADERS
x-api-key
{{apiKey}}
BODY json
{
"name": "",
"product_id": "",
"tax_rates": [
{
"name": "",
"type": "",
"value": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/product.tax.add.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"name\": \"\",\n \"product_id\": \"\",\n \"tax_rates\": [\n {\n \"name\": \"\",\n \"type\": \"\",\n \"value\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/product.tax.add.json" {:headers {:x-api-key "{{apiKey}}"}
:content-type :json
:form-params {:name ""
:product_id ""
:tax_rates [{:name ""
:type ""
:value ""}]}})
require "http/client"
url = "{{baseUrl}}/product.tax.add.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"name\": \"\",\n \"product_id\": \"\",\n \"tax_rates\": [\n {\n \"name\": \"\",\n \"type\": \"\",\n \"value\": \"\"\n }\n ]\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/product.tax.add.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
Content = new StringContent("{\n \"name\": \"\",\n \"product_id\": \"\",\n \"tax_rates\": [\n {\n \"name\": \"\",\n \"type\": \"\",\n \"value\": \"\"\n }\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/product.tax.add.json");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"name\": \"\",\n \"product_id\": \"\",\n \"tax_rates\": [\n {\n \"name\": \"\",\n \"type\": \"\",\n \"value\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/product.tax.add.json"
payload := strings.NewReader("{\n \"name\": \"\",\n \"product_id\": \"\",\n \"tax_rates\": [\n {\n \"name\": \"\",\n \"type\": \"\",\n \"value\": \"\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/product.tax.add.json HTTP/1.1
X-Api-Key: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 124
{
"name": "",
"product_id": "",
"tax_rates": [
{
"name": "",
"type": "",
"value": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/product.tax.add.json")
.setHeader("x-api-key", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"name\": \"\",\n \"product_id\": \"\",\n \"tax_rates\": [\n {\n \"name\": \"\",\n \"type\": \"\",\n \"value\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/product.tax.add.json"))
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"name\": \"\",\n \"product_id\": \"\",\n \"tax_rates\": [\n {\n \"name\": \"\",\n \"type\": \"\",\n \"value\": \"\"\n }\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"name\": \"\",\n \"product_id\": \"\",\n \"tax_rates\": [\n {\n \"name\": \"\",\n \"type\": \"\",\n \"value\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/product.tax.add.json")
.post(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/product.tax.add.json")
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"name\": \"\",\n \"product_id\": \"\",\n \"tax_rates\": [\n {\n \"name\": \"\",\n \"type\": \"\",\n \"value\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
name: '',
product_id: '',
tax_rates: [
{
name: '',
type: '',
value: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/product.tax.add.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/product.tax.add.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {name: '', product_id: '', tax_rates: [{name: '', type: '', value: ''}]}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/product.tax.add.json';
const options = {
method: 'POST',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"name":"","product_id":"","tax_rates":[{"name":"","type":"","value":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/product.tax.add.json',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "name": "",\n "product_id": "",\n "tax_rates": [\n {\n "name": "",\n "type": "",\n "value": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"name\": \"\",\n \"product_id\": \"\",\n \"tax_rates\": [\n {\n \"name\": \"\",\n \"type\": \"\",\n \"value\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/product.tax.add.json")
.post(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/product.tax.add.json',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({name: '', product_id: '', tax_rates: [{name: '', type: '', value: ''}]}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/product.tax.add.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: {name: '', product_id: '', tax_rates: [{name: '', type: '', value: ''}]},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/product.tax.add.json');
req.headers({
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
name: '',
product_id: '',
tax_rates: [
{
name: '',
type: '',
value: ''
}
]
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/product.tax.add.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {name: '', product_id: '', tax_rates: [{name: '', type: '', value: ''}]}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/product.tax.add.json';
const options = {
method: 'POST',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"name":"","product_id":"","tax_rates":[{"name":"","type":"","value":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"name": @"",
@"product_id": @"",
@"tax_rates": @[ @{ @"name": @"", @"type": @"", @"value": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/product.tax.add.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/product.tax.add.json" in
let headers = Header.add_list (Header.init ()) [
("x-api-key", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"name\": \"\",\n \"product_id\": \"\",\n \"tax_rates\": [\n {\n \"name\": \"\",\n \"type\": \"\",\n \"value\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/product.tax.add.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '',
'product_id' => '',
'tax_rates' => [
[
'name' => '',
'type' => '',
'value' => ''
]
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/product.tax.add.json', [
'body' => '{
"name": "",
"product_id": "",
"tax_rates": [
{
"name": "",
"type": "",
"value": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/product.tax.add.json');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'name' => '',
'product_id' => '',
'tax_rates' => [
[
'name' => '',
'type' => '',
'value' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'name' => '',
'product_id' => '',
'tax_rates' => [
[
'name' => '',
'type' => '',
'value' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/product.tax.add.json');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/product.tax.add.json' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"name": "",
"product_id": "",
"tax_rates": [
{
"name": "",
"type": "",
"value": ""
}
]
}'
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/product.tax.add.json' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"name": "",
"product_id": "",
"tax_rates": [
{
"name": "",
"type": "",
"value": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"name\": \"\",\n \"product_id\": \"\",\n \"tax_rates\": [\n {\n \"name\": \"\",\n \"type\": \"\",\n \"value\": \"\"\n }\n ]\n}"
headers = {
'x-api-key': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/product.tax.add.json", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/product.tax.add.json"
payload = {
"name": "",
"product_id": "",
"tax_rates": [
{
"name": "",
"type": "",
"value": ""
}
]
}
headers = {
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/product.tax.add.json"
payload <- "{\n \"name\": \"\",\n \"product_id\": \"\",\n \"tax_rates\": [\n {\n \"name\": \"\",\n \"type\": \"\",\n \"value\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/product.tax.add.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"name\": \"\",\n \"product_id\": \"\",\n \"tax_rates\": [\n {\n \"name\": \"\",\n \"type\": \"\",\n \"value\": \"\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/product.tax.add.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.body = "{\n \"name\": \"\",\n \"product_id\": \"\",\n \"tax_rates\": [\n {\n \"name\": \"\",\n \"type\": \"\",\n \"value\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/product.tax.add.json";
let payload = json!({
"name": "",
"product_id": "",
"tax_rates": (
json!({
"name": "",
"type": "",
"value": ""
})
)
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/product.tax.add.json \
--header 'content-type: application/json' \
--header 'x-api-key: {{apiKey}}' \
--data '{
"name": "",
"product_id": "",
"tax_rates": [
{
"name": "",
"type": "",
"value": ""
}
]
}'
echo '{
"name": "",
"product_id": "",
"tax_rates": [
{
"name": "",
"type": "",
"value": ""
}
]
}' | \
http POST {{baseUrl}}/product.tax.add.json \
content-type:application/json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "name": "",\n "product_id": "",\n "tax_rates": [\n {\n "name": "",\n "type": "",\n "value": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/product.tax.add.json
import Foundation
let headers = [
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"name": "",
"product_id": "",
"tax_rates": [
[
"name": "",
"type": "",
"value": ""
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/product.tax.add.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PUT
ProductUpdate
{{baseUrl}}/product.update.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/product.update.json?id=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/product.update.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:id ""}})
require "http/client"
url = "{{baseUrl}}/product.update.json?id="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.put url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/product.update.json?id="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/product.update.json?id=");
var request = new RestRequest("", Method.Put);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/product.update.json?id="
req, _ := http.NewRequest("PUT", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/product.update.json?id= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/product.update.json?id=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/product.update.json?id="))
.header("x-api-key", "{{apiKey}}")
.method("PUT", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/product.update.json?id=")
.put(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/product.update.json?id=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/product.update.json?id=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/product.update.json',
params: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/product.update.json?id=';
const options = {method: 'PUT', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/product.update.json?id=',
method: 'PUT',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/product.update.json?id=")
.put(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/product.update.json?id=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/product.update.json',
qs: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/product.update.json');
req.query({
id: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/product.update.json',
params: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/product.update.json?id=';
const options = {method: 'PUT', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/product.update.json?id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/product.update.json?id=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/product.update.json?id=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/product.update.json?id=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/product.update.json');
$request->setMethod(HTTP_METH_PUT);
$request->setQueryData([
'id' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/product.update.json');
$request->setRequestMethod('PUT');
$request->setQuery(new http\QueryString([
'id' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/product.update.json?id=' -Method PUT -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/product.update.json?id=' -Method PUT -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("PUT", "/baseUrl/product.update.json?id=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/product.update.json"
querystring = {"id":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.put(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/product.update.json"
queryString <- list(id = "")
response <- VERB("PUT", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/product.update.json?id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.put('/baseUrl/product.update.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['id'] = ''
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/product.update.json";
let querystring = [
("id", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url '{{baseUrl}}/product.update.json?id=' \
--header 'x-api-key: {{apiKey}}'
http PUT '{{baseUrl}}/product.update.json?id=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method PUT \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/product.update.json?id='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/product.update.json?id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
ProductVariantAdd
{{baseUrl}}/product.variant.add.json
HEADERS
x-api-key
{{apiKey}}
BODY json
{
"attributes": [
{
"attribute_name": "",
"attribute_price": "",
"attribute_value": ""
}
],
"available_for_sale": false,
"available_for_view": false,
"barcode": "",
"clear_cache": false,
"cost_price": "",
"country_of_origin": "",
"created_at": "",
"description": "",
"harmonized_system_code": "",
"height": "",
"lang_id": "",
"length": "",
"manage_stock": false,
"manufacturer": "",
"meta_description": "",
"meta_keywords": "",
"meta_title": "",
"model": "",
"name": "",
"price": "",
"product_id": "",
"quantity": "",
"short_description": "",
"sku": "",
"special_price": "",
"sprice_create": "",
"sprice_expire": "",
"sprice_modified": "",
"store_id": "",
"tax_class_id": 0,
"taxable": false,
"url": "",
"warehouse_id": "",
"weight": "",
"weight_unit": "",
"width": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/product.variant.add.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"attributes\": [\n {\n \"attribute_name\": \"\",\n \"attribute_price\": \"\",\n \"attribute_value\": \"\"\n }\n ],\n \"available_for_sale\": false,\n \"available_for_view\": false,\n \"barcode\": \"\",\n \"clear_cache\": false,\n \"cost_price\": \"\",\n \"country_of_origin\": \"\",\n \"created_at\": \"\",\n \"description\": \"\",\n \"harmonized_system_code\": \"\",\n \"height\": \"\",\n \"lang_id\": \"\",\n \"length\": \"\",\n \"manage_stock\": false,\n \"manufacturer\": \"\",\n \"meta_description\": \"\",\n \"meta_keywords\": \"\",\n \"meta_title\": \"\",\n \"model\": \"\",\n \"name\": \"\",\n \"price\": \"\",\n \"product_id\": \"\",\n \"quantity\": \"\",\n \"short_description\": \"\",\n \"sku\": \"\",\n \"special_price\": \"\",\n \"sprice_create\": \"\",\n \"sprice_expire\": \"\",\n \"sprice_modified\": \"\",\n \"store_id\": \"\",\n \"tax_class_id\": 0,\n \"taxable\": false,\n \"url\": \"\",\n \"warehouse_id\": \"\",\n \"weight\": \"\",\n \"weight_unit\": \"\",\n \"width\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/product.variant.add.json" {:headers {:x-api-key "{{apiKey}}"}
:content-type :json
:form-params {:attributes [{:attribute_name ""
:attribute_price ""
:attribute_value ""}]
:available_for_sale false
:available_for_view false
:barcode ""
:clear_cache false
:cost_price ""
:country_of_origin ""
:created_at ""
:description ""
:harmonized_system_code ""
:height ""
:lang_id ""
:length ""
:manage_stock false
:manufacturer ""
:meta_description ""
:meta_keywords ""
:meta_title ""
:model ""
:name ""
:price ""
:product_id ""
:quantity ""
:short_description ""
:sku ""
:special_price ""
:sprice_create ""
:sprice_expire ""
:sprice_modified ""
:store_id ""
:tax_class_id 0
:taxable false
:url ""
:warehouse_id ""
:weight ""
:weight_unit ""
:width ""}})
require "http/client"
url = "{{baseUrl}}/product.variant.add.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"attributes\": [\n {\n \"attribute_name\": \"\",\n \"attribute_price\": \"\",\n \"attribute_value\": \"\"\n }\n ],\n \"available_for_sale\": false,\n \"available_for_view\": false,\n \"barcode\": \"\",\n \"clear_cache\": false,\n \"cost_price\": \"\",\n \"country_of_origin\": \"\",\n \"created_at\": \"\",\n \"description\": \"\",\n \"harmonized_system_code\": \"\",\n \"height\": \"\",\n \"lang_id\": \"\",\n \"length\": \"\",\n \"manage_stock\": false,\n \"manufacturer\": \"\",\n \"meta_description\": \"\",\n \"meta_keywords\": \"\",\n \"meta_title\": \"\",\n \"model\": \"\",\n \"name\": \"\",\n \"price\": \"\",\n \"product_id\": \"\",\n \"quantity\": \"\",\n \"short_description\": \"\",\n \"sku\": \"\",\n \"special_price\": \"\",\n \"sprice_create\": \"\",\n \"sprice_expire\": \"\",\n \"sprice_modified\": \"\",\n \"store_id\": \"\",\n \"tax_class_id\": 0,\n \"taxable\": false,\n \"url\": \"\",\n \"warehouse_id\": \"\",\n \"weight\": \"\",\n \"weight_unit\": \"\",\n \"width\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/product.variant.add.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
Content = new StringContent("{\n \"attributes\": [\n {\n \"attribute_name\": \"\",\n \"attribute_price\": \"\",\n \"attribute_value\": \"\"\n }\n ],\n \"available_for_sale\": false,\n \"available_for_view\": false,\n \"barcode\": \"\",\n \"clear_cache\": false,\n \"cost_price\": \"\",\n \"country_of_origin\": \"\",\n \"created_at\": \"\",\n \"description\": \"\",\n \"harmonized_system_code\": \"\",\n \"height\": \"\",\n \"lang_id\": \"\",\n \"length\": \"\",\n \"manage_stock\": false,\n \"manufacturer\": \"\",\n \"meta_description\": \"\",\n \"meta_keywords\": \"\",\n \"meta_title\": \"\",\n \"model\": \"\",\n \"name\": \"\",\n \"price\": \"\",\n \"product_id\": \"\",\n \"quantity\": \"\",\n \"short_description\": \"\",\n \"sku\": \"\",\n \"special_price\": \"\",\n \"sprice_create\": \"\",\n \"sprice_expire\": \"\",\n \"sprice_modified\": \"\",\n \"store_id\": \"\",\n \"tax_class_id\": 0,\n \"taxable\": false,\n \"url\": \"\",\n \"warehouse_id\": \"\",\n \"weight\": \"\",\n \"weight_unit\": \"\",\n \"width\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/product.variant.add.json");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"attributes\": [\n {\n \"attribute_name\": \"\",\n \"attribute_price\": \"\",\n \"attribute_value\": \"\"\n }\n ],\n \"available_for_sale\": false,\n \"available_for_view\": false,\n \"barcode\": \"\",\n \"clear_cache\": false,\n \"cost_price\": \"\",\n \"country_of_origin\": \"\",\n \"created_at\": \"\",\n \"description\": \"\",\n \"harmonized_system_code\": \"\",\n \"height\": \"\",\n \"lang_id\": \"\",\n \"length\": \"\",\n \"manage_stock\": false,\n \"manufacturer\": \"\",\n \"meta_description\": \"\",\n \"meta_keywords\": \"\",\n \"meta_title\": \"\",\n \"model\": \"\",\n \"name\": \"\",\n \"price\": \"\",\n \"product_id\": \"\",\n \"quantity\": \"\",\n \"short_description\": \"\",\n \"sku\": \"\",\n \"special_price\": \"\",\n \"sprice_create\": \"\",\n \"sprice_expire\": \"\",\n \"sprice_modified\": \"\",\n \"store_id\": \"\",\n \"tax_class_id\": 0,\n \"taxable\": false,\n \"url\": \"\",\n \"warehouse_id\": \"\",\n \"weight\": \"\",\n \"weight_unit\": \"\",\n \"width\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/product.variant.add.json"
payload := strings.NewReader("{\n \"attributes\": [\n {\n \"attribute_name\": \"\",\n \"attribute_price\": \"\",\n \"attribute_value\": \"\"\n }\n ],\n \"available_for_sale\": false,\n \"available_for_view\": false,\n \"barcode\": \"\",\n \"clear_cache\": false,\n \"cost_price\": \"\",\n \"country_of_origin\": \"\",\n \"created_at\": \"\",\n \"description\": \"\",\n \"harmonized_system_code\": \"\",\n \"height\": \"\",\n \"lang_id\": \"\",\n \"length\": \"\",\n \"manage_stock\": false,\n \"manufacturer\": \"\",\n \"meta_description\": \"\",\n \"meta_keywords\": \"\",\n \"meta_title\": \"\",\n \"model\": \"\",\n \"name\": \"\",\n \"price\": \"\",\n \"product_id\": \"\",\n \"quantity\": \"\",\n \"short_description\": \"\",\n \"sku\": \"\",\n \"special_price\": \"\",\n \"sprice_create\": \"\",\n \"sprice_expire\": \"\",\n \"sprice_modified\": \"\",\n \"store_id\": \"\",\n \"tax_class_id\": 0,\n \"taxable\": false,\n \"url\": \"\",\n \"warehouse_id\": \"\",\n \"weight\": \"\",\n \"weight_unit\": \"\",\n \"width\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/product.variant.add.json HTTP/1.1
X-Api-Key: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 872
{
"attributes": [
{
"attribute_name": "",
"attribute_price": "",
"attribute_value": ""
}
],
"available_for_sale": false,
"available_for_view": false,
"barcode": "",
"clear_cache": false,
"cost_price": "",
"country_of_origin": "",
"created_at": "",
"description": "",
"harmonized_system_code": "",
"height": "",
"lang_id": "",
"length": "",
"manage_stock": false,
"manufacturer": "",
"meta_description": "",
"meta_keywords": "",
"meta_title": "",
"model": "",
"name": "",
"price": "",
"product_id": "",
"quantity": "",
"short_description": "",
"sku": "",
"special_price": "",
"sprice_create": "",
"sprice_expire": "",
"sprice_modified": "",
"store_id": "",
"tax_class_id": 0,
"taxable": false,
"url": "",
"warehouse_id": "",
"weight": "",
"weight_unit": "",
"width": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/product.variant.add.json")
.setHeader("x-api-key", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"attributes\": [\n {\n \"attribute_name\": \"\",\n \"attribute_price\": \"\",\n \"attribute_value\": \"\"\n }\n ],\n \"available_for_sale\": false,\n \"available_for_view\": false,\n \"barcode\": \"\",\n \"clear_cache\": false,\n \"cost_price\": \"\",\n \"country_of_origin\": \"\",\n \"created_at\": \"\",\n \"description\": \"\",\n \"harmonized_system_code\": \"\",\n \"height\": \"\",\n \"lang_id\": \"\",\n \"length\": \"\",\n \"manage_stock\": false,\n \"manufacturer\": \"\",\n \"meta_description\": \"\",\n \"meta_keywords\": \"\",\n \"meta_title\": \"\",\n \"model\": \"\",\n \"name\": \"\",\n \"price\": \"\",\n \"product_id\": \"\",\n \"quantity\": \"\",\n \"short_description\": \"\",\n \"sku\": \"\",\n \"special_price\": \"\",\n \"sprice_create\": \"\",\n \"sprice_expire\": \"\",\n \"sprice_modified\": \"\",\n \"store_id\": \"\",\n \"tax_class_id\": 0,\n \"taxable\": false,\n \"url\": \"\",\n \"warehouse_id\": \"\",\n \"weight\": \"\",\n \"weight_unit\": \"\",\n \"width\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/product.variant.add.json"))
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"attributes\": [\n {\n \"attribute_name\": \"\",\n \"attribute_price\": \"\",\n \"attribute_value\": \"\"\n }\n ],\n \"available_for_sale\": false,\n \"available_for_view\": false,\n \"barcode\": \"\",\n \"clear_cache\": false,\n \"cost_price\": \"\",\n \"country_of_origin\": \"\",\n \"created_at\": \"\",\n \"description\": \"\",\n \"harmonized_system_code\": \"\",\n \"height\": \"\",\n \"lang_id\": \"\",\n \"length\": \"\",\n \"manage_stock\": false,\n \"manufacturer\": \"\",\n \"meta_description\": \"\",\n \"meta_keywords\": \"\",\n \"meta_title\": \"\",\n \"model\": \"\",\n \"name\": \"\",\n \"price\": \"\",\n \"product_id\": \"\",\n \"quantity\": \"\",\n \"short_description\": \"\",\n \"sku\": \"\",\n \"special_price\": \"\",\n \"sprice_create\": \"\",\n \"sprice_expire\": \"\",\n \"sprice_modified\": \"\",\n \"store_id\": \"\",\n \"tax_class_id\": 0,\n \"taxable\": false,\n \"url\": \"\",\n \"warehouse_id\": \"\",\n \"weight\": \"\",\n \"weight_unit\": \"\",\n \"width\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"attributes\": [\n {\n \"attribute_name\": \"\",\n \"attribute_price\": \"\",\n \"attribute_value\": \"\"\n }\n ],\n \"available_for_sale\": false,\n \"available_for_view\": false,\n \"barcode\": \"\",\n \"clear_cache\": false,\n \"cost_price\": \"\",\n \"country_of_origin\": \"\",\n \"created_at\": \"\",\n \"description\": \"\",\n \"harmonized_system_code\": \"\",\n \"height\": \"\",\n \"lang_id\": \"\",\n \"length\": \"\",\n \"manage_stock\": false,\n \"manufacturer\": \"\",\n \"meta_description\": \"\",\n \"meta_keywords\": \"\",\n \"meta_title\": \"\",\n \"model\": \"\",\n \"name\": \"\",\n \"price\": \"\",\n \"product_id\": \"\",\n \"quantity\": \"\",\n \"short_description\": \"\",\n \"sku\": \"\",\n \"special_price\": \"\",\n \"sprice_create\": \"\",\n \"sprice_expire\": \"\",\n \"sprice_modified\": \"\",\n \"store_id\": \"\",\n \"tax_class_id\": 0,\n \"taxable\": false,\n \"url\": \"\",\n \"warehouse_id\": \"\",\n \"weight\": \"\",\n \"weight_unit\": \"\",\n \"width\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/product.variant.add.json")
.post(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/product.variant.add.json")
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"attributes\": [\n {\n \"attribute_name\": \"\",\n \"attribute_price\": \"\",\n \"attribute_value\": \"\"\n }\n ],\n \"available_for_sale\": false,\n \"available_for_view\": false,\n \"barcode\": \"\",\n \"clear_cache\": false,\n \"cost_price\": \"\",\n \"country_of_origin\": \"\",\n \"created_at\": \"\",\n \"description\": \"\",\n \"harmonized_system_code\": \"\",\n \"height\": \"\",\n \"lang_id\": \"\",\n \"length\": \"\",\n \"manage_stock\": false,\n \"manufacturer\": \"\",\n \"meta_description\": \"\",\n \"meta_keywords\": \"\",\n \"meta_title\": \"\",\n \"model\": \"\",\n \"name\": \"\",\n \"price\": \"\",\n \"product_id\": \"\",\n \"quantity\": \"\",\n \"short_description\": \"\",\n \"sku\": \"\",\n \"special_price\": \"\",\n \"sprice_create\": \"\",\n \"sprice_expire\": \"\",\n \"sprice_modified\": \"\",\n \"store_id\": \"\",\n \"tax_class_id\": 0,\n \"taxable\": false,\n \"url\": \"\",\n \"warehouse_id\": \"\",\n \"weight\": \"\",\n \"weight_unit\": \"\",\n \"width\": \"\"\n}")
.asString();
const data = JSON.stringify({
attributes: [
{
attribute_name: '',
attribute_price: '',
attribute_value: ''
}
],
available_for_sale: false,
available_for_view: false,
barcode: '',
clear_cache: false,
cost_price: '',
country_of_origin: '',
created_at: '',
description: '',
harmonized_system_code: '',
height: '',
lang_id: '',
length: '',
manage_stock: false,
manufacturer: '',
meta_description: '',
meta_keywords: '',
meta_title: '',
model: '',
name: '',
price: '',
product_id: '',
quantity: '',
short_description: '',
sku: '',
special_price: '',
sprice_create: '',
sprice_expire: '',
sprice_modified: '',
store_id: '',
tax_class_id: 0,
taxable: false,
url: '',
warehouse_id: '',
weight: '',
weight_unit: '',
width: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/product.variant.add.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/product.variant.add.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {
attributes: [{attribute_name: '', attribute_price: '', attribute_value: ''}],
available_for_sale: false,
available_for_view: false,
barcode: '',
clear_cache: false,
cost_price: '',
country_of_origin: '',
created_at: '',
description: '',
harmonized_system_code: '',
height: '',
lang_id: '',
length: '',
manage_stock: false,
manufacturer: '',
meta_description: '',
meta_keywords: '',
meta_title: '',
model: '',
name: '',
price: '',
product_id: '',
quantity: '',
short_description: '',
sku: '',
special_price: '',
sprice_create: '',
sprice_expire: '',
sprice_modified: '',
store_id: '',
tax_class_id: 0,
taxable: false,
url: '',
warehouse_id: '',
weight: '',
weight_unit: '',
width: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/product.variant.add.json';
const options = {
method: 'POST',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"attributes":[{"attribute_name":"","attribute_price":"","attribute_value":""}],"available_for_sale":false,"available_for_view":false,"barcode":"","clear_cache":false,"cost_price":"","country_of_origin":"","created_at":"","description":"","harmonized_system_code":"","height":"","lang_id":"","length":"","manage_stock":false,"manufacturer":"","meta_description":"","meta_keywords":"","meta_title":"","model":"","name":"","price":"","product_id":"","quantity":"","short_description":"","sku":"","special_price":"","sprice_create":"","sprice_expire":"","sprice_modified":"","store_id":"","tax_class_id":0,"taxable":false,"url":"","warehouse_id":"","weight":"","weight_unit":"","width":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/product.variant.add.json',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "attributes": [\n {\n "attribute_name": "",\n "attribute_price": "",\n "attribute_value": ""\n }\n ],\n "available_for_sale": false,\n "available_for_view": false,\n "barcode": "",\n "clear_cache": false,\n "cost_price": "",\n "country_of_origin": "",\n "created_at": "",\n "description": "",\n "harmonized_system_code": "",\n "height": "",\n "lang_id": "",\n "length": "",\n "manage_stock": false,\n "manufacturer": "",\n "meta_description": "",\n "meta_keywords": "",\n "meta_title": "",\n "model": "",\n "name": "",\n "price": "",\n "product_id": "",\n "quantity": "",\n "short_description": "",\n "sku": "",\n "special_price": "",\n "sprice_create": "",\n "sprice_expire": "",\n "sprice_modified": "",\n "store_id": "",\n "tax_class_id": 0,\n "taxable": false,\n "url": "",\n "warehouse_id": "",\n "weight": "",\n "weight_unit": "",\n "width": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"attributes\": [\n {\n \"attribute_name\": \"\",\n \"attribute_price\": \"\",\n \"attribute_value\": \"\"\n }\n ],\n \"available_for_sale\": false,\n \"available_for_view\": false,\n \"barcode\": \"\",\n \"clear_cache\": false,\n \"cost_price\": \"\",\n \"country_of_origin\": \"\",\n \"created_at\": \"\",\n \"description\": \"\",\n \"harmonized_system_code\": \"\",\n \"height\": \"\",\n \"lang_id\": \"\",\n \"length\": \"\",\n \"manage_stock\": false,\n \"manufacturer\": \"\",\n \"meta_description\": \"\",\n \"meta_keywords\": \"\",\n \"meta_title\": \"\",\n \"model\": \"\",\n \"name\": \"\",\n \"price\": \"\",\n \"product_id\": \"\",\n \"quantity\": \"\",\n \"short_description\": \"\",\n \"sku\": \"\",\n \"special_price\": \"\",\n \"sprice_create\": \"\",\n \"sprice_expire\": \"\",\n \"sprice_modified\": \"\",\n \"store_id\": \"\",\n \"tax_class_id\": 0,\n \"taxable\": false,\n \"url\": \"\",\n \"warehouse_id\": \"\",\n \"weight\": \"\",\n \"weight_unit\": \"\",\n \"width\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/product.variant.add.json")
.post(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/product.variant.add.json',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
attributes: [{attribute_name: '', attribute_price: '', attribute_value: ''}],
available_for_sale: false,
available_for_view: false,
barcode: '',
clear_cache: false,
cost_price: '',
country_of_origin: '',
created_at: '',
description: '',
harmonized_system_code: '',
height: '',
lang_id: '',
length: '',
manage_stock: false,
manufacturer: '',
meta_description: '',
meta_keywords: '',
meta_title: '',
model: '',
name: '',
price: '',
product_id: '',
quantity: '',
short_description: '',
sku: '',
special_price: '',
sprice_create: '',
sprice_expire: '',
sprice_modified: '',
store_id: '',
tax_class_id: 0,
taxable: false,
url: '',
warehouse_id: '',
weight: '',
weight_unit: '',
width: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/product.variant.add.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: {
attributes: [{attribute_name: '', attribute_price: '', attribute_value: ''}],
available_for_sale: false,
available_for_view: false,
barcode: '',
clear_cache: false,
cost_price: '',
country_of_origin: '',
created_at: '',
description: '',
harmonized_system_code: '',
height: '',
lang_id: '',
length: '',
manage_stock: false,
manufacturer: '',
meta_description: '',
meta_keywords: '',
meta_title: '',
model: '',
name: '',
price: '',
product_id: '',
quantity: '',
short_description: '',
sku: '',
special_price: '',
sprice_create: '',
sprice_expire: '',
sprice_modified: '',
store_id: '',
tax_class_id: 0,
taxable: false,
url: '',
warehouse_id: '',
weight: '',
weight_unit: '',
width: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/product.variant.add.json');
req.headers({
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
attributes: [
{
attribute_name: '',
attribute_price: '',
attribute_value: ''
}
],
available_for_sale: false,
available_for_view: false,
barcode: '',
clear_cache: false,
cost_price: '',
country_of_origin: '',
created_at: '',
description: '',
harmonized_system_code: '',
height: '',
lang_id: '',
length: '',
manage_stock: false,
manufacturer: '',
meta_description: '',
meta_keywords: '',
meta_title: '',
model: '',
name: '',
price: '',
product_id: '',
quantity: '',
short_description: '',
sku: '',
special_price: '',
sprice_create: '',
sprice_expire: '',
sprice_modified: '',
store_id: '',
tax_class_id: 0,
taxable: false,
url: '',
warehouse_id: '',
weight: '',
weight_unit: '',
width: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/product.variant.add.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {
attributes: [{attribute_name: '', attribute_price: '', attribute_value: ''}],
available_for_sale: false,
available_for_view: false,
barcode: '',
clear_cache: false,
cost_price: '',
country_of_origin: '',
created_at: '',
description: '',
harmonized_system_code: '',
height: '',
lang_id: '',
length: '',
manage_stock: false,
manufacturer: '',
meta_description: '',
meta_keywords: '',
meta_title: '',
model: '',
name: '',
price: '',
product_id: '',
quantity: '',
short_description: '',
sku: '',
special_price: '',
sprice_create: '',
sprice_expire: '',
sprice_modified: '',
store_id: '',
tax_class_id: 0,
taxable: false,
url: '',
warehouse_id: '',
weight: '',
weight_unit: '',
width: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/product.variant.add.json';
const options = {
method: 'POST',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"attributes":[{"attribute_name":"","attribute_price":"","attribute_value":""}],"available_for_sale":false,"available_for_view":false,"barcode":"","clear_cache":false,"cost_price":"","country_of_origin":"","created_at":"","description":"","harmonized_system_code":"","height":"","lang_id":"","length":"","manage_stock":false,"manufacturer":"","meta_description":"","meta_keywords":"","meta_title":"","model":"","name":"","price":"","product_id":"","quantity":"","short_description":"","sku":"","special_price":"","sprice_create":"","sprice_expire":"","sprice_modified":"","store_id":"","tax_class_id":0,"taxable":false,"url":"","warehouse_id":"","weight":"","weight_unit":"","width":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"attributes": @[ @{ @"attribute_name": @"", @"attribute_price": @"", @"attribute_value": @"" } ],
@"available_for_sale": @NO,
@"available_for_view": @NO,
@"barcode": @"",
@"clear_cache": @NO,
@"cost_price": @"",
@"country_of_origin": @"",
@"created_at": @"",
@"description": @"",
@"harmonized_system_code": @"",
@"height": @"",
@"lang_id": @"",
@"length": @"",
@"manage_stock": @NO,
@"manufacturer": @"",
@"meta_description": @"",
@"meta_keywords": @"",
@"meta_title": @"",
@"model": @"",
@"name": @"",
@"price": @"",
@"product_id": @"",
@"quantity": @"",
@"short_description": @"",
@"sku": @"",
@"special_price": @"",
@"sprice_create": @"",
@"sprice_expire": @"",
@"sprice_modified": @"",
@"store_id": @"",
@"tax_class_id": @0,
@"taxable": @NO,
@"url": @"",
@"warehouse_id": @"",
@"weight": @"",
@"weight_unit": @"",
@"width": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/product.variant.add.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/product.variant.add.json" in
let headers = Header.add_list (Header.init ()) [
("x-api-key", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"attributes\": [\n {\n \"attribute_name\": \"\",\n \"attribute_price\": \"\",\n \"attribute_value\": \"\"\n }\n ],\n \"available_for_sale\": false,\n \"available_for_view\": false,\n \"barcode\": \"\",\n \"clear_cache\": false,\n \"cost_price\": \"\",\n \"country_of_origin\": \"\",\n \"created_at\": \"\",\n \"description\": \"\",\n \"harmonized_system_code\": \"\",\n \"height\": \"\",\n \"lang_id\": \"\",\n \"length\": \"\",\n \"manage_stock\": false,\n \"manufacturer\": \"\",\n \"meta_description\": \"\",\n \"meta_keywords\": \"\",\n \"meta_title\": \"\",\n \"model\": \"\",\n \"name\": \"\",\n \"price\": \"\",\n \"product_id\": \"\",\n \"quantity\": \"\",\n \"short_description\": \"\",\n \"sku\": \"\",\n \"special_price\": \"\",\n \"sprice_create\": \"\",\n \"sprice_expire\": \"\",\n \"sprice_modified\": \"\",\n \"store_id\": \"\",\n \"tax_class_id\": 0,\n \"taxable\": false,\n \"url\": \"\",\n \"warehouse_id\": \"\",\n \"weight\": \"\",\n \"weight_unit\": \"\",\n \"width\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/product.variant.add.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'attributes' => [
[
'attribute_name' => '',
'attribute_price' => '',
'attribute_value' => ''
]
],
'available_for_sale' => null,
'available_for_view' => null,
'barcode' => '',
'clear_cache' => null,
'cost_price' => '',
'country_of_origin' => '',
'created_at' => '',
'description' => '',
'harmonized_system_code' => '',
'height' => '',
'lang_id' => '',
'length' => '',
'manage_stock' => null,
'manufacturer' => '',
'meta_description' => '',
'meta_keywords' => '',
'meta_title' => '',
'model' => '',
'name' => '',
'price' => '',
'product_id' => '',
'quantity' => '',
'short_description' => '',
'sku' => '',
'special_price' => '',
'sprice_create' => '',
'sprice_expire' => '',
'sprice_modified' => '',
'store_id' => '',
'tax_class_id' => 0,
'taxable' => null,
'url' => '',
'warehouse_id' => '',
'weight' => '',
'weight_unit' => '',
'width' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/product.variant.add.json', [
'body' => '{
"attributes": [
{
"attribute_name": "",
"attribute_price": "",
"attribute_value": ""
}
],
"available_for_sale": false,
"available_for_view": false,
"barcode": "",
"clear_cache": false,
"cost_price": "",
"country_of_origin": "",
"created_at": "",
"description": "",
"harmonized_system_code": "",
"height": "",
"lang_id": "",
"length": "",
"manage_stock": false,
"manufacturer": "",
"meta_description": "",
"meta_keywords": "",
"meta_title": "",
"model": "",
"name": "",
"price": "",
"product_id": "",
"quantity": "",
"short_description": "",
"sku": "",
"special_price": "",
"sprice_create": "",
"sprice_expire": "",
"sprice_modified": "",
"store_id": "",
"tax_class_id": 0,
"taxable": false,
"url": "",
"warehouse_id": "",
"weight": "",
"weight_unit": "",
"width": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/product.variant.add.json');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'attributes' => [
[
'attribute_name' => '',
'attribute_price' => '',
'attribute_value' => ''
]
],
'available_for_sale' => null,
'available_for_view' => null,
'barcode' => '',
'clear_cache' => null,
'cost_price' => '',
'country_of_origin' => '',
'created_at' => '',
'description' => '',
'harmonized_system_code' => '',
'height' => '',
'lang_id' => '',
'length' => '',
'manage_stock' => null,
'manufacturer' => '',
'meta_description' => '',
'meta_keywords' => '',
'meta_title' => '',
'model' => '',
'name' => '',
'price' => '',
'product_id' => '',
'quantity' => '',
'short_description' => '',
'sku' => '',
'special_price' => '',
'sprice_create' => '',
'sprice_expire' => '',
'sprice_modified' => '',
'store_id' => '',
'tax_class_id' => 0,
'taxable' => null,
'url' => '',
'warehouse_id' => '',
'weight' => '',
'weight_unit' => '',
'width' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'attributes' => [
[
'attribute_name' => '',
'attribute_price' => '',
'attribute_value' => ''
]
],
'available_for_sale' => null,
'available_for_view' => null,
'barcode' => '',
'clear_cache' => null,
'cost_price' => '',
'country_of_origin' => '',
'created_at' => '',
'description' => '',
'harmonized_system_code' => '',
'height' => '',
'lang_id' => '',
'length' => '',
'manage_stock' => null,
'manufacturer' => '',
'meta_description' => '',
'meta_keywords' => '',
'meta_title' => '',
'model' => '',
'name' => '',
'price' => '',
'product_id' => '',
'quantity' => '',
'short_description' => '',
'sku' => '',
'special_price' => '',
'sprice_create' => '',
'sprice_expire' => '',
'sprice_modified' => '',
'store_id' => '',
'tax_class_id' => 0,
'taxable' => null,
'url' => '',
'warehouse_id' => '',
'weight' => '',
'weight_unit' => '',
'width' => ''
]));
$request->setRequestUrl('{{baseUrl}}/product.variant.add.json');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/product.variant.add.json' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"attributes": [
{
"attribute_name": "",
"attribute_price": "",
"attribute_value": ""
}
],
"available_for_sale": false,
"available_for_view": false,
"barcode": "",
"clear_cache": false,
"cost_price": "",
"country_of_origin": "",
"created_at": "",
"description": "",
"harmonized_system_code": "",
"height": "",
"lang_id": "",
"length": "",
"manage_stock": false,
"manufacturer": "",
"meta_description": "",
"meta_keywords": "",
"meta_title": "",
"model": "",
"name": "",
"price": "",
"product_id": "",
"quantity": "",
"short_description": "",
"sku": "",
"special_price": "",
"sprice_create": "",
"sprice_expire": "",
"sprice_modified": "",
"store_id": "",
"tax_class_id": 0,
"taxable": false,
"url": "",
"warehouse_id": "",
"weight": "",
"weight_unit": "",
"width": ""
}'
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/product.variant.add.json' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"attributes": [
{
"attribute_name": "",
"attribute_price": "",
"attribute_value": ""
}
],
"available_for_sale": false,
"available_for_view": false,
"barcode": "",
"clear_cache": false,
"cost_price": "",
"country_of_origin": "",
"created_at": "",
"description": "",
"harmonized_system_code": "",
"height": "",
"lang_id": "",
"length": "",
"manage_stock": false,
"manufacturer": "",
"meta_description": "",
"meta_keywords": "",
"meta_title": "",
"model": "",
"name": "",
"price": "",
"product_id": "",
"quantity": "",
"short_description": "",
"sku": "",
"special_price": "",
"sprice_create": "",
"sprice_expire": "",
"sprice_modified": "",
"store_id": "",
"tax_class_id": 0,
"taxable": false,
"url": "",
"warehouse_id": "",
"weight": "",
"weight_unit": "",
"width": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"attributes\": [\n {\n \"attribute_name\": \"\",\n \"attribute_price\": \"\",\n \"attribute_value\": \"\"\n }\n ],\n \"available_for_sale\": false,\n \"available_for_view\": false,\n \"barcode\": \"\",\n \"clear_cache\": false,\n \"cost_price\": \"\",\n \"country_of_origin\": \"\",\n \"created_at\": \"\",\n \"description\": \"\",\n \"harmonized_system_code\": \"\",\n \"height\": \"\",\n \"lang_id\": \"\",\n \"length\": \"\",\n \"manage_stock\": false,\n \"manufacturer\": \"\",\n \"meta_description\": \"\",\n \"meta_keywords\": \"\",\n \"meta_title\": \"\",\n \"model\": \"\",\n \"name\": \"\",\n \"price\": \"\",\n \"product_id\": \"\",\n \"quantity\": \"\",\n \"short_description\": \"\",\n \"sku\": \"\",\n \"special_price\": \"\",\n \"sprice_create\": \"\",\n \"sprice_expire\": \"\",\n \"sprice_modified\": \"\",\n \"store_id\": \"\",\n \"tax_class_id\": 0,\n \"taxable\": false,\n \"url\": \"\",\n \"warehouse_id\": \"\",\n \"weight\": \"\",\n \"weight_unit\": \"\",\n \"width\": \"\"\n}"
headers = {
'x-api-key': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/product.variant.add.json", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/product.variant.add.json"
payload = {
"attributes": [
{
"attribute_name": "",
"attribute_price": "",
"attribute_value": ""
}
],
"available_for_sale": False,
"available_for_view": False,
"barcode": "",
"clear_cache": False,
"cost_price": "",
"country_of_origin": "",
"created_at": "",
"description": "",
"harmonized_system_code": "",
"height": "",
"lang_id": "",
"length": "",
"manage_stock": False,
"manufacturer": "",
"meta_description": "",
"meta_keywords": "",
"meta_title": "",
"model": "",
"name": "",
"price": "",
"product_id": "",
"quantity": "",
"short_description": "",
"sku": "",
"special_price": "",
"sprice_create": "",
"sprice_expire": "",
"sprice_modified": "",
"store_id": "",
"tax_class_id": 0,
"taxable": False,
"url": "",
"warehouse_id": "",
"weight": "",
"weight_unit": "",
"width": ""
}
headers = {
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/product.variant.add.json"
payload <- "{\n \"attributes\": [\n {\n \"attribute_name\": \"\",\n \"attribute_price\": \"\",\n \"attribute_value\": \"\"\n }\n ],\n \"available_for_sale\": false,\n \"available_for_view\": false,\n \"barcode\": \"\",\n \"clear_cache\": false,\n \"cost_price\": \"\",\n \"country_of_origin\": \"\",\n \"created_at\": \"\",\n \"description\": \"\",\n \"harmonized_system_code\": \"\",\n \"height\": \"\",\n \"lang_id\": \"\",\n \"length\": \"\",\n \"manage_stock\": false,\n \"manufacturer\": \"\",\n \"meta_description\": \"\",\n \"meta_keywords\": \"\",\n \"meta_title\": \"\",\n \"model\": \"\",\n \"name\": \"\",\n \"price\": \"\",\n \"product_id\": \"\",\n \"quantity\": \"\",\n \"short_description\": \"\",\n \"sku\": \"\",\n \"special_price\": \"\",\n \"sprice_create\": \"\",\n \"sprice_expire\": \"\",\n \"sprice_modified\": \"\",\n \"store_id\": \"\",\n \"tax_class_id\": 0,\n \"taxable\": false,\n \"url\": \"\",\n \"warehouse_id\": \"\",\n \"weight\": \"\",\n \"weight_unit\": \"\",\n \"width\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/product.variant.add.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"attributes\": [\n {\n \"attribute_name\": \"\",\n \"attribute_price\": \"\",\n \"attribute_value\": \"\"\n }\n ],\n \"available_for_sale\": false,\n \"available_for_view\": false,\n \"barcode\": \"\",\n \"clear_cache\": false,\n \"cost_price\": \"\",\n \"country_of_origin\": \"\",\n \"created_at\": \"\",\n \"description\": \"\",\n \"harmonized_system_code\": \"\",\n \"height\": \"\",\n \"lang_id\": \"\",\n \"length\": \"\",\n \"manage_stock\": false,\n \"manufacturer\": \"\",\n \"meta_description\": \"\",\n \"meta_keywords\": \"\",\n \"meta_title\": \"\",\n \"model\": \"\",\n \"name\": \"\",\n \"price\": \"\",\n \"product_id\": \"\",\n \"quantity\": \"\",\n \"short_description\": \"\",\n \"sku\": \"\",\n \"special_price\": \"\",\n \"sprice_create\": \"\",\n \"sprice_expire\": \"\",\n \"sprice_modified\": \"\",\n \"store_id\": \"\",\n \"tax_class_id\": 0,\n \"taxable\": false,\n \"url\": \"\",\n \"warehouse_id\": \"\",\n \"weight\": \"\",\n \"weight_unit\": \"\",\n \"width\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/product.variant.add.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.body = "{\n \"attributes\": [\n {\n \"attribute_name\": \"\",\n \"attribute_price\": \"\",\n \"attribute_value\": \"\"\n }\n ],\n \"available_for_sale\": false,\n \"available_for_view\": false,\n \"barcode\": \"\",\n \"clear_cache\": false,\n \"cost_price\": \"\",\n \"country_of_origin\": \"\",\n \"created_at\": \"\",\n \"description\": \"\",\n \"harmonized_system_code\": \"\",\n \"height\": \"\",\n \"lang_id\": \"\",\n \"length\": \"\",\n \"manage_stock\": false,\n \"manufacturer\": \"\",\n \"meta_description\": \"\",\n \"meta_keywords\": \"\",\n \"meta_title\": \"\",\n \"model\": \"\",\n \"name\": \"\",\n \"price\": \"\",\n \"product_id\": \"\",\n \"quantity\": \"\",\n \"short_description\": \"\",\n \"sku\": \"\",\n \"special_price\": \"\",\n \"sprice_create\": \"\",\n \"sprice_expire\": \"\",\n \"sprice_modified\": \"\",\n \"store_id\": \"\",\n \"tax_class_id\": 0,\n \"taxable\": false,\n \"url\": \"\",\n \"warehouse_id\": \"\",\n \"weight\": \"\",\n \"weight_unit\": \"\",\n \"width\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/product.variant.add.json";
let payload = json!({
"attributes": (
json!({
"attribute_name": "",
"attribute_price": "",
"attribute_value": ""
})
),
"available_for_sale": false,
"available_for_view": false,
"barcode": "",
"clear_cache": false,
"cost_price": "",
"country_of_origin": "",
"created_at": "",
"description": "",
"harmonized_system_code": "",
"height": "",
"lang_id": "",
"length": "",
"manage_stock": false,
"manufacturer": "",
"meta_description": "",
"meta_keywords": "",
"meta_title": "",
"model": "",
"name": "",
"price": "",
"product_id": "",
"quantity": "",
"short_description": "",
"sku": "",
"special_price": "",
"sprice_create": "",
"sprice_expire": "",
"sprice_modified": "",
"store_id": "",
"tax_class_id": 0,
"taxable": false,
"url": "",
"warehouse_id": "",
"weight": "",
"weight_unit": "",
"width": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/product.variant.add.json \
--header 'content-type: application/json' \
--header 'x-api-key: {{apiKey}}' \
--data '{
"attributes": [
{
"attribute_name": "",
"attribute_price": "",
"attribute_value": ""
}
],
"available_for_sale": false,
"available_for_view": false,
"barcode": "",
"clear_cache": false,
"cost_price": "",
"country_of_origin": "",
"created_at": "",
"description": "",
"harmonized_system_code": "",
"height": "",
"lang_id": "",
"length": "",
"manage_stock": false,
"manufacturer": "",
"meta_description": "",
"meta_keywords": "",
"meta_title": "",
"model": "",
"name": "",
"price": "",
"product_id": "",
"quantity": "",
"short_description": "",
"sku": "",
"special_price": "",
"sprice_create": "",
"sprice_expire": "",
"sprice_modified": "",
"store_id": "",
"tax_class_id": 0,
"taxable": false,
"url": "",
"warehouse_id": "",
"weight": "",
"weight_unit": "",
"width": ""
}'
echo '{
"attributes": [
{
"attribute_name": "",
"attribute_price": "",
"attribute_value": ""
}
],
"available_for_sale": false,
"available_for_view": false,
"barcode": "",
"clear_cache": false,
"cost_price": "",
"country_of_origin": "",
"created_at": "",
"description": "",
"harmonized_system_code": "",
"height": "",
"lang_id": "",
"length": "",
"manage_stock": false,
"manufacturer": "",
"meta_description": "",
"meta_keywords": "",
"meta_title": "",
"model": "",
"name": "",
"price": "",
"product_id": "",
"quantity": "",
"short_description": "",
"sku": "",
"special_price": "",
"sprice_create": "",
"sprice_expire": "",
"sprice_modified": "",
"store_id": "",
"tax_class_id": 0,
"taxable": false,
"url": "",
"warehouse_id": "",
"weight": "",
"weight_unit": "",
"width": ""
}' | \
http POST {{baseUrl}}/product.variant.add.json \
content-type:application/json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "attributes": [\n {\n "attribute_name": "",\n "attribute_price": "",\n "attribute_value": ""\n }\n ],\n "available_for_sale": false,\n "available_for_view": false,\n "barcode": "",\n "clear_cache": false,\n "cost_price": "",\n "country_of_origin": "",\n "created_at": "",\n "description": "",\n "harmonized_system_code": "",\n "height": "",\n "lang_id": "",\n "length": "",\n "manage_stock": false,\n "manufacturer": "",\n "meta_description": "",\n "meta_keywords": "",\n "meta_title": "",\n "model": "",\n "name": "",\n "price": "",\n "product_id": "",\n "quantity": "",\n "short_description": "",\n "sku": "",\n "special_price": "",\n "sprice_create": "",\n "sprice_expire": "",\n "sprice_modified": "",\n "store_id": "",\n "tax_class_id": 0,\n "taxable": false,\n "url": "",\n "warehouse_id": "",\n "weight": "",\n "weight_unit": "",\n "width": ""\n}' \
--output-document \
- {{baseUrl}}/product.variant.add.json
import Foundation
let headers = [
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"attributes": [
[
"attribute_name": "",
"attribute_price": "",
"attribute_value": ""
]
],
"available_for_sale": false,
"available_for_view": false,
"barcode": "",
"clear_cache": false,
"cost_price": "",
"country_of_origin": "",
"created_at": "",
"description": "",
"harmonized_system_code": "",
"height": "",
"lang_id": "",
"length": "",
"manage_stock": false,
"manufacturer": "",
"meta_description": "",
"meta_keywords": "",
"meta_title": "",
"model": "",
"name": "",
"price": "",
"product_id": "",
"quantity": "",
"short_description": "",
"sku": "",
"special_price": "",
"sprice_create": "",
"sprice_expire": "",
"sprice_modified": "",
"store_id": "",
"tax_class_id": 0,
"taxable": false,
"url": "",
"warehouse_id": "",
"weight": "",
"weight_unit": "",
"width": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/product.variant.add.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
ProductVariantCount
{{baseUrl}}/product.variant.count.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
product_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/product.variant.count.json?product_id=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/product.variant.count.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:product_id ""}})
require "http/client"
url = "{{baseUrl}}/product.variant.count.json?product_id="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/product.variant.count.json?product_id="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/product.variant.count.json?product_id=");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/product.variant.count.json?product_id="
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/product.variant.count.json?product_id= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/product.variant.count.json?product_id=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/product.variant.count.json?product_id="))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/product.variant.count.json?product_id=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/product.variant.count.json?product_id=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/product.variant.count.json?product_id=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/product.variant.count.json',
params: {product_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/product.variant.count.json?product_id=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/product.variant.count.json?product_id=',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/product.variant.count.json?product_id=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/product.variant.count.json?product_id=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/product.variant.count.json',
qs: {product_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/product.variant.count.json');
req.query({
product_id: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/product.variant.count.json',
params: {product_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/product.variant.count.json?product_id=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/product.variant.count.json?product_id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/product.variant.count.json?product_id=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/product.variant.count.json?product_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 => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/product.variant.count.json?product_id=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/product.variant.count.json');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'product_id' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/product.variant.count.json');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'product_id' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/product.variant.count.json?product_id=' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/product.variant.count.json?product_id=' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/product.variant.count.json?product_id=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/product.variant.count.json"
querystring = {"product_id":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/product.variant.count.json"
queryString <- list(product_id = "")
response <- VERB("GET", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/product.variant.count.json?product_id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/product.variant.count.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['product_id'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/product.variant.count.json";
let querystring = [
("product_id", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/product.variant.count.json?product_id=' \
--header 'x-api-key: {{apiKey}}'
http GET '{{baseUrl}}/product.variant.count.json?product_id=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/product.variant.count.json?product_id='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/product.variant.count.json?product_id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
DELETE
ProductVariantDelete
{{baseUrl}}/product.variant.delete.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
id
product_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/product.variant.delete.json?id=&product_id=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/product.variant.delete.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:id ""
:product_id ""}})
require "http/client"
url = "{{baseUrl}}/product.variant.delete.json?id=&product_id="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.delete url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/product.variant.delete.json?id=&product_id="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/product.variant.delete.json?id=&product_id=");
var request = new RestRequest("", Method.Delete);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/product.variant.delete.json?id=&product_id="
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/product.variant.delete.json?id=&product_id= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/product.variant.delete.json?id=&product_id=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/product.variant.delete.json?id=&product_id="))
.header("x-api-key", "{{apiKey}}")
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/product.variant.delete.json?id=&product_id=")
.delete(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/product.variant.delete.json?id=&product_id=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/product.variant.delete.json?id=&product_id=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/product.variant.delete.json',
params: {id: '', product_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/product.variant.delete.json?id=&product_id=';
const options = {method: 'DELETE', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/product.variant.delete.json?id=&product_id=',
method: 'DELETE',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/product.variant.delete.json?id=&product_id=")
.delete(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/product.variant.delete.json?id=&product_id=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/product.variant.delete.json',
qs: {id: '', product_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/product.variant.delete.json');
req.query({
id: '',
product_id: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/product.variant.delete.json',
params: {id: '', product_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/product.variant.delete.json?id=&product_id=';
const options = {method: 'DELETE', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/product.variant.delete.json?id=&product_id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/product.variant.delete.json?id=&product_id=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/product.variant.delete.json?id=&product_id=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/product.variant.delete.json?id=&product_id=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/product.variant.delete.json');
$request->setMethod(HTTP_METH_DELETE);
$request->setQueryData([
'id' => '',
'product_id' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/product.variant.delete.json');
$request->setRequestMethod('DELETE');
$request->setQuery(new http\QueryString([
'id' => '',
'product_id' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/product.variant.delete.json?id=&product_id=' -Method DELETE -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/product.variant.delete.json?id=&product_id=' -Method DELETE -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("DELETE", "/baseUrl/product.variant.delete.json?id=&product_id=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/product.variant.delete.json"
querystring = {"id":"","product_id":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.delete(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/product.variant.delete.json"
queryString <- list(
id = "",
product_id = ""
)
response <- VERB("DELETE", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/product.variant.delete.json?id=&product_id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/product.variant.delete.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['id'] = ''
req.params['product_id'] = ''
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/product.variant.delete.json";
let querystring = [
("id", ""),
("product_id", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url '{{baseUrl}}/product.variant.delete.json?id=&product_id=' \
--header 'x-api-key: {{apiKey}}'
http DELETE '{{baseUrl}}/product.variant.delete.json?id=&product_id=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method DELETE \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/product.variant.delete.json?id=&product_id='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/product.variant.delete.json?id=&product_id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
ProductVariantImageAdd
{{baseUrl}}/product.variant.image.add.json
HEADERS
x-api-key
{{apiKey}}
BODY json
{
"content": "",
"image_name": "",
"label": "",
"mime": "",
"option_id": "",
"position": 0,
"product_id": "",
"product_variant_id": 0,
"store_id": "",
"type": "",
"url": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/product.variant.image.add.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"content\": \"\",\n \"image_name\": \"\",\n \"label\": \"\",\n \"mime\": \"\",\n \"option_id\": \"\",\n \"position\": 0,\n \"product_id\": \"\",\n \"product_variant_id\": 0,\n \"store_id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/product.variant.image.add.json" {:headers {:x-api-key "{{apiKey}}"}
:content-type :json
:form-params {:content ""
:image_name ""
:label ""
:mime ""
:option_id ""
:position 0
:product_id ""
:product_variant_id 0
:store_id ""
:type ""
:url ""}})
require "http/client"
url = "{{baseUrl}}/product.variant.image.add.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"content\": \"\",\n \"image_name\": \"\",\n \"label\": \"\",\n \"mime\": \"\",\n \"option_id\": \"\",\n \"position\": 0,\n \"product_id\": \"\",\n \"product_variant_id\": 0,\n \"store_id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/product.variant.image.add.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
Content = new StringContent("{\n \"content\": \"\",\n \"image_name\": \"\",\n \"label\": \"\",\n \"mime\": \"\",\n \"option_id\": \"\",\n \"position\": 0,\n \"product_id\": \"\",\n \"product_variant_id\": 0,\n \"store_id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/product.variant.image.add.json");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"content\": \"\",\n \"image_name\": \"\",\n \"label\": \"\",\n \"mime\": \"\",\n \"option_id\": \"\",\n \"position\": 0,\n \"product_id\": \"\",\n \"product_variant_id\": 0,\n \"store_id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/product.variant.image.add.json"
payload := strings.NewReader("{\n \"content\": \"\",\n \"image_name\": \"\",\n \"label\": \"\",\n \"mime\": \"\",\n \"option_id\": \"\",\n \"position\": 0,\n \"product_id\": \"\",\n \"product_variant_id\": 0,\n \"store_id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/product.variant.image.add.json HTTP/1.1
X-Api-Key: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 196
{
"content": "",
"image_name": "",
"label": "",
"mime": "",
"option_id": "",
"position": 0,
"product_id": "",
"product_variant_id": 0,
"store_id": "",
"type": "",
"url": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/product.variant.image.add.json")
.setHeader("x-api-key", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"content\": \"\",\n \"image_name\": \"\",\n \"label\": \"\",\n \"mime\": \"\",\n \"option_id\": \"\",\n \"position\": 0,\n \"product_id\": \"\",\n \"product_variant_id\": 0,\n \"store_id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/product.variant.image.add.json"))
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"content\": \"\",\n \"image_name\": \"\",\n \"label\": \"\",\n \"mime\": \"\",\n \"option_id\": \"\",\n \"position\": 0,\n \"product_id\": \"\",\n \"product_variant_id\": 0,\n \"store_id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"content\": \"\",\n \"image_name\": \"\",\n \"label\": \"\",\n \"mime\": \"\",\n \"option_id\": \"\",\n \"position\": 0,\n \"product_id\": \"\",\n \"product_variant_id\": 0,\n \"store_id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/product.variant.image.add.json")
.post(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/product.variant.image.add.json")
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"content\": \"\",\n \"image_name\": \"\",\n \"label\": \"\",\n \"mime\": \"\",\n \"option_id\": \"\",\n \"position\": 0,\n \"product_id\": \"\",\n \"product_variant_id\": 0,\n \"store_id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n}")
.asString();
const data = JSON.stringify({
content: '',
image_name: '',
label: '',
mime: '',
option_id: '',
position: 0,
product_id: '',
product_variant_id: 0,
store_id: '',
type: '',
url: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/product.variant.image.add.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/product.variant.image.add.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {
content: '',
image_name: '',
label: '',
mime: '',
option_id: '',
position: 0,
product_id: '',
product_variant_id: 0,
store_id: '',
type: '',
url: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/product.variant.image.add.json';
const options = {
method: 'POST',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"content":"","image_name":"","label":"","mime":"","option_id":"","position":0,"product_id":"","product_variant_id":0,"store_id":"","type":"","url":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/product.variant.image.add.json',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "content": "",\n "image_name": "",\n "label": "",\n "mime": "",\n "option_id": "",\n "position": 0,\n "product_id": "",\n "product_variant_id": 0,\n "store_id": "",\n "type": "",\n "url": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"content\": \"\",\n \"image_name\": \"\",\n \"label\": \"\",\n \"mime\": \"\",\n \"option_id\": \"\",\n \"position\": 0,\n \"product_id\": \"\",\n \"product_variant_id\": 0,\n \"store_id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/product.variant.image.add.json")
.post(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/product.variant.image.add.json',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
content: '',
image_name: '',
label: '',
mime: '',
option_id: '',
position: 0,
product_id: '',
product_variant_id: 0,
store_id: '',
type: '',
url: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/product.variant.image.add.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: {
content: '',
image_name: '',
label: '',
mime: '',
option_id: '',
position: 0,
product_id: '',
product_variant_id: 0,
store_id: '',
type: '',
url: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/product.variant.image.add.json');
req.headers({
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
content: '',
image_name: '',
label: '',
mime: '',
option_id: '',
position: 0,
product_id: '',
product_variant_id: 0,
store_id: '',
type: '',
url: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/product.variant.image.add.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {
content: '',
image_name: '',
label: '',
mime: '',
option_id: '',
position: 0,
product_id: '',
product_variant_id: 0,
store_id: '',
type: '',
url: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/product.variant.image.add.json';
const options = {
method: 'POST',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"content":"","image_name":"","label":"","mime":"","option_id":"","position":0,"product_id":"","product_variant_id":0,"store_id":"","type":"","url":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"content": @"",
@"image_name": @"",
@"label": @"",
@"mime": @"",
@"option_id": @"",
@"position": @0,
@"product_id": @"",
@"product_variant_id": @0,
@"store_id": @"",
@"type": @"",
@"url": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/product.variant.image.add.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/product.variant.image.add.json" in
let headers = Header.add_list (Header.init ()) [
("x-api-key", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"content\": \"\",\n \"image_name\": \"\",\n \"label\": \"\",\n \"mime\": \"\",\n \"option_id\": \"\",\n \"position\": 0,\n \"product_id\": \"\",\n \"product_variant_id\": 0,\n \"store_id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/product.variant.image.add.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'content' => '',
'image_name' => '',
'label' => '',
'mime' => '',
'option_id' => '',
'position' => 0,
'product_id' => '',
'product_variant_id' => 0,
'store_id' => '',
'type' => '',
'url' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/product.variant.image.add.json', [
'body' => '{
"content": "",
"image_name": "",
"label": "",
"mime": "",
"option_id": "",
"position": 0,
"product_id": "",
"product_variant_id": 0,
"store_id": "",
"type": "",
"url": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/product.variant.image.add.json');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'content' => '',
'image_name' => '',
'label' => '',
'mime' => '',
'option_id' => '',
'position' => 0,
'product_id' => '',
'product_variant_id' => 0,
'store_id' => '',
'type' => '',
'url' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'content' => '',
'image_name' => '',
'label' => '',
'mime' => '',
'option_id' => '',
'position' => 0,
'product_id' => '',
'product_variant_id' => 0,
'store_id' => '',
'type' => '',
'url' => ''
]));
$request->setRequestUrl('{{baseUrl}}/product.variant.image.add.json');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/product.variant.image.add.json' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"content": "",
"image_name": "",
"label": "",
"mime": "",
"option_id": "",
"position": 0,
"product_id": "",
"product_variant_id": 0,
"store_id": "",
"type": "",
"url": ""
}'
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/product.variant.image.add.json' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"content": "",
"image_name": "",
"label": "",
"mime": "",
"option_id": "",
"position": 0,
"product_id": "",
"product_variant_id": 0,
"store_id": "",
"type": "",
"url": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"content\": \"\",\n \"image_name\": \"\",\n \"label\": \"\",\n \"mime\": \"\",\n \"option_id\": \"\",\n \"position\": 0,\n \"product_id\": \"\",\n \"product_variant_id\": 0,\n \"store_id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n}"
headers = {
'x-api-key': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/product.variant.image.add.json", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/product.variant.image.add.json"
payload = {
"content": "",
"image_name": "",
"label": "",
"mime": "",
"option_id": "",
"position": 0,
"product_id": "",
"product_variant_id": 0,
"store_id": "",
"type": "",
"url": ""
}
headers = {
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/product.variant.image.add.json"
payload <- "{\n \"content\": \"\",\n \"image_name\": \"\",\n \"label\": \"\",\n \"mime\": \"\",\n \"option_id\": \"\",\n \"position\": 0,\n \"product_id\": \"\",\n \"product_variant_id\": 0,\n \"store_id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/product.variant.image.add.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"content\": \"\",\n \"image_name\": \"\",\n \"label\": \"\",\n \"mime\": \"\",\n \"option_id\": \"\",\n \"position\": 0,\n \"product_id\": \"\",\n \"product_variant_id\": 0,\n \"store_id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/product.variant.image.add.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.body = "{\n \"content\": \"\",\n \"image_name\": \"\",\n \"label\": \"\",\n \"mime\": \"\",\n \"option_id\": \"\",\n \"position\": 0,\n \"product_id\": \"\",\n \"product_variant_id\": 0,\n \"store_id\": \"\",\n \"type\": \"\",\n \"url\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/product.variant.image.add.json";
let payload = json!({
"content": "",
"image_name": "",
"label": "",
"mime": "",
"option_id": "",
"position": 0,
"product_id": "",
"product_variant_id": 0,
"store_id": "",
"type": "",
"url": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/product.variant.image.add.json \
--header 'content-type: application/json' \
--header 'x-api-key: {{apiKey}}' \
--data '{
"content": "",
"image_name": "",
"label": "",
"mime": "",
"option_id": "",
"position": 0,
"product_id": "",
"product_variant_id": 0,
"store_id": "",
"type": "",
"url": ""
}'
echo '{
"content": "",
"image_name": "",
"label": "",
"mime": "",
"option_id": "",
"position": 0,
"product_id": "",
"product_variant_id": 0,
"store_id": "",
"type": "",
"url": ""
}' | \
http POST {{baseUrl}}/product.variant.image.add.json \
content-type:application/json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "content": "",\n "image_name": "",\n "label": "",\n "mime": "",\n "option_id": "",\n "position": 0,\n "product_id": "",\n "product_variant_id": 0,\n "store_id": "",\n "type": "",\n "url": ""\n}' \
--output-document \
- {{baseUrl}}/product.variant.image.add.json
import Foundation
let headers = [
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"content": "",
"image_name": "",
"label": "",
"mime": "",
"option_id": "",
"position": 0,
"product_id": "",
"product_variant_id": 0,
"store_id": "",
"type": "",
"url": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/product.variant.image.add.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
DELETE
ProductVariantImageDelete
{{baseUrl}}/product.variant.image.delete.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
product_id
product_variant_id
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/product.variant.image.delete.json?product_id=&product_variant_id=&id=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/product.variant.image.delete.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:product_id ""
:product_variant_id ""
:id ""}})
require "http/client"
url = "{{baseUrl}}/product.variant.image.delete.json?product_id=&product_variant_id=&id="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.delete url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/product.variant.image.delete.json?product_id=&product_variant_id=&id="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/product.variant.image.delete.json?product_id=&product_variant_id=&id=");
var request = new RestRequest("", Method.Delete);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/product.variant.image.delete.json?product_id=&product_variant_id=&id="
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/product.variant.image.delete.json?product_id=&product_variant_id=&id= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/product.variant.image.delete.json?product_id=&product_variant_id=&id=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/product.variant.image.delete.json?product_id=&product_variant_id=&id="))
.header("x-api-key", "{{apiKey}}")
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/product.variant.image.delete.json?product_id=&product_variant_id=&id=")
.delete(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/product.variant.image.delete.json?product_id=&product_variant_id=&id=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/product.variant.image.delete.json?product_id=&product_variant_id=&id=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/product.variant.image.delete.json',
params: {product_id: '', product_variant_id: '', id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/product.variant.image.delete.json?product_id=&product_variant_id=&id=';
const options = {method: 'DELETE', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/product.variant.image.delete.json?product_id=&product_variant_id=&id=',
method: 'DELETE',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/product.variant.image.delete.json?product_id=&product_variant_id=&id=")
.delete(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/product.variant.image.delete.json?product_id=&product_variant_id=&id=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/product.variant.image.delete.json',
qs: {product_id: '', product_variant_id: '', id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/product.variant.image.delete.json');
req.query({
product_id: '',
product_variant_id: '',
id: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/product.variant.image.delete.json',
params: {product_id: '', product_variant_id: '', id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/product.variant.image.delete.json?product_id=&product_variant_id=&id=';
const options = {method: 'DELETE', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/product.variant.image.delete.json?product_id=&product_variant_id=&id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/product.variant.image.delete.json?product_id=&product_variant_id=&id=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/product.variant.image.delete.json?product_id=&product_variant_id=&id=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/product.variant.image.delete.json?product_id=&product_variant_id=&id=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/product.variant.image.delete.json');
$request->setMethod(HTTP_METH_DELETE);
$request->setQueryData([
'product_id' => '',
'product_variant_id' => '',
'id' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/product.variant.image.delete.json');
$request->setRequestMethod('DELETE');
$request->setQuery(new http\QueryString([
'product_id' => '',
'product_variant_id' => '',
'id' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/product.variant.image.delete.json?product_id=&product_variant_id=&id=' -Method DELETE -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/product.variant.image.delete.json?product_id=&product_variant_id=&id=' -Method DELETE -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("DELETE", "/baseUrl/product.variant.image.delete.json?product_id=&product_variant_id=&id=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/product.variant.image.delete.json"
querystring = {"product_id":"","product_variant_id":"","id":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.delete(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/product.variant.image.delete.json"
queryString <- list(
product_id = "",
product_variant_id = "",
id = ""
)
response <- VERB("DELETE", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/product.variant.image.delete.json?product_id=&product_variant_id=&id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/product.variant.image.delete.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['product_id'] = ''
req.params['product_variant_id'] = ''
req.params['id'] = ''
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/product.variant.image.delete.json";
let querystring = [
("product_id", ""),
("product_variant_id", ""),
("id", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url '{{baseUrl}}/product.variant.image.delete.json?product_id=&product_variant_id=&id=' \
--header 'x-api-key: {{apiKey}}'
http DELETE '{{baseUrl}}/product.variant.image.delete.json?product_id=&product_variant_id=&id=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method DELETE \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/product.variant.image.delete.json?product_id=&product_variant_id=&id='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/product.variant.image.delete.json?product_id=&product_variant_id=&id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
ProductVariantInfo
{{baseUrl}}/product.variant.info.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/product.variant.info.json?id=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/product.variant.info.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:id ""}})
require "http/client"
url = "{{baseUrl}}/product.variant.info.json?id="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/product.variant.info.json?id="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/product.variant.info.json?id=");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/product.variant.info.json?id="
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/product.variant.info.json?id= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/product.variant.info.json?id=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/product.variant.info.json?id="))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/product.variant.info.json?id=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/product.variant.info.json?id=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/product.variant.info.json?id=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/product.variant.info.json',
params: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/product.variant.info.json?id=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/product.variant.info.json?id=',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/product.variant.info.json?id=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/product.variant.info.json?id=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/product.variant.info.json',
qs: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/product.variant.info.json');
req.query({
id: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/product.variant.info.json',
params: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/product.variant.info.json?id=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/product.variant.info.json?id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/product.variant.info.json?id=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/product.variant.info.json?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 => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/product.variant.info.json?id=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/product.variant.info.json');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'id' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/product.variant.info.json');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'id' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/product.variant.info.json?id=' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/product.variant.info.json?id=' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/product.variant.info.json?id=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/product.variant.info.json"
querystring = {"id":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/product.variant.info.json"
queryString <- list(id = "")
response <- VERB("GET", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/product.variant.info.json?id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/product.variant.info.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['id'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/product.variant.info.json";
let querystring = [
("id", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/product.variant.info.json?id=' \
--header 'x-api-key: {{apiKey}}'
http GET '{{baseUrl}}/product.variant.info.json?id=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/product.variant.info.json?id='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/product.variant.info.json?id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
ProductVariantList
{{baseUrl}}/product.variant.list.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/product.variant.list.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/product.variant.list.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/product.variant.list.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/product.variant.list.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/product.variant.list.json");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/product.variant.list.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/product.variant.list.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/product.variant.list.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/product.variant.list.json"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/product.variant.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/product.variant.list.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/product.variant.list.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/product.variant.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/product.variant.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/product.variant.list.json',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/product.variant.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/product.variant.list.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/product.variant.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/product.variant.list.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/product.variant.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/product.variant.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/product.variant.list.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/product.variant.list.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/product.variant.list.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/product.variant.list.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/product.variant.list.json');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/product.variant.list.json');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/product.variant.list.json' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/product.variant.list.json' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/product.variant.list.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/product.variant.list.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/product.variant.list.json"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/product.variant.list.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/product.variant.list.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/product.variant.list.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/product.variant.list.json \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/product.variant.list.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/product.variant.list.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/product.variant.list.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
ProductVariantPriceAdd
{{baseUrl}}/product.variant.price.add.json
HEADERS
x-api-key
{{apiKey}}
BODY json
{
"group_prices": [
{
"group_id": "",
"price": ""
}
],
"id": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/product.variant.price.add.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"price\": \"\"\n }\n ],\n \"id\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/product.variant.price.add.json" {:headers {:x-api-key "{{apiKey}}"}
:content-type :json
:form-params {:group_prices [{:group_id ""
:price ""}]
:id ""}})
require "http/client"
url = "{{baseUrl}}/product.variant.price.add.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"price\": \"\"\n }\n ],\n \"id\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/product.variant.price.add.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
Content = new StringContent("{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"price\": \"\"\n }\n ],\n \"id\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/product.variant.price.add.json");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"price\": \"\"\n }\n ],\n \"id\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/product.variant.price.add.json"
payload := strings.NewReader("{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"price\": \"\"\n }\n ],\n \"id\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/product.variant.price.add.json HTTP/1.1
X-Api-Key: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 91
{
"group_prices": [
{
"group_id": "",
"price": ""
}
],
"id": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/product.variant.price.add.json")
.setHeader("x-api-key", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"price\": \"\"\n }\n ],\n \"id\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/product.variant.price.add.json"))
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"price\": \"\"\n }\n ],\n \"id\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"price\": \"\"\n }\n ],\n \"id\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/product.variant.price.add.json")
.post(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/product.variant.price.add.json")
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"price\": \"\"\n }\n ],\n \"id\": \"\"\n}")
.asString();
const data = JSON.stringify({
group_prices: [
{
group_id: '',
price: ''
}
],
id: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/product.variant.price.add.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/product.variant.price.add.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {group_prices: [{group_id: '', price: ''}], id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/product.variant.price.add.json';
const options = {
method: 'POST',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"group_prices":[{"group_id":"","price":""}],"id":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/product.variant.price.add.json',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "group_prices": [\n {\n "group_id": "",\n "price": ""\n }\n ],\n "id": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"price\": \"\"\n }\n ],\n \"id\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/product.variant.price.add.json")
.post(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/product.variant.price.add.json',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({group_prices: [{group_id: '', price: ''}], id: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/product.variant.price.add.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: {group_prices: [{group_id: '', price: ''}], id: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/product.variant.price.add.json');
req.headers({
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
group_prices: [
{
group_id: '',
price: ''
}
],
id: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/product.variant.price.add.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {group_prices: [{group_id: '', price: ''}], id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/product.variant.price.add.json';
const options = {
method: 'POST',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"group_prices":[{"group_id":"","price":""}],"id":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"group_prices": @[ @{ @"group_id": @"", @"price": @"" } ],
@"id": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/product.variant.price.add.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/product.variant.price.add.json" in
let headers = Header.add_list (Header.init ()) [
("x-api-key", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"price\": \"\"\n }\n ],\n \"id\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/product.variant.price.add.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'group_prices' => [
[
'group_id' => '',
'price' => ''
]
],
'id' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/product.variant.price.add.json', [
'body' => '{
"group_prices": [
{
"group_id": "",
"price": ""
}
],
"id": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/product.variant.price.add.json');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'group_prices' => [
[
'group_id' => '',
'price' => ''
]
],
'id' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'group_prices' => [
[
'group_id' => '',
'price' => ''
]
],
'id' => ''
]));
$request->setRequestUrl('{{baseUrl}}/product.variant.price.add.json');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/product.variant.price.add.json' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"group_prices": [
{
"group_id": "",
"price": ""
}
],
"id": ""
}'
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/product.variant.price.add.json' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"group_prices": [
{
"group_id": "",
"price": ""
}
],
"id": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"price\": \"\"\n }\n ],\n \"id\": \"\"\n}"
headers = {
'x-api-key': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("POST", "/baseUrl/product.variant.price.add.json", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/product.variant.price.add.json"
payload = {
"group_prices": [
{
"group_id": "",
"price": ""
}
],
"id": ""
}
headers = {
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/product.variant.price.add.json"
payload <- "{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"price\": \"\"\n }\n ],\n \"id\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/product.variant.price.add.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"price\": \"\"\n }\n ],\n \"id\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/product.variant.price.add.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.body = "{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"price\": \"\"\n }\n ],\n \"id\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/product.variant.price.add.json";
let payload = json!({
"group_prices": (
json!({
"group_id": "",
"price": ""
})
),
"id": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/product.variant.price.add.json \
--header 'content-type: application/json' \
--header 'x-api-key: {{apiKey}}' \
--data '{
"group_prices": [
{
"group_id": "",
"price": ""
}
],
"id": ""
}'
echo '{
"group_prices": [
{
"group_id": "",
"price": ""
}
],
"id": ""
}' | \
http POST {{baseUrl}}/product.variant.price.add.json \
content-type:application/json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "group_prices": [\n {\n "group_id": "",\n "price": ""\n }\n ],\n "id": ""\n}' \
--output-document \
- {{baseUrl}}/product.variant.price.add.json
import Foundation
let headers = [
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"group_prices": [
[
"group_id": "",
"price": ""
]
],
"id": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/product.variant.price.add.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
DELETE
ProductVariantPriceDelete
{{baseUrl}}/product.variant.price.delete.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/product.variant.price.delete.json?id=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/product.variant.price.delete.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:id ""}})
require "http/client"
url = "{{baseUrl}}/product.variant.price.delete.json?id="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.delete url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/product.variant.price.delete.json?id="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/product.variant.price.delete.json?id=");
var request = new RestRequest("", Method.Delete);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/product.variant.price.delete.json?id="
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/product.variant.price.delete.json?id= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/product.variant.price.delete.json?id=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/product.variant.price.delete.json?id="))
.header("x-api-key", "{{apiKey}}")
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/product.variant.price.delete.json?id=")
.delete(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/product.variant.price.delete.json?id=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/product.variant.price.delete.json?id=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/product.variant.price.delete.json',
params: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/product.variant.price.delete.json?id=';
const options = {method: 'DELETE', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/product.variant.price.delete.json?id=',
method: 'DELETE',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/product.variant.price.delete.json?id=")
.delete(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/product.variant.price.delete.json?id=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/product.variant.price.delete.json',
qs: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/product.variant.price.delete.json');
req.query({
id: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/product.variant.price.delete.json',
params: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/product.variant.price.delete.json?id=';
const options = {method: 'DELETE', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/product.variant.price.delete.json?id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/product.variant.price.delete.json?id=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/product.variant.price.delete.json?id=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/product.variant.price.delete.json?id=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/product.variant.price.delete.json');
$request->setMethod(HTTP_METH_DELETE);
$request->setQueryData([
'id' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/product.variant.price.delete.json');
$request->setRequestMethod('DELETE');
$request->setQuery(new http\QueryString([
'id' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/product.variant.price.delete.json?id=' -Method DELETE -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/product.variant.price.delete.json?id=' -Method DELETE -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("DELETE", "/baseUrl/product.variant.price.delete.json?id=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/product.variant.price.delete.json"
querystring = {"id":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.delete(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/product.variant.price.delete.json"
queryString <- list(id = "")
response <- VERB("DELETE", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/product.variant.price.delete.json?id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/product.variant.price.delete.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['id'] = ''
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/product.variant.price.delete.json";
let querystring = [
("id", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url '{{baseUrl}}/product.variant.price.delete.json?id=' \
--header 'x-api-key: {{apiKey}}'
http DELETE '{{baseUrl}}/product.variant.price.delete.json?id=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method DELETE \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/product.variant.price.delete.json?id='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/product.variant.price.delete.json?id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PUT
ProductVariantPriceUpdate
{{baseUrl}}/product.variant.price.update.json
HEADERS
x-api-key
{{apiKey}}
BODY json
{
"group_prices": [
{
"group_id": "",
"id": 0,
"price": ""
}
],
"id": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/product.variant.price.update.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"id\": 0,\n \"price\": \"\"\n }\n ],\n \"id\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/product.variant.price.update.json" {:headers {:x-api-key "{{apiKey}}"}
:content-type :json
:form-params {:group_prices [{:group_id ""
:id 0
:price ""}]
:id ""}})
require "http/client"
url = "{{baseUrl}}/product.variant.price.update.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
"content-type" => "application/json"
}
reqBody = "{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"id\": 0,\n \"price\": \"\"\n }\n ],\n \"id\": \"\"\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/product.variant.price.update.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
Content = new StringContent("{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"id\": 0,\n \"price\": \"\"\n }\n ],\n \"id\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/product.variant.price.update.json");
var request = new RestRequest("", Method.Put);
request.AddHeader("x-api-key", "{{apiKey}}");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"id\": 0,\n \"price\": \"\"\n }\n ],\n \"id\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/product.variant.price.update.json"
payload := strings.NewReader("{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"id\": 0,\n \"price\": \"\"\n }\n ],\n \"id\": \"\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "{{apiKey}}")
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/product.variant.price.update.json HTTP/1.1
X-Api-Key: {{apiKey}}
Content-Type: application/json
Host: example.com
Content-Length: 106
{
"group_prices": [
{
"group_id": "",
"id": 0,
"price": ""
}
],
"id": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/product.variant.price.update.json")
.setHeader("x-api-key", "{{apiKey}}")
.setHeader("content-type", "application/json")
.setBody("{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"id\": 0,\n \"price\": \"\"\n }\n ],\n \"id\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/product.variant.price.update.json"))
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"id\": 0,\n \"price\": \"\"\n }\n ],\n \"id\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"id\": 0,\n \"price\": \"\"\n }\n ],\n \"id\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/product.variant.price.update.json")
.put(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/product.variant.price.update.json")
.header("x-api-key", "{{apiKey}}")
.header("content-type", "application/json")
.body("{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"id\": 0,\n \"price\": \"\"\n }\n ],\n \"id\": \"\"\n}")
.asString();
const data = JSON.stringify({
group_prices: [
{
group_id: '',
id: 0,
price: ''
}
],
id: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/product.variant.price.update.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/product.variant.price.update.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {group_prices: [{group_id: '', id: 0, price: ''}], id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/product.variant.price.update.json';
const options = {
method: 'PUT',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"group_prices":[{"group_id":"","id":0,"price":""}],"id":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/product.variant.price.update.json',
method: 'PUT',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
},
processData: false,
data: '{\n "group_prices": [\n {\n "group_id": "",\n "id": 0,\n "price": ""\n }\n ],\n "id": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"id\": 0,\n \"price\": \"\"\n }\n ],\n \"id\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/product.variant.price.update.json")
.put(body)
.addHeader("x-api-key", "{{apiKey}}")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/product.variant.price.update.json',
headers: {
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({group_prices: [{group_id: '', id: 0, price: ''}], id: ''}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/product.variant.price.update.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: {group_prices: [{group_id: '', id: 0, price: ''}], id: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/product.variant.price.update.json');
req.headers({
'x-api-key': '{{apiKey}}',
'content-type': 'application/json'
});
req.type('json');
req.send({
group_prices: [
{
group_id: '',
id: 0,
price: ''
}
],
id: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/product.variant.price.update.json',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
data: {group_prices: [{group_id: '', id: 0, price: ''}], id: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/product.variant.price.update.json';
const options = {
method: 'PUT',
headers: {'x-api-key': '{{apiKey}}', 'content-type': 'application/json'},
body: '{"group_prices":[{"group_id":"","id":0,"price":""}],"id":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}",
@"content-type": @"application/json" };
NSDictionary *parameters = @{ @"group_prices": @[ @{ @"group_id": @"", @"id": @0, @"price": @"" } ],
@"id": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/product.variant.price.update.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/product.variant.price.update.json" in
let headers = Header.add_list (Header.init ()) [
("x-api-key", "{{apiKey}}");
("content-type", "application/json");
] in
let body = Cohttp_lwt_body.of_string "{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"id\": 0,\n \"price\": \"\"\n }\n ],\n \"id\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/product.variant.price.update.json",
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([
'group_prices' => [
[
'group_id' => '',
'id' => 0,
'price' => ''
]
],
'id' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json",
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/product.variant.price.update.json', [
'body' => '{
"group_prices": [
{
"group_id": "",
"id": 0,
"price": ""
}
],
"id": ""
}',
'headers' => [
'content-type' => 'application/json',
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/product.variant.price.update.json');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'group_prices' => [
[
'group_id' => '',
'id' => 0,
'price' => ''
]
],
'id' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'group_prices' => [
[
'group_id' => '',
'id' => 0,
'price' => ''
]
],
'id' => ''
]));
$request->setRequestUrl('{{baseUrl}}/product.variant.price.update.json');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'x-api-key' => '{{apiKey}}',
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/product.variant.price.update.json' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"group_prices": [
{
"group_id": "",
"id": 0,
"price": ""
}
],
"id": ""
}'
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/product.variant.price.update.json' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"group_prices": [
{
"group_id": "",
"id": 0,
"price": ""
}
],
"id": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"id\": 0,\n \"price\": \"\"\n }\n ],\n \"id\": \"\"\n}"
headers = {
'x-api-key': "{{apiKey}}",
'content-type': "application/json"
}
conn.request("PUT", "/baseUrl/product.variant.price.update.json", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/product.variant.price.update.json"
payload = {
"group_prices": [
{
"group_id": "",
"id": 0,
"price": ""
}
],
"id": ""
}
headers = {
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/product.variant.price.update.json"
payload <- "{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"id\": 0,\n \"price\": \"\"\n }\n ],\n \"id\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/product.variant.price.update.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '{{apiKey}}'
request["content-type"] = 'application/json'
request.body = "{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"id\": 0,\n \"price\": \"\"\n }\n ],\n \"id\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/product.variant.price.update.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.body = "{\n \"group_prices\": [\n {\n \"group_id\": \"\",\n \"id\": 0,\n \"price\": \"\"\n }\n ],\n \"id\": \"\"\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/product.variant.price.update.json";
let payload = json!({
"group_prices": (
json!({
"group_id": "",
"id": 0,
"price": ""
})
),
"id": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/product.variant.price.update.json \
--header 'content-type: application/json' \
--header 'x-api-key: {{apiKey}}' \
--data '{
"group_prices": [
{
"group_id": "",
"id": 0,
"price": ""
}
],
"id": ""
}'
echo '{
"group_prices": [
{
"group_id": "",
"id": 0,
"price": ""
}
],
"id": ""
}' | \
http PUT {{baseUrl}}/product.variant.price.update.json \
content-type:application/json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method PUT \
--header 'x-api-key: {{apiKey}}' \
--header 'content-type: application/json' \
--body-data '{\n "group_prices": [\n {\n "group_id": "",\n "id": 0,\n "price": ""\n }\n ],\n "id": ""\n}' \
--output-document \
- {{baseUrl}}/product.variant.price.update.json
import Foundation
let headers = [
"x-api-key": "{{apiKey}}",
"content-type": "application/json"
]
let parameters = [
"group_prices": [
[
"group_id": "",
"id": 0,
"price": ""
]
],
"id": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/product.variant.price.update.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PUT
ProductVariantUpdate
{{baseUrl}}/product.variant.update.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
id
product_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/product.variant.update.json?id=&product_id=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/product.variant.update.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:id ""
:product_id ""}})
require "http/client"
url = "{{baseUrl}}/product.variant.update.json?id=&product_id="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.put url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/product.variant.update.json?id=&product_id="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/product.variant.update.json?id=&product_id=");
var request = new RestRequest("", Method.Put);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/product.variant.update.json?id=&product_id="
req, _ := http.NewRequest("PUT", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/product.variant.update.json?id=&product_id= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/product.variant.update.json?id=&product_id=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/product.variant.update.json?id=&product_id="))
.header("x-api-key", "{{apiKey}}")
.method("PUT", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/product.variant.update.json?id=&product_id=")
.put(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/product.variant.update.json?id=&product_id=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/product.variant.update.json?id=&product_id=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/product.variant.update.json',
params: {id: '', product_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/product.variant.update.json?id=&product_id=';
const options = {method: 'PUT', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/product.variant.update.json?id=&product_id=',
method: 'PUT',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/product.variant.update.json?id=&product_id=")
.put(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/product.variant.update.json?id=&product_id=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/product.variant.update.json',
qs: {id: '', product_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/product.variant.update.json');
req.query({
id: '',
product_id: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/product.variant.update.json',
params: {id: '', product_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/product.variant.update.json?id=&product_id=';
const options = {method: 'PUT', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/product.variant.update.json?id=&product_id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/product.variant.update.json?id=&product_id=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/product.variant.update.json?id=&product_id=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/product.variant.update.json?id=&product_id=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/product.variant.update.json');
$request->setMethod(HTTP_METH_PUT);
$request->setQueryData([
'id' => '',
'product_id' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/product.variant.update.json');
$request->setRequestMethod('PUT');
$request->setQuery(new http\QueryString([
'id' => '',
'product_id' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/product.variant.update.json?id=&product_id=' -Method PUT -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/product.variant.update.json?id=&product_id=' -Method PUT -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("PUT", "/baseUrl/product.variant.update.json?id=&product_id=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/product.variant.update.json"
querystring = {"id":"","product_id":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.put(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/product.variant.update.json"
queryString <- list(
id = "",
product_id = ""
)
response <- VERB("PUT", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/product.variant.update.json?id=&product_id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.put('/baseUrl/product.variant.update.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['id'] = ''
req.params['product_id'] = ''
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/product.variant.update.json";
let querystring = [
("id", ""),
("product_id", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url '{{baseUrl}}/product.variant.update.json?id=&product_id=' \
--header 'x-api-key: {{apiKey}}'
http PUT '{{baseUrl}}/product.variant.update.json?id=&product_id=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method PUT \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/product.variant.update.json?id=&product_id='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/product.variant.update.json?id=&product_id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
SubscriberList
{{baseUrl}}/subscriber.list.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/subscriber.list.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/subscriber.list.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/subscriber.list.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/subscriber.list.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/subscriber.list.json");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/subscriber.list.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/subscriber.list.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/subscriber.list.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/subscriber.list.json"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/subscriber.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/subscriber.list.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/subscriber.list.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/subscriber.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/subscriber.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/subscriber.list.json',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/subscriber.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/subscriber.list.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/subscriber.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/subscriber.list.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/subscriber.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/subscriber.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/subscriber.list.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/subscriber.list.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/subscriber.list.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/subscriber.list.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/subscriber.list.json');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/subscriber.list.json');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/subscriber.list.json' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/subscriber.list.json' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/subscriber.list.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/subscriber.list.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/subscriber.list.json"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/subscriber.list.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/subscriber.list.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/subscriber.list.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/subscriber.list.json \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/subscriber.list.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/subscriber.list.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/subscriber.list.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
TaxClassInfo
{{baseUrl}}/tax.class.info.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
tax_class_id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/tax.class.info.json?tax_class_id=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/tax.class.info.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:tax_class_id ""}})
require "http/client"
url = "{{baseUrl}}/tax.class.info.json?tax_class_id="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/tax.class.info.json?tax_class_id="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/tax.class.info.json?tax_class_id=");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/tax.class.info.json?tax_class_id="
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/tax.class.info.json?tax_class_id= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/tax.class.info.json?tax_class_id=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/tax.class.info.json?tax_class_id="))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/tax.class.info.json?tax_class_id=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/tax.class.info.json?tax_class_id=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/tax.class.info.json?tax_class_id=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/tax.class.info.json',
params: {tax_class_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/tax.class.info.json?tax_class_id=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/tax.class.info.json?tax_class_id=',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/tax.class.info.json?tax_class_id=")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/tax.class.info.json?tax_class_id=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/tax.class.info.json',
qs: {tax_class_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/tax.class.info.json');
req.query({
tax_class_id: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/tax.class.info.json',
params: {tax_class_id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/tax.class.info.json?tax_class_id=';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/tax.class.info.json?tax_class_id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/tax.class.info.json?tax_class_id=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/tax.class.info.json?tax_class_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 => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/tax.class.info.json?tax_class_id=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/tax.class.info.json');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'tax_class_id' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/tax.class.info.json');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'tax_class_id' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/tax.class.info.json?tax_class_id=' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/tax.class.info.json?tax_class_id=' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/tax.class.info.json?tax_class_id=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/tax.class.info.json"
querystring = {"tax_class_id":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/tax.class.info.json"
queryString <- list(tax_class_id = "")
response <- VERB("GET", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/tax.class.info.json?tax_class_id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/tax.class.info.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['tax_class_id'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/tax.class.info.json";
let querystring = [
("tax_class_id", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/tax.class.info.json?tax_class_id=' \
--header 'x-api-key: {{apiKey}}'
http GET '{{baseUrl}}/tax.class.info.json?tax_class_id=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/tax.class.info.json?tax_class_id='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/tax.class.info.json?tax_class_id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
WebhookCount
{{baseUrl}}/webhook.count.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/webhook.count.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/webhook.count.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/webhook.count.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/webhook.count.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/webhook.count.json");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/webhook.count.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/webhook.count.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/webhook.count.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/webhook.count.json"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/webhook.count.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/webhook.count.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/webhook.count.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/webhook.count.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/webhook.count.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/webhook.count.json',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/webhook.count.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/webhook.count.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/webhook.count.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/webhook.count.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/webhook.count.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/webhook.count.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/webhook.count.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/webhook.count.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/webhook.count.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/webhook.count.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/webhook.count.json');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/webhook.count.json');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/webhook.count.json' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/webhook.count.json' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/webhook.count.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/webhook.count.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/webhook.count.json"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/webhook.count.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/webhook.count.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/webhook.count.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/webhook.count.json \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/webhook.count.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/webhook.count.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/webhook.count.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
WebhookCreate
{{baseUrl}}/webhook.create.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
entity
action
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/webhook.create.json?entity=&action=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/webhook.create.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:entity ""
:action ""}})
require "http/client"
url = "{{baseUrl}}/webhook.create.json?entity=&action="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.post url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/webhook.create.json?entity=&action="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/webhook.create.json?entity=&action=");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/webhook.create.json?entity=&action="
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/webhook.create.json?entity=&action= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/webhook.create.json?entity=&action=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/webhook.create.json?entity=&action="))
.header("x-api-key", "{{apiKey}}")
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/webhook.create.json?entity=&action=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/webhook.create.json?entity=&action=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/webhook.create.json?entity=&action=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/webhook.create.json',
params: {entity: '', action: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/webhook.create.json?entity=&action=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/webhook.create.json?entity=&action=',
method: 'POST',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/webhook.create.json?entity=&action=")
.post(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/webhook.create.json?entity=&action=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/webhook.create.json',
qs: {entity: '', action: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/webhook.create.json');
req.query({
entity: '',
action: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/webhook.create.json',
params: {entity: '', action: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/webhook.create.json?entity=&action=';
const options = {method: 'POST', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/webhook.create.json?entity=&action="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/webhook.create.json?entity=&action=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/webhook.create.json?entity=&action=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/webhook.create.json?entity=&action=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/webhook.create.json');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'entity' => '',
'action' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/webhook.create.json');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'entity' => '',
'action' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/webhook.create.json?entity=&action=' -Method POST -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/webhook.create.json?entity=&action=' -Method POST -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("POST", "/baseUrl/webhook.create.json?entity=&action=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/webhook.create.json"
querystring = {"entity":"","action":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.post(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/webhook.create.json"
queryString <- list(
entity = "",
action = ""
)
response <- VERB("POST", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/webhook.create.json?entity=&action=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/webhook.create.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['entity'] = ''
req.params['action'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/webhook.create.json";
let querystring = [
("entity", ""),
("action", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/webhook.create.json?entity=&action=' \
--header 'x-api-key: {{apiKey}}'
http POST '{{baseUrl}}/webhook.create.json?entity=&action=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/webhook.create.json?entity=&action='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/webhook.create.json?entity=&action=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
DELETE
WebhookDelete
{{baseUrl}}/webhook.delete.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/webhook.delete.json?id=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/webhook.delete.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:id ""}})
require "http/client"
url = "{{baseUrl}}/webhook.delete.json?id="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.delete url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/webhook.delete.json?id="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/webhook.delete.json?id=");
var request = new RestRequest("", Method.Delete);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/webhook.delete.json?id="
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/webhook.delete.json?id= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/webhook.delete.json?id=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/webhook.delete.json?id="))
.header("x-api-key", "{{apiKey}}")
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/webhook.delete.json?id=")
.delete(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/webhook.delete.json?id=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/webhook.delete.json?id=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/webhook.delete.json',
params: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/webhook.delete.json?id=';
const options = {method: 'DELETE', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/webhook.delete.json?id=',
method: 'DELETE',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/webhook.delete.json?id=")
.delete(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/webhook.delete.json?id=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/webhook.delete.json',
qs: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/webhook.delete.json');
req.query({
id: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/webhook.delete.json',
params: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/webhook.delete.json?id=';
const options = {method: 'DELETE', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/webhook.delete.json?id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/webhook.delete.json?id=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/webhook.delete.json?id=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/webhook.delete.json?id=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/webhook.delete.json');
$request->setMethod(HTTP_METH_DELETE);
$request->setQueryData([
'id' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/webhook.delete.json');
$request->setRequestMethod('DELETE');
$request->setQuery(new http\QueryString([
'id' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/webhook.delete.json?id=' -Method DELETE -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/webhook.delete.json?id=' -Method DELETE -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("DELETE", "/baseUrl/webhook.delete.json?id=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/webhook.delete.json"
querystring = {"id":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.delete(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/webhook.delete.json"
queryString <- list(id = "")
response <- VERB("DELETE", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/webhook.delete.json?id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/webhook.delete.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['id'] = ''
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/webhook.delete.json";
let querystring = [
("id", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url '{{baseUrl}}/webhook.delete.json?id=' \
--header 'x-api-key: {{apiKey}}'
http DELETE '{{baseUrl}}/webhook.delete.json?id=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method DELETE \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/webhook.delete.json?id='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/webhook.delete.json?id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
WebhookEvents
{{baseUrl}}/webhook.events.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/webhook.events.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/webhook.events.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/webhook.events.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/webhook.events.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/webhook.events.json");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/webhook.events.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/webhook.events.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/webhook.events.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/webhook.events.json"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/webhook.events.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/webhook.events.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/webhook.events.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/webhook.events.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/webhook.events.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/webhook.events.json',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/webhook.events.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/webhook.events.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/webhook.events.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/webhook.events.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/webhook.events.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/webhook.events.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/webhook.events.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/webhook.events.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/webhook.events.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/webhook.events.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/webhook.events.json');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/webhook.events.json');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/webhook.events.json' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/webhook.events.json' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/webhook.events.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/webhook.events.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/webhook.events.json"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/webhook.events.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/webhook.events.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/webhook.events.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/webhook.events.json \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/webhook.events.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/webhook.events.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/webhook.events.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
WebhookList
{{baseUrl}}/webhook.list.json
HEADERS
x-api-key
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/webhook.list.json");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/webhook.list.json" {:headers {:x-api-key "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/webhook.list.json"
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/webhook.list.json"),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/webhook.list.json");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/webhook.list.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/webhook.list.json HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/webhook.list.json")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/webhook.list.json"))
.header("x-api-key", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/webhook.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/webhook.list.json")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/webhook.list.json');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/webhook.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/webhook.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/webhook.list.json',
method: 'GET',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/webhook.list.json")
.get()
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/webhook.list.json',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/webhook.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/webhook.list.json');
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/webhook.list.json',
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/webhook.list.json';
const options = {method: 'GET', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/webhook.list.json"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/webhook.list.json" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/webhook.list.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/webhook.list.json', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/webhook.list.json');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/webhook.list.json');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/webhook.list.json' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/webhook.list.json' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("GET", "/baseUrl/webhook.list.json", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/webhook.list.json"
headers = {"x-api-key": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/webhook.list.json"
response <- VERB("GET", url, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/webhook.list.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/webhook.list.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/webhook.list.json";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/webhook.list.json \
--header 'x-api-key: {{apiKey}}'
http GET {{baseUrl}}/webhook.list.json \
x-api-key:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- {{baseUrl}}/webhook.list.json
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/webhook.list.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PUT
WebhookUpdate
{{baseUrl}}/webhook.update.json
HEADERS
x-api-key
{{apiKey}}
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/webhook.update.json?id=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-api-key: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/webhook.update.json" {:headers {:x-api-key "{{apiKey}}"}
:query-params {:id ""}})
require "http/client"
url = "{{baseUrl}}/webhook.update.json?id="
headers = HTTP::Headers{
"x-api-key" => "{{apiKey}}"
}
response = HTTP::Client.put url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/webhook.update.json?id="),
Headers =
{
{ "x-api-key", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/webhook.update.json?id=");
var request = new RestRequest("", Method.Put);
request.AddHeader("x-api-key", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/webhook.update.json?id="
req, _ := http.NewRequest("PUT", url, nil)
req.Header.Add("x-api-key", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/webhook.update.json?id= HTTP/1.1
X-Api-Key: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/webhook.update.json?id=")
.setHeader("x-api-key", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/webhook.update.json?id="))
.header("x-api-key", "{{apiKey}}")
.method("PUT", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/webhook.update.json?id=")
.put(null)
.addHeader("x-api-key", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/webhook.update.json?id=")
.header("x-api-key", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/webhook.update.json?id=');
xhr.setRequestHeader('x-api-key', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/webhook.update.json',
params: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/webhook.update.json?id=';
const options = {method: 'PUT', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/webhook.update.json?id=',
method: 'PUT',
headers: {
'x-api-key': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/webhook.update.json?id=")
.put(null)
.addHeader("x-api-key", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/webhook.update.json?id=',
headers: {
'x-api-key': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/webhook.update.json',
qs: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/webhook.update.json');
req.query({
id: ''
});
req.headers({
'x-api-key': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/webhook.update.json',
params: {id: ''},
headers: {'x-api-key': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/webhook.update.json?id=';
const options = {method: 'PUT', headers: {'x-api-key': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-api-key": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/webhook.update.json?id="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/webhook.update.json?id=" in
let headers = Header.add (Header.init ()) "x-api-key" "{{apiKey}}" in
Client.call ~headers `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/webhook.update.json?id=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"x-api-key: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/webhook.update.json?id=', [
'headers' => [
'x-api-key' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/webhook.update.json');
$request->setMethod(HTTP_METH_PUT);
$request->setQueryData([
'id' => ''
]);
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/webhook.update.json');
$request->setRequestMethod('PUT');
$request->setQuery(new http\QueryString([
'id' => ''
]));
$request->setHeaders([
'x-api-key' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/webhook.update.json?id=' -Method PUT -Headers $headers
$headers=@{}
$headers.Add("x-api-key", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/webhook.update.json?id=' -Method PUT -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-api-key': "{{apiKey}}" }
conn.request("PUT", "/baseUrl/webhook.update.json?id=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/webhook.update.json"
querystring = {"id":""}
headers = {"x-api-key": "{{apiKey}}"}
response = requests.put(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/webhook.update.json"
queryString <- list(id = "")
response <- VERB("PUT", url, query = queryString, add_headers('x-api-key' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/webhook.update.json?id=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.put('/baseUrl/webhook.update.json') do |req|
req.headers['x-api-key'] = '{{apiKey}}'
req.params['id'] = ''
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/webhook.update.json";
let querystring = [
("id", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-api-key", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url '{{baseUrl}}/webhook.update.json?id=' \
--header 'x-api-key: {{apiKey}}'
http PUT '{{baseUrl}}/webhook.update.json?id=' \
x-api-key:'{{apiKey}}'
wget --quiet \
--method PUT \
--header 'x-api-key: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/webhook.update.json?id='
import Foundation
let headers = ["x-api-key": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/webhook.update.json?id=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()