Load App APIs
File Upload
Upload material invoice
1 min
code examples curl location globoff 'https //{tenantsubdomain}/tms/api/v1/demands/material invoice' \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ data '{ "loadid" "", "invoices" \[ { "invoicenumber" "", "orders" \[ { "ordernumber" "", "lineitems" \[ { "lineitemnumber" "", "productcode" "", "quantity" 0 } ] } ] } ], "callback" { "url" "" } }'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var raw = json stringify({ "loadid" "", "invoices" \[ { "invoicenumber" "", "orders" \[ { "ordernumber" "", "lineitems" \[ { "lineitemnumber" "", "productcode" "", "quantity" 0 } ] } ] } ], "callback" { "url" "" } }); var requestoptions = { method 'post', headers myheaders, body raw, redirect 'follow' }; fetch("https //{tenantsubdomain}/tms/api/v1/demands/material invoice", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));require "uri" require "json" require "net/http" url = uri("https //{tenantsubdomain}/tms/api/v1/demands/material invoice") https = net http new(url host, url port) https use ssl = true request = net http post new(url) request\["accept"] = "application/json" request\["content type"] = "application/json" request body = json dump({ "loadid" "", "invoices" \[ { "invoicenumber" "", "orders" \[ { "ordernumber" "", "lineitems" \[ { "lineitemnumber" "", "productcode" "", "quantity" 0 } ] } ] } ], "callback" { "url" "" } }) response = https request(request) puts response read body import requests import json url = "https //{tenantsubdomain}/tms/api/v1/demands/material invoice" payload = json dumps({ "loadid" "", "invoices" \[ { "invoicenumber" "", "orders" \[ { "ordernumber" "", "lineitems" \[ { "lineitemnumber" "", "productcode" "", "quantity" 0 } ] } ] } ], "callback" { "url" "" } }) headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("post", url, headers=headers, data=payload) print(response text) responses // material invoice upload processed successfully { "success" false, "message" { "requestid" "" } }// bad request invalid data or missing required fields { "error" { "formatted config message" "" } }
