Tally Platform API
member
Register for promotion using one-click encrypted tokens.
1 min
code examples curl location 'https //api b preview\ loyaltyservices io/api/v3/members/promotion' \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ data '{ "token" "eyjhbgcioijiuzi1niisinr5cci6ikpxvcj9" }'require "uri" require "json" require "net/http" url = uri("https //api b preview\ loyaltyservices io/api/v3/members/promotion") 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({ "token" "eyjhbgcioijiuzi1niisinr5cci6ikpxvcj9" }) response = https request(request) puts response read body import requests import json url = "https //api b preview\ loyaltyservices io/api/v3/members/promotion" payload = json dumps({ "token" "eyjhbgcioijiuzi1niisinr5cci6ikpxvcj9" }) 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 \\"token\\" \\"eyjhbgcioijiuzi1niisinr5cci6ikpxvcj9\\"\n}"); request request = new request builder() url("https //api b preview\ loyaltyservices io/api/v3/members/promotion") method("post", body) addheader("accept", "application/json") addheader("content type", "application/json") build(); response response = client newcall(request) execute(); responses // success { "memberpromotionids" \[ 0 ] }// bad request { "errors" \[ { "code" "", "fieldname" "", "message" "", "messageparameters" \[ {} ] } ] }// unauthorized // forbidden // internal error