Global API
...
Requests
Contact
Read
5min
to read conacts, please use the below parameters field name data type description customparameters map\<string, paramvalue> it is used to add filters to your search results pageindex integer request any page from the search results reponse searchid string request any page with the search id from the search results reponse custompagesize string no of records to return per search request custom parameters in the requestjson are in the form of param name and value map which are used for filtering different search results there is currently only one supported custom parameter supported custom parameters field name data type description where keyvaluemap pass the supported where filters in the key value pair param value can be passed in the following two ways paramvalue field name data type description value string single param value keyvaluemap map\<string, string> adding multiple key value params (where filters) supported “where” filters field name data type description datecreated long this will filter on an exact match (equal) use the “additionalfilter” option for a range of dates internalid string internal id of the contact multiple values can be passed in a comma separated string lastmodifieddate long this will filter on an exact match (equal) use the “additionalfilter” option for a range of dates stage string stage can be ‘ customer’, ‘ prospect’ or ‘ lead’ multiple values can be passed in a comma separated string ex customer, prospect subsidiary string internal id of subsidiary (primary) do not use this in additonalfilter multiple ids can be passed in a comma separated string ex 1,2 additonalfilter string construct the additional filter with a combination of above fields using ‘+and+’ separator and pass it as a single string make sure to wrap the whole string using encodingutil urlencode example request map\<string, object> filters = new map\<string, object>(); filters put('subsidiary', '1,2'); filters put('additionalfilter', encodingutil urlencode('lastmodifieddate>1627091060+and+lastmodifieddate<1629127860', 'utf 8')); // encode additionalfilter after constructing it with +and+ for multi filters // field filters and additionalfilter for where param map\<string, object> filtermap = new map\<string, object>(); filtermap put('where', new map\<string, object>{'keyvaluemap'=>filters}); map\<string, object> requestjsonmap = new map\<string, object>(); requestjsonmap put('customparameters', filtermap); string reqjson = json serialize(requestjsonmap); map\<string, object> reqobj = new map\<string, object>(); reqobj put('version', '1 0'); reqobj put('action', 'readcontact'); reqobj put('requestjson', reqjson); // place a request to breadwinner global api map\<string, object> resp = breadwinner ns breadwinnernetsuiteapi call(reqobj); system debug(resp); response { action=readcontact, timestamp=1657003583435, validrequest=true, version=1 0, responsejson={ "currentpagerecords" 1, "totalrecords" 1, "totalpages" 1, "searchid" "webservices 5333445 sb1 07042022853794477184289863 609d54ebc", "pageindex" 1, "errors" \[ ], "customparamters" { "where" { "value" null, "keyvaluemap" { "subsidiary" "1,2" } } }, "status" "200" "contacts" \[ { "title" null, "subsidiary" { "type" null, "name" "australia", "internalid" "1", "externalid" null }, "salutation" null, "salesforceid" null, "phone" null, "officephone" null, "nullfieldlist" null, "mobilephone" null, "middlename" null, "lastname" null, "lastmodifieddate" 1628271541, "isprivate" false, "isinactive" false, "internalid" "17769", "homephone" null, "firstname" null, "fax" null, "externalid" null, "entityid" "tessttt", "email" null, "defaultaddress" null, "datecreated" 1590052407, "customform" null, "customfieldlist" { "customfield" \[ { "valuelookup" null, "value" "false", "scriptid" "custentity19", "internalid" "479", "fieldtype" null }, { "valuelookup" null, "value" "false", "scriptid" "custentity checkbox", "internalid" "432", "fieldtype" null } ] }, "company" { "type" null, "name" "1 5 havells george kim rakesh reddy xilani shops rakesh reddy rakesh babu n test on 21'5", "internalid" "17768", "externalid" null }, "comments" null, "assistant" null, "altemail" null, "addressbooklist" null }, { "title" null, "subsidiary" { "type" null, "name" "australia", "internalid" "9", "externalid" null }, "salutation" null, "salesforceid" null, "phone" null, "officephone" null, "mobilephone" null, "middlename" null, "lastname" null, "lastmodifieddate" 1594366008, "isprivate" false, "isinactive" false, "internalid" "19287", "homephone" null, "firstname" null, "fax" null, "externalid" null, "entityid" "testttt", "email" null, "defaultaddress" null, "datecreated" 1594366008, "customform" null, "customfieldlist" { "customfield" \[ { "valuelookup" null, "value" "false", "scriptid" "custentity19", "internalid" "479", "fieldtype" null }, { "valuelookup" null, "value" "false", "scriptid" "custentity checkbox", "internalid" "432", "fieldtype" null } ] }, "company" { "type" null, "name" "cust453at test on 7'10 aus", "internalid" "19286", "externalid" null }, "addressbooklist" null } ] } }