Update communication type
1 min
code examples curl request put \\ \ url https //api b preview\ loyaltyservices io/api/v3/communication types/{communicationcode} \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ data '{ "code" "welcome email", "name" "welcome email", "channel" "email", "providercode" "braze", "externalcode" "d abc123", "statuscode" "active" }'require "uri" require "json" require "net/http" url = uri("https //api b preview\ loyaltyservices io/api/v3/communication types/{communicationcode}") https = net http new(url host, url port) https use ssl = true request = net http put new(url) request\["accept"] = "application/json" request\["content type"] = "application/json" request body = json dump({ "code" "welcome email", "name" "welcome email", "channel" "email", "providercode" "braze", "externalcode" "d abc123", "statuscode" "active" }) response = https request(request) puts response read body import requests import json url = "https //api b preview\ loyaltyservices io/api/v3/communication types/{communicationcode}" payload = json dumps({ "code" "welcome email", "name" "welcome email", "channel" "email", "providercode" "braze", "externalcode" "d abc123", "statuscode" "active" }) headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("put", url, headers=headers, data=payload) print(response text) okhttpclient client = new okhttpclient() newbuilder() build(); mediatype mediatype = mediatype parse("application/json"); requestbody body = requestbody create(mediatype, "{\n \\"code\\" \\"welcome email\\",\n \\"name\\" \\"welcome email\\",\n \\"channel\\" \\"email\\",\n \\"providercode\\" \\"braze\\",\n \\"externalcode\\" \\"d abc123\\",\n \\"statuscode\\" \\"active\\"\n}"); request request = new request builder() url("https //api b preview\ loyaltyservices io/api/v3/communication types/{communicationcode}") method("put", body) addheader("accept", "application/json") addheader("content type", "application/json") build(); response response = client newcall(request) execute(); responses // success { "code" "welcome email", "name" "welcome email", "description" "sent when a member enrolls", "channel" "email", "providercode" "braze", "externalcode" "d abc123", "statuscode" "active" }// bad request { "errors" \[ { "code" "", "fieldname" "", "message" "", "messageparameters" \[ {} ] } ] }// unauthorized // forbidden // not found // internal error