Inventory API
Categories
Attach Products
this api endpoint (post) (post) attaches multiple products to a single category if the request succeeds, it will return a category object docid\ ghdgklvkr09tcebqg9ilu webhook event category events docid 7jdgdmvbp2vtc25 n i1o path parameters id the id of the category body parameters products array of strings an array of strings each representing a product id that you wish to attach the maximum number of products that can be attached in a single request is 1000 require "uri" require "json" require "net/http" url = uri("https //api tamio com/v2/categories/products/attach/0298df64 16c4 4b42 b1c4 b9d5c8678685") https = net http new(url host, url port) https use ssl = true request = net http post new(url) request\["accept"] = "application/json" \# replace your token here with your developer key request\["authorization"] = "bearer your token here" data = { products \[ 'cbadfed2 4464 452c a146 6f064c863953' ] } request body = data to json response = https request(request) puts response read bodycurl location request post 'https //api tamio com/v2/categories/products/attach/0298df64 16c4 4b42 b1c4 b9d5c8678685' \\ \ header 'accept application/json' \\ \ header 'authorization bearer your token here' \\ \ data raw '{ "products" \[ "cbadfed2 4464 452c a146 6f064c863953" ] }'var myheaders = new headers(); myheaders append("accept", "application/json"); // replace your token here with your developer key myheaders append("authorization", "bearer your token here"); var data = { products \[ 'cbadfed2 4464 452c a146 6f064c863953' ] }; var body = json stringify(data); var requestoptions = { method 'post', headers myheaders, body body }; fetch("https //api tamio com/v2/categories/products/attach/0298df64 16c4 4b42 b1c4 b9d5c8678685", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));{ "status" 200, "category" { "id" "0298df64 16c4 4b42 b1c4 b9d5c8678685", "image" null, "parent id" "e6df3338 8a59 4096 b515 02e61ba97846", "slug" "washing machines", "icon" "star", "object" "category", "status" true, "name" "washing machines", "created at" 1667837076, "asset id" null, "config" { "en" { "description" null, "seo description" null, "seo title" null, "title" "washing machines" } }, "number of subcategories" 0, "number of products" 0, "path" "61fab71e c65f 4a02 90ff f424c6cabc69/e6df3338 8a59 4096 b515 02e61ba97846", "label path" "electronics/appliances" } }