Skip to Content

Sometimes we get requirement from customers to be able to send automated outbound SMS from their SAP C4C tenant. Sometime it can be easy to setup such outbound SMS service but sometime it can be a time-consuming job, especially when customers choose to go for third-party APIs. So, in this blog we have tried to explain the simple way to setup outbound SMS service in the SAP C4C. We have included the steps with an example from one of our requirement we came across recently.

Before we start, I would like to thank my colleague Kai Reese (@kaiw.reese) for his contributions to this blog.

This blog is divided into two sections. In section one, we have explained the configuration of the mashup web service responsible to send outbound SMS using a third-party API. In the section two, we have explained the creation of workflow rule where you can configure mashup web service together with the business rules to trigger the workflow. Wherever necessary, we have put the screen shot of the configurations so that you can cross check your actual configuration when dealing with similar requirement.

Now, it’s time to get started with the setup!

Section 1: Configuration of mashup web service

Below are the steps to set up outbound SMS service using mashup web service in SAP C4C system:

  1. Login to your SAP C4C tenant. Before you start, make sure that you have sufficient work center assigned to your role/user. For the mentioned configuration Administrator work center, should be available to you. I used Silverlight mode for the configuration.
  2. Create mashup web service using by navigating to work center and tabs:

Administrator > Business Flexibility > Mashup Web Services

  1. Click on ‘New’ button and choose ‘REST Service’:
  •     The type of service depends upon the protocol supported by the API service. In our case       the it was ‘REST’ based service.
  1. In the next screen, enter the following information:
  • Service name: <Of your choice>
  • Status: Choose ‘Active’
  • Authentication Method: ‘Basic’ (This depends upon the authentication method supported by service provider. In our case, we had to choose basic authentication method.)
  • Name: < API user provided by service provider>
  • Password: <As set by you or your service provider for the API user in the service provider’s portal>
  • Service Protocol: JSON (This also depends upon the protocol supported by service provider)
  • HTTP Method: POST
  • Content type: Choose ‘Form’ or ‘XML form’.
    • Form: In case you have choose ‘Form’ then you will get options to add the fixed valued parameters. The information about the parameters should be available on API documentation or service provider’s site. You may also click on the button ‘Extract Parameters’ to generate the parameters from the URL. In our trials, we observed that the extract parameters did not worked on the URL of most of the third-party APIs. So, you can manually add the parameters based on the information provided your service provider.
    • XML Body: In our requirement, we used this option. Content you provide here again depends upon the parameters required by the API being used. If you are using SAP 365 API, then you may follow the standard documentation to supply the needed parameters. For more information about it, you can follow the link: https://uacp2.hana.ondemand.com/viewer/cea15f900ca04c4faa35d3044577fe27/1702/en-US/186d4eb0763d10148ad8f08a3b867087.html
  • In our situation, we used JSON content type. Following is an example of XML body content we supplied (Don’t get confused with the name ‘XML body’ here J. You may also supply content in the JSON format!)

{

“to”: “[#PHONE_NUMBERS]”,

“from”: “Sender Name”,

“message”: “[#MESSAGE]”

}

  • The place holders mentioned inside the square bracket comes from the workflow rule configuration. We will learn about the place holders in section 2 of this blog.
  1. Once you are done with the configuration, your screen should look something like as below:

  1. Here, we just completed the needed configuration for mashup web service intended for outbound SMS from C4C system!

Extras:

If your API supports the authentication via input parameters (viz. Authentication method as ‘None’), then you may even test the mashup by ‘Simulate’ button under output parameters (appears on bottom right corner of the screen).

  • Just for the sake of explanation about the working of ‘Simulate’ button, we have taken an example of another API where the credential is being passed via input parameters as mentioned below:
  • Once your service is configured like above, then click the ‘Simulate’ button to test the service. The return value you receive under ‘Data Structure’ section tells the success or failure of your service call. This return value is defined by the API service provider. You may refer the API documentation provided by service provider to understand the meaning of return values.
  • In our case after clicking the ‘Simulate’ button, we received the following return value:

  • Return code 1 from the API documentation means:

  • Eventually we received test SMS on the configured number.
  • If you can test your mashup using ‘Simulate’ button, then you can save considerable amount of precious project time which normally gets wasted in trial and error in testing the API from C4C.

End-of-Section 1.

Section 2: Configuration of workflow rule

In this section, we will see step by step way to create and configure workflow rule. In this workflow rule we will use the mashup web service we created in the previous section. In our example, we have configured the workflow rule for ticket creation.

  1. Navigate to Administrator > Workflow Rules and click on the ‘New’ button.

In the next screen wizard appears to configure the new workflow rule.

  1. Under step ‘1 Enter Basic Data’, enter following data:
    • Description: <Relevant description for your workflow rule>
    • Business Object: <Business object of related scenario>
      • In our case, we chose ‘Assignment’ as we wanted to send SMS whenever a service technician is assigned to a ticket.
    • Timing: <Situation when your workflow should trigger>
      • In our situation, we chose ‘On Create Only’.

  1. Under step ‘2 Define Conditions’, we define the conditions to control the trigger of workflow. You may skip this step if you don’t want any control over trigger of your workflow. Here you may enter following details:
    • Click ‘Add Group’ button and enter ‘Field’, ‘Compare Operator’ and ‘With’ information.
      • In our case, we chose Field: ‘Phone’,
      • Compare Operator: ‘Not equal to’
      • With: ‘Value’. We mentioned value as blank here. Meaning our workflow should trigger on save of ticket when service technician is assigned and the phone number is not equal to blank.

  1. Under step ‘3 Define Actions’, we provide the operational details as mentioned below:
    • Rule Type: <You may choose one of the option based on your requirement>
      • In our case, we chose ‘Messaging’ as our intention was to send SMS using workflow rule.
    • Sender: <Mashup Service ID>
      • This is the place where you enter ID of the mashup web service that you created following section 1 of this blog.
    • Text: <Fixed + place holder>
      • Here the place holder must be entered in the form of #<ID>#
    • If you are using place holders in your SMS, then click ‘Add Row’ button, enter the place holder ID (e.g. #010#) and assign the field to it which you want to display on SMS.
    • Under ‘Recipient Determination’ section, you may choose the role to which you want to send SMS. In this way, you can define to send SMS to multiple person at the same time.
    • Alternatively, you may also enter the employee(s) name in case you want to send SMS to fixed set of employee(s).

  1. Under step ‘4 Review’, you may review the overall workflow rule configuration before you confirm the changes by clicking ‘Finish’ button.
  2. Once you are done with the mentioned configuration your workflow ‘Rule Summary’ should look like as below:

  1. You are ready to test your outbound SMS setup!

End-of-Section 2.

Summary:

After having the above configuration in place, we could send SMS to defined role / employees from SAP C4C system. In our example, we used third-party SMS service provider. When working with such third-party APIs, there may be a situation that your setup simply doesn’t work. In such situation, you may reach out to the technical support team of the respective API service provider and check for the basic requirement of the API being used. Most of the service providers provide option to view the API call logs under the registered account. Using the logs, you can verify the service request made from your C4C tenant. You may fine tune your setup based on the logs accordingly. Hope this blog was helpful for you. Please feel free to leave your comments. It would be helpful for me and for others if you have any suggestion regarding improvement of this blog. Thanks for reading the blog. Have a great day ahead!

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply