Apps And Solutions
Banner
Update Banner properties
1min
code examples curl location globoff request patch '/developer/support/banners/{bannerid}?orgid=string' \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ data '{ "title" "", "content" "", "activefromtime" "", "activeuntiltime" "" }'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var raw = json stringify({ "title" "", "content" "", "activefromtime" "", "activeuntiltime" "" }); var requestoptions = { method 'patch', headers myheaders, body raw, redirect 'follow' }; fetch("/developer/support/banners/{bannerid}?orgid=string", 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("/developer/support/banners/{bannerid}?orgid=string") http = net http new(url host, url port); request = net http patch new(url) request\["accept"] = "application/json" request\["content type"] = "application/json" request body = json dump({ "title" "", "content" "", "activefromtime" "", "activeuntiltime" "" }) response = http request(request) puts response read body import requests import json url = "/developer/support/banners/{bannerid}?orgid=string" payload = json dumps({ "title" "", "content" "", "activefromtime" "", "activeuntiltime" "" }) headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("patch", url, headers=headers, data=payload) print(response text) responses { "data" { "id" {} }, "request" { "url" "", "method" "", "params" {}, "query" {}, "body" {} } }// bad request { "error" { "description" "\[relevant error message here]", "additionalinfo" "\[relevant error message here]", "statuscode" 400, "timestamp" "2023 10 06t16 50 10 387z" }, "request" { "url" "", "method" "", "params" {}, "query" {}, "body" {} } }// user does not have a support role { "error" { "description" "\[relevant error message here]", "additionalinfo" "\[relevant error message here]", "statuscode" 403, "timestamp" "2023 10 06t16 50 10 387z" }, "request" { "url" "", "method" "", "params" {}, "query" {}, "body" {} } }// banner id not found { "error" { "description" "\[relevant error message here]", "additionalinfo" "\[relevant error message here]", "statuscode" 404, "timestamp" "2023 10 06t16 50 10 387z" }, "request" { "url" "", "method" "", "params" {}, "query" {}, "body" {} } }