cancel
Showing results for 
Search instead for 
Did you mean: 

Consume an external Rest webservice in C4C

former_member640082
Participant
0 Kudos

Hello Experts!

I need to consume an external web service into my custom BO, to test the connection i used a public API https://reqres.in/api/users;

1- I created an external web service using the API https://reqres.in/api/users;

2- I Created a web service scénario

3- I craeted a communicationa arrangement

4- i created an after modify script and i added this script

capture.png

i dont know what to put exactly in the parameters . in my custom BO i have TWO fields:

captureed.png

the requirement is to get the id client from the custom bo and serch in the Api and get the email that correspand the id and put it in the field in C4C.

Urgent!

Thank you,

Sarah,

Accepted Solutions (1)

Accepted Solutions (1)

former_member226
Employee
Employee

Hi,

Based on the API provided by you https://reqres.in/api/users if you want to read a specific instance then you need to call something like https://reqres.in/api/users?id=12 which can be achieved using UrlParamers in ABSL code.

you can just pass "Name" as the property of the API and value as teh filter so my above use case where i want to call https://reqres.in/api/users?id=12 i will pass following:

var urlParam : NameAndValue;

var urlParams :collectionof NameAndValue;

urlParam.Name = "id";

urlParam.Value = "12" ;

urlParams.Add(urlParam);

Thanks

Saurabh

former_member640082
Participant
0 Kudos

Hello Saurabh,

Thank you very much for your help,

Sarah,

Answers (0)