cancel
Showing results for 
Search instead for 
Did you mean: 

How to configure post and put metods in SAP BTP destination REST API integration

juanparedes5
Explorer
0 Kudos

Hi experts...

I'm trying to create a record and edit it in SAP SuccessFactors, specifically in the job classification object thrugh SAP Build Apps and its function od REST API Integration, however, When I use the post metod, the test show me the following error:

Someone knows how to do that?

Thank.

Accepted Solutions (1)

Accepted Solutions (1)

Dan_Wroblewski
Developer Advocate
Developer Advocate
0 Kudos

Status 415 is unsupported media type.

Probably you have to specify Content-Type header for this SF call.

If you look at API Business Hub for this API call, seems to want: Content-Type = application/json

https://api.sap.com/api/ECFoundationOrganization/resource

juanparedes5
Explorer
0 Kudos

Hi Daniel,

With your comment I can configure the delete method:

However, in the post and put methods I have the same error, Did you work with them anytime?

xiswanto
Active Participant

I'm not exactly sure if my case on SAP EHP system and SOAPUI is the same as SAP BTP, but perhaps my idea could be of help:

1. for my DELETE method, my request payload for data format does not matter, only the URI need to be paired with key value ( perhaps related to step 2 )

2. perhaps the format of the data is wrong for PUT / POST? in my case, it looks like this ( does not contain '\' character 😞

{ "Field1":"value1","Field2":"value2" }

Dan_Wroblewski
Developer Advocate
Developer Advocate

@juanparedes5 I'm not familiar with this API, and I do not have a system to test the POST calls.

Can you show how you are you are adding the headers, and also what schema/data you are sending with the POST?

If possible, can you use developer tools when you click Test and see what request is actually sent?

Dan_Wroblewski
Developer Advocate
Developer Advocate

I at least simulate it with SAP API Business Hub. I supplied as header Accept = application/json (though leaving this out does not produce 415 error).

URL: https://sandbox.api.sap.com/successfactors/odata/v2/FOJobCode

HEADERS: Accept and APIKey

Dan_Wroblewski
Developer Advocate
Developer Advocate

I can reproduce the 415 error by sending a bad Content-Type -- though I did not have to send a good Content-Type

juanparedes5
Explorer
0 Kudos

Hi Daniel, I have already solved the problem, if anyone needs something similar I can explain that.

First, I had to create a schema with the propities that I needed, then I configure a destination in BTP Cockpit with the HTML5.DynamicDestination propity as true. Finally I use the create configuration for all methods. Each one requires particular configuration but in general I use them in the same way.

Thanks for all your anwers, you helped me so much!

Answers (0)