issue with invokeUrl getting 7213 while it's working on Postman!

issue with invokeUrl getting 7213 while it's working on Postman!

Hi, 

I have an issue when trying to invokeUrl for zoho api, here is the code :

  1. {
  2. dataFormat = "dd/MM/yyyy HH:mm:ss";
  3. Intime = '16/06/2021 15:06:50';
  4. emailId = "x@x.x";
  5. empid = 3;
  6. testparams = Map();
  7. testparams.put("Authorization","Zoho-oauthtoken 1000.xxxxxxxxxxxxxxxxxx");
  8. testparams.put("cache-control","no-cache");

  9. //body = "{'dateFormat':'dd/MM/yyyy HH:mm:ss','checkIn':'16/06/2021 15:06:45','empId':3}";
  10. body = "{\"dateFormat\":" + dataFormat + ",\"checkIn\":" + Intime + ",\"empId\":" + empid + "} ";

  11. resp = invokeUrl("https://people.zoho.com/people/api/attendance","POST",body,testparams,false);
  12. return resp;
  13. }



here is the Output:
  1. {
    	"responseText": [
    		{
    			"msg": "Invalid input",
    			"response": "failure"
    		}
    	],
    	"responseHeader": {
    		"date": "Wed, 16 Jun 2021 12:36:38 GMT",
    		"server": "ZGS",
    		"content-length": 46,
    		"expires": "Thu, 01 Jan 1970 00:00:00 GMT",
    		"x-frame-options": "SAMEORIGIN",
    		"externalapicall": "allowed",
    		"pragma": "no-cache",
    		"strict-transport-security": "max-age=63072000",
    		"set-cookie": "_zpsid=2E25491BB23681078005E24AD967A5A5; Path=/; Secure; HttpOnly",
    		"api-count-left-today": 24989,
    		"x-content-type-options": "nosniff",
    		"x-xss-protection": 1,
    		"content-disposition": "attachment;filename=records",
    		"content-type": "application/json;charset=UTF-8",
    		"connection": "keep-alive",
    		"cache-control": "no-cache"
    	},
    	"responseCode": 200
    }


when I tried the API with the same parameters using Postman I got successful response 200;

please advice