Getting error 200 Ok in the below code

2017-11-19 04:06:43

Hi i am trying to integrate the 3rd party resume parser in salesforce i have written the below code. Please let me know what i am doing wrong.

Http http = new Http();

HttpRequest request = new HttpRequest();


List doc = [select body,name from attachment where Id='xxxxxxx'];

attachment doc1=doc[0];

String File=;

Blob bodyblob = doc1.Body;

String bodystr=EncodingUtil.base64Encode(bodyblob);

String Userkey='xxxxxxxxx';

String Version='xxx';

String subU='xxxxxxxxxx';


request.setHeader('Content-Type', 'application/json');


HttpResponse response = http.send(request);

if (response.getStatusCode() != 201) {

System.debug('The status code returned was not expected: ' +

response.getStatusCode() + ' ' + response.getStatus());


  • 200 is a good status, not an error status. That said, it looks like Userkey should be userkey (note the capital U is incorrect). Always make sure you're paying attention to capitalization when working with APIs.

    2017-11-19 04:18:46