Hi
I am trying to do a POST request via a SAP API. I did a GET request to the same api in order to obtain the csrf-token and it was successful. When I do the POST request I get a status code response of 0 and a blank error message, so I am struggling to determine where exactly my error lies. I did the same POST request in the SAP API hub and it was successful, but in UiPath it does not work. I assume my problem lies somewhere with my parameters. These are the parameters I used (in Json format) in the SAP API hub:
{
“TimeSheetDataFields”: {
“WBSElement”: “SAPPSCxxxxxx.1.4”,
“TimeSheetNote”: “API Note”,
“RecordedHours”: “4”,
“ActivityType”: “T002”
},
“PersonWorkAgreementExternalID”: “xxxxxxx”,
“CompanyCode”: “D010”,
“TimeSheetDate”: “/Date(1568015136000)/”,
“TimeSheetStatus”: “20”,
“TimeSheetOperation”: “C”
}
I have tried all kinds of different methods from previous posts to convert the Json code to string and then inserting it into the body of the HTTP request while the BodyFormat of the HTTP request is set to application/json. These are the different conversion I tried to insert into the body field:
-
‘{‘TimeSheetDataFields’:{‘WBSElement’: ‘SAPPSCxxxxx.1.4’,‘TimeSheetNote’: ‘Timesheet API’,‘RecordedHours’: ‘4’},‘PersonWorkAgreementExternalID’: ‘xxxxxx’,‘CompanyCode’: ‘D010’,‘TimeSheetDate’: ‘/Date(1568034000)/’,‘TimeSheetOperation’: ‘C’}’
-
“{‘TimeSheetDataFields’:{‘WBSElement’:‘SAPPSCxxxxxx.1.4’,‘TimeSheetNote’:‘API Note’,‘RecordedHours’:‘4’,‘ActivityType’:‘T002’},‘PersonWorkAgreementExternalID’:‘xxxxxx’,‘CompanyCode’:‘D010’,‘TimeSheetDate’:‘/Date(1568101536000)/’,‘TimeSheetStatus’:‘20’,‘TimeSheetOperation’:‘C’}”
-
“{‘“TimeSheetDataFields”’:{‘“WBSElement”’:‘“SAPPSCxxxxxx.1.4”’,‘“TimeSheetNote”’:‘“API Note”’,‘“RecordedHours”’:‘“4”’,‘“ActivityType”’:‘“T002”’},‘“PersonWorkAgreementExternalID”’:‘“xxxxxx”’,‘“CompanyCode”’:‘“D010”’,‘“TimeSheetDate”’:'”/Date(1568015136000)/“‘,’“TimeSheetStatus”‘:’“20”‘,’“TimeSheetOperation”‘:’“C”'}”
Please can someone help with this issue?