Create a POST Rest API and integrate with Form from mobile app

Create a POST Rest API and integrate with Form from mobile app

  

I want to create POST rest api. Here both Request and Response will  be JSON. I want to bind POST Request parameters with Form. Once click Submit, need to show Success or failure response message in alert/Popup. If any sample project for the above one, it will be very helpful.

Hi Mohammed Abdullah,

That is too vague of a question. Even so, here it goes a pointer for you to look into:

To give you a better response and more effectively direct you to a solution, could you share what is your experience with OutSystems:

  • Did you have onsite bootcamp or online training?
  • How many months of experience?

 You can PM if you want.

Cheers,

José


Hi Jose, 

              I read the above documentation but Couldn't help my need. Actually I want to create Rest API based Form Application.  For eg : There is a  Registration form with the fields mobile number, email id and name with the submit button . Once submit button clicked, REST API Request with POST JSON  need to be triggered. Request JSON will be like below : {"mobNo": <Form Mobile Number>, "name":<Form Name>,"emailId": <Form Email Id> }

All the above JSON need to be bind  with the Regitration form input variable. Once got Response from Rest API, need to show response message in Registration screen. Response Json will be like this : {"responseMessage":"Registered Successfully","responseCode":"000"}.


  • Did you have onsite bootcamp or online training? - Nope
  • How many months of experience? - I am a newbie, I started Outsystems before 2 weeks.


Regards,

Abdullah

Hi Mohammed,

Thanks for your honest reply.

At this point the best course of action for you is to do some training before actually start developing. So, I would start by doing this online course:

https://www.outsystems.com/learn/courses/15/developing-outsystems-web-applications/

It has step by step instructions on how to start developing in OutSystems and it has presentations and exercises related with forms, form submits and rest apis, to name a few.

Cheers,

José

Greetings Jose,


I was reading the document you provide, very useful information by the way. However, I have version 9.1.0.11 and I don't see the Header / Auth tab nor the Test tab that your document reflects. Is there any other way I can add the header to the REST I am trying to consume? Am I perhaps missing a step? Please see first attached file as a reference.

I was able to manually add an input parameter to my REST, however the data type is text, please see image below. Would you have an example on how to pass the header using this input parameter?

The Header Name is ccaSecret, the value would be testCca. 


Thank you!

Karin



Hi,

@Mohammed: just to add that when you consume server actions from your mobile app, the underlying communication uses REST APIs created automatically. This way you don't have to worry about the details - just use the OutSystems visual language.

@Karin: rename your Header parameter to ccaSecret and use the appropriate value when invoking the method. Or as an alternative, in your reference definition (ESCS3_GetSubscriptions properties), add the On Before Request action and customize the request (CustomizedRequest.Headers) - this will work for all the methods under the service.