CRM and CX Blogs by Members
Find insights on SAP customer relationship management and customer experience products in blog posts from community members. Post your own perspective today!
cancel
Showing results for 
Search instead for 
Did you mean: 
abap_user
Explorer
Creating a memo/portal activity in C4C using the ODATA API supplied by SAP is more difficult and less intuitive than one would hope. After spending many days trying multiple post calls, I now have the solution and would like to share it.

First, you should ensure you have the authorizations for the API set up correctly, I suggest tetsing this on the postman.com website. Four successive POST requests are then required, I have opted to use a JSON body, XML is also accepted with some adaptations to the requests.

Hint: sensitive data has been censored with “______”. Please enter your own information here. All other data can be taken directly from the code snippits.

 

1.Make the following POST call to ActivityCollection:

https://my.______crm.ondemand.com/sap/c4c/odata/v1/c4codataapi/ActivityCollection

This post call should be made with the following body.

(The SubjectName should be the title of the portal memo you wish to make):
{
"PriorityCode": "3",
"SubjectName": "______",
"LifeCycleStatusCode": "1" ,
"InitiatorCode": "2"
}

 

2.Make the following POST call to MemoActivityBusinessTransactionDocumentReferenceCollection:

 https://my______.crm.ondemand.com/sap/c4c/odata/v1/c4codataapi/MemoActivityBusinessTransactionDocume...

This post call should be made with the following body.

(The ParentObjectID can be read from the result of the previous call to ActivityCollection).

(The ID is the ticket number you wish to add a memo to):
{
"ParentObjectID": "______",
"ID": "______",
"TypeCode": "118",
"RoleCode": "1"
}

 

3.Make the following POST call to MemoActivityPartyCollection:

https://my______.crm.ondemand.com/sap/c4c/odata/v1/c4codataapi/MemoActivityPartyCollection

This post call should be made with the following body.

(The ParentObjectID can be read from the result of the first call to ActivityCollection).

(The PartyID is the ID of the contact/employee who should be the “creator” of the post. You can find this infomration in C4C):
{
"ParentObjectID": "______",
"PartyID": "______",
"PartyTypeCode": "147",
"RoleCode": "33"
}

 

4.Make the following POST call to MemoActivityTextCollection:

https://my______.crm.ondemand.com/sap/c4c/odata/v1/c4codataapi/MemoActivityTextCollection

This post call should be made with the following body.

(The ParentObjectID can be read from the result of the first call to ActivityCollection).

(The AuthorUUID is the UUID of the contact/employee who should be the “creator” of the post. You can find this information by making a post request to ContactCollection – see step 5).

(FormattedText should be the same as Text)
{
"ParentObjectID": "______",
"Text": "This note was created via the ODATA API",
"LanguageCode": "EN",
"TypeCode": "10011",
"AuthorUUID": "______",
"FormattedText": "This note was created via the ODATA API",
"languageCode": "EN"
}

 

5.(Optional).

This step is a get request in order to find the AuthorUUID of a given contact. To do this, you will need the email address of the contact registered to c4c. Simply make the following request, replacing the email address:
https://my______.crm.ondemand.com/sap/c4c/odata/v1/c4codataapi/ContactCollection?$format=xml&$search...

 

All the best,

Jonas