Skip to Content
1
Former Member
Jan 19, 2017 at 02:29 PM

C4C - How to Create a Lead or Opportunity with OData? Syntax error in body

1061 Views

Hello,
i want to create a Lead or Opportunity with OData over HTTP with an external tool.

1. I check the Opportunity Collection with the GET-Method and Basic Auth
URL: https://xxxxxxxx.crm.ondemand.com/sap/c4c/odata/v1/c4codata/OpportunityCollection?$format=json

2. I fetch a token with the GET-Method and Basic Auth
URL: https://xxxxxxxx.crm.ondemand.com/sap/c4c/odata/v1/c4codata/

3. I try to create an Opportunity with POST-Method, x-csrf-token and Basic Auth
URL: https://xxxxxxxx.crm.ondemand.com/sap/c4c/odata/v1/c4codata/OpportunityCollection

Body: ???

Does someone has a minimal code example?
Evertime i try to create an Opportunity, i get an error. Same with Lead.

Thanks and best regards
Lars