Tally Platform API
badge
Get Badges
1 min
code examples curl location 'https //api b preview\ loyaltyservices io/api/v3/badges' \\ \ header 'accept application/json' \\ \ header 'content type application/json'require "uri" require "json" require "net/http" url = uri("https //api b preview\ loyaltyservices io/api/v3/badges") https = net http new(url host, url port) https use ssl = true request = net http get new(url) request\["accept"] = "application/json" request\["content type"] = "application/json" response = https request(request) puts response read body import requests import json url = "https //api b preview\ loyaltyservices io/api/v3/badges" payload = {} headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("get", 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, ""); request request = new request builder() url("https //api b preview\ loyaltyservices io/api/v3/badges") method("get", body) addheader("accept", "application/json") addheader("content type", "application/json") build(); response response = client newcall(request) execute(); responses // success \[ { "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" } } ]// bad request { "errors" \[ { "code" "", "fieldname" "", "message" "", "messageparameters" \[ {} ] } ] }// unauthorized // forbidden // internal error