AnsweredAssumed Answered

Bulk Export Error

Question asked by Ariel Sasso on Jul 19, 2019
Latest reply on Jul 19, 2019 by Sanford Whiteman

We are trying to do a bulk export via API and are getting the below error. Any ideas on what might be going wrong? 

The error we are receiving - 

 
{"requestId":"77f2#16c08a8af9d","success":false,"errors":[{"code":"605","message":"Request method 'POST' not supported"}]}

 

The script

HttpRequest req = new HttpRequest();
String sURL = 'https://ourid.mktorest.com/bulk/v1/leads/export.json';
req.setEndpoint(sURL);
req.setMethod('GET');
req.setHeader('Accept', 'application/json');
req.setHeader('Content-Type', 'application/json');
req.setTimeout(120000);
req.setHeader('Authorization','bearer
e60ef4e1-cda7-45ef-add4-f18e6d0e6032:ab');
req.setBody('{"fields": ["firstName","lastName","id","email"],"format":
"CSV","columnHeaderNames": {"firstName": "First Name","lastName": "Last
Name","id": "Marketo Id","email": "Email Address"},"filter": {"createdAt":
{"startAt": "2019-01-01T00:00:00Z","endAt": "2019-01-16T00:00:00Z"}}}');
Http http = new Http();
String resp;
HTTPResponse res = http.send(req);
system.debug('**********'+res);
system.debug('**********'+res.getBody());

Outcomes