When you need to create, change, or delete information in another system, and that system provides REST APIs for that effect, use a REST API to integrate and manipulate data.

Typically, there are some steps you always take when adding a REST API method:

  1. Look into the API documentation. Understand how you can invoke the REST API method;
  2. Define the REST API and REST API method. Use the information you found in the API documentation;
  3. Understand what is created;
  4. Use the REST API method in your application.


Imagine you have an external system for managing tickets (Zendesk) and an application in OutSystems that lists tickets from there. However, now you need to create tickets. Zendesk provides a REST API for that effect.

1. Look Into the API Documentation

Go to the Zendesk API documentation and understand how their REST API works.

You will find that the REST API Method to create tickets has the following specifications:

2. Define the REST API and REST API Method

Add the a new method to the REST API:

  1. In the Logic layer, expand the Integrations folder;
  2. Right-click on the REST element and select 'Add REST API Method...';
  3. Fill the information about the Method URL: POST and https://osacademy.zendesk.com/api/v2/tickets.json
  4. Make sure you put your credentials for Zendesk, in the Headers/Auth tab;
  5. Go to the Test tab, fill the Request of the Body Content, and press Test;

  1. In the Request tab, press COPY TO REQUEST BODY;
  2. Go back to the Test tab, do the same in Response tab, and leave only the fields we need:

Normally, the most common fields are obtained this way. To know in full detail all the available fields, check the API documentation.

3. Understand What is Created

Press Ok and the OutSystems Platform does the following for you:

Notice the values in the Name, URL Path, HTTP Method, Request Format, and Response Format\ properties.

Notice the Ticket structure and its attributes:

The REST API requires authentication. However, it is already set, in the Basic Authentication section.

You may change the values that were set by default at any time. For example, change the Name of the PostTickets REST API Method to CreateTicket.

Before creating the web screen to create tickets, you should adjust the attributes of the structure that was created, as it will have impact on the screen design:

4. Use the REST API Method in Your Application

Now, design the web screen:

  1. Use a form to get the ticket information:
    1. Set the CreateTicketRequest structure as source record;
    2. Add the input fields.
  2. Use a button with a screen action to create the ticket, using the CreateTicket REST API method.

Publish and open in the browser.

Create a new ticket.

Using the web screen to list tickets, you can see that the ticket was created.

See Also

Retrieve Data using REST