Tally Platform API
member-badge
Create Member badge
1 min
code examples curl location globoff 'https //api b preview\ loyaltyservices io/api/v3/members/{memberidentifier}/badges/{badgeid}' \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ data '{ "comment" "" }'require "uri" require "json" require "net/http" url = uri("https //api b preview\ loyaltyservices io/api/v3/members/{memberidentifier}/badges/{badgeid}") 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({ "comment" "" }) response = https request(request) puts response read body import requests import json url = "https //api b preview\ loyaltyservices io/api/v3/members/{memberidentifier}/badges/{badgeid}" payload = json dumps({ "comment" "" }) headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("post", 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 \\"comment\\" \\"\\"\n}"); request request = new request builder() url("https //api b preview\ loyaltyservices io/api/v3/members/{memberidentifier}/badges/{badgeid}") method("post", body) addheader("accept", "application/json") addheader("content type", "application/json") build(); response response = client newcall(request) execute(); responses // success { "memberbadgeid" 147258369, "badgedetails" { "badgeid" 147258369, "badgetypecode" "general", "badgename" "event organizer", "badgedescription" "an organizer who brings in over $100,000 year in business", "statuscode" "active", "expirationdate" "4000 01 01", "expirationtype" "exact", "expirationdayperiod" 60, "expirationtimeperiod" 10, "logokey" "elite explorer png", "content" { "contentcode" "bonus100", "contenttypecode" "header", "name" "bonus 100 points", "shortdescription" "award 100 points", "description" "award 100 points on 100th stay", "alternatedescription" "award 100 points on 100th stay", "termsandconditions" "terms and conditions for this promotion", "title" "award 100 points", "label" "100 points awarded", "logokey" "100 points png", "displaytypekey" "100 points", "startdate" "", "enddate" "", "url" "/loyaltyprogram/bonus/100 points", "tiercode" "b", "displayforall" true, "descriptorcode" "limited time" } }, "sourcecode" "promotion", "statuscode" "activated", "startdate" "2020 01 01", "enddate" "2020 12 31", "updateusername" "", "createusername" "", "sourcedescription" "" }// bad request { "errors" \[ { "code" "", "fieldname" "", "message" "", "messageparameters" \[ {} ] } ] }// unauthorized // forbidden // internal error