I am trying to fetch 150 contacts per page while calling https://api.intercom.io/contacts.
but on trying to do so , i am getting the following error
{"type":"error.list","request_id":"0069rm2ubh0lgdfr7kg0","errors":r{"code":"invalid_document","message":"either_email_or_user_id_present validation failed"}]}
attaching the REST API INTEGRTION code below: ( implemented using Salesforce Apex)
String endpoint=’ https://api.intercom.io/contacts’
HttpRequest request = new HttpRequest();
request.setEndpoint(endpoint);
request.setMethod('GET');
request.setHeader('Authorization', 'Bearer ' + INTERCOM_API_TOKEN);
request.setHeader('Accept', 'application/json');
request.setHeader('Content-Type','application/Json');
Integer perPage = 150;
String json= '{'+
' "per_page":'+perPage +
'}';
system.debug(json);
request.setBody(json);
Could you kindly share your thoughts on how to handle this error . Any input is highly appreciated .
Thank you