Updates product-template using given Id if available or creates new one.
1 min
code examples curl request put \\ \ url https //api upstartcommerce com/pim/product templates/{id} \\ \ header 'accept application/json'var myheaders = new headers(); myheaders append("accept", "application/json"); var requestoptions = { method 'put', headers myheaders, redirect 'follow' }; fetch("https //api upstartcommerce com/pim/product templates/{id}", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));require "uri" require "net/http" url = uri("https //api upstartcommerce com/pim/product templates/{id}") https = net http new(url host, url port) https use ssl = true request = net http put new(url) request\["accept"] = "application/json" response = https request(request) puts response read body import requests url = "https //api upstartcommerce com/pim/product templates/{id}" payload = {} headers = { 'accept' 'application/json' } response = requests request("put", url, headers=headers, data=payload) print(response text) responses // product template successfully updated against the id provided {}// product template successfully created against the request data { "id" "" }