Tally Platform API
member-comment
Create member comments for multiple members
1 min
code examples curl location 'https //api b preview\ loyaltyservices io/api/v3/members/comments' \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ data '{ "accountids" \[], "reason" "", "title" "", "closeddate" "2023 04 06", "comment" "" }'require "uri" require "json" require "net/http" url = uri("https //api b preview\ loyaltyservices io/api/v3/members/comments") 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({ "accountids" \[], "reason" "", "title" "", "closeddate" "2023 04 06", "comment" "" }) response = https request(request) puts response read body import requests import json url = "https //api b preview\ loyaltyservices io/api/v3/members/comments" payload = json dumps({ "accountids" \[], "reason" "", "title" "", "closeddate" "2023 04 06", "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 \\"accountids\\" \[],\n \\"reason\\" \\"\\",\n \\"title\\" \\"\\",\n \\"closeddate\\" \\"2023 04 06\\",\n \\"comment\\" \\"\\"\n}"); request request = new request builder() url("https //api b preview\ loyaltyservices io/api/v3/members/comments") method("post", body) addheader("accept", "application/json") addheader("content type", "application/json") build(); response response = client newcall(request) execute(); responses // success { "totalrecords" 1000, "totalrecordsupdated" 950, "totalrecordsfailed" 50, "errordetails" { "errors" \[ { "code" "", "fieldname" "", "message" "", "messageparameters" \[ {} ] } ] } }// bad request { "errors" \[ { "code" "", "fieldname" "", "message" "", "messageparameters" \[ {} ] } ] }// unauthorized // internal error