CONSUME REST API TUTORIAL?

CONSUME REST API TUTORIAL?

  
Hi 

I have been stuck trying to figure out how to use the consume rest api (web services) on OutSystems Platform (Service Studio).

Is there videos or solid documentation on how to go about this?

I have read some of the discussions on the OutSystems forum but nothing that has helped yet.

I also followed this link
http://www.outsystems.com/help/servicestudio/9.0/default.htm#Integrating_with_other_systems/Web_Services/Retrieve_Data_using_REST.htm

The process used in that link seems logical but I get internal errors when I try it for myself.

I even used the api in the example and still got internal errors on runtime.

Please can someone assit

Kind Regards

Tyrone
Hi Tyrone,

Good news! There is a (great) video you can watch. :)
Your best sources for learning how to work with REST APIs in OutSystems Platform are:
  1. Reference help - About REST section
  2. RESTful webservices introduction video (51 minutes)

Tyrone, you mentioned you got errors while following the documentation. Were you trying to make a call to "https://osacademy.zendesk.com"? That is an example URL that is not meant to be used. I'll pass the feedback to our Academy team, so they make this more explicit.

Regards.
Hi Arlindo

Thank you for the feedback I will check out that video right away :)

Regarding the errors following the documentation.. I think it requires me to be registered or logged in to use that service? Because i need to set basic authentication but I cant register at https://osacademy.zendesk.com. 
So I think that is the reason it wont work.

I tried using an Itunes open source rest api to get a list of albums for example.

I followed the same procedure as the doc and it worked.

I also tried to use this Rest api service http://www.thomas-bayer.com/sqlrest/ and get the customer list.

The response you get if you test this in the rest console is in xml format.

When I consume rest api(In service studio), I paste that xml format in the response. 

But when I look in my data tab in the structures folder, it did not create the structre entity for me.

When I convert the xml rsponse into json format, It creates the structures for me.

I follow the same procedure in the documentaion

But when It runs, it display this error:
Failed to parse response of the method 'GetCUSTOMER' of the 'GETCUSTOMERLIST' Web Reference:
Parsing '': Unexpected character encountered while parsing value: <. Path '', line 0, position 0.

What would that mean?

Kind regards
Hi Arlindo 

I have a question to ask regarding the video

At  19minutes 50 seconds into the video he has a componet that he drags into his screen. It is called BackgroundSlideShow.

How do I get that or find that  becasue I cannot see it in my service studio

I checked out http://vegas.jaysalvat.com/ but still am unclear

If I have to create one, please could you guide me through the steps of doing so..

Kind Regards

Tyrone
Hi Tyrone,

That Web Block was created to demonstrate the functionality that was being presented. It's not part of the platform and it's not a Component that is available to download at the moment.

To create something similar you can download the Background JQuery Plugin and follow this tutorial to get it to work: http://www.outsystems.com/forums/discussion/9727/how-to-integrate-a-jquery-plugin-in-the-outsystems-platform/. Once you do it, you can even share it in our repository, called Forge, avaliable on http://www.outsystems.com/forge/ :).

Best regards,

Tito Azevedo
Hi Tyrone,

As for the problems consuming the example with the xml (the one http://www.thomas-bayer.com/sqlrest/ ) since the rest is only design to handle automatically json responsonses, even if the structures are created automatically from a json example it won't be able to deserializa it at runtime.

For services that only return xml (and that there are no parameters of headers to force it to return json), the recommended is to just leave the output variable with a Text datatype and let it return a string with the complete XML. Then outside the action use some component like XML Records to convert it to a structure.

Note: getting the Strutures and correct configuration necessary for XML Records is not easy, so if you are just trying to test the REST feature itself, then try to import services that can reply with JSON.

Regards,
João Rosado

Hi Tyrone,

Find the Background JQuery Plugin here:
http://www.outsystems.com/forge/Component_Overview.aspx?ProjectId=732

Thanks!
Hi,

I want to POST parameters to the following service but I'm the service is not able to pull the values when I run the URL through PHP or directly from a browser. How do I debug?

Service: https://meshthang.outsystemscloud.com/ReadUsers/%28000000000000000000000000%29/InsertNewUser.asmx

However, If I write a small Outsystems module to do the posting it works, and I am able to add new users. check my module here:https://meshthang.outsystemscloud.com/TestConsumption/Home.aspx?

Can anyone help????
Hi Pule,

If you want to test a REST API you can use an external tool such as cURL, or a browser extension such as PostMan for Google Chrome.

You can also test directly in the browser, however you will be limited to HTTP GETs only.

Hope this helps!