Webinar (on-demand): OutSystems and Analytics Integration: A New Strategy to Reduce Costs

Discover everything you need to know about Hubway Connect

Try the product online without any installation or purchase commitment
Hubway Connect

Innovative ways to leverage your data for business outcomes

Find out how Hubway Connect can help you get more value from your OutSystems platform
Hubway Connect

Learn and expand your Hubway Connect knowledge

Deep dive in articles, videos and technical information to maximise its use
Hubway Connect

Start free and expand without surprises

Choose the Hubway Connect offer that best meets your needs and suits your budget
Hubway Connect

We are here to help. Let’s talk.

Connect with us via your preferred channel and we will be happy to answer your questions
Hubway Connect
  1. Home
  2. Knowledge Base
  3. FAQs
  4. How to expose a REST API in OutSystems

How to expose a REST API in OutSystems

Exposing a REST API in OutSystems allows you to enable other systems to retrieve or manipulate information through your application. Here’s a step-by-step guide to creating and exposing a REST API in OutSystems.

Create the REST API Service

  1. Open the Logic Tab: Navigate to the Logic tab within your OutSystems environment and open the Integrations folder.
  2. Expose REST API: Right-click on the REST folder and select “Expose REST API…”.
  3. Set the API Name: Choose a name for your REST API. It’s recommended to name the API according to its version (e.g., v1 for version one), but you can also use a more descriptive name like “PhoneBook”.

Create the REST API Method

  1. Add REST API method: Right-click on your newly created REST API and select “Add REST API Method”.
  2. Name your method: Set a name for your REST API method, such as GetContacts, CreateContact, or UpdateContact.
  3. Set the HTTP method: Choose the appropriate HTTP verb (GET, POST, PUT, DELETE) based on the action your method performs:
    • GET: For reading data.
    • POST: For creating new data.
    • PUT: For updating existing data.
    • DELETE: For deleting data.
  4. Design the method: Create the logic for your method. For example:
    • GetContacts: Retrieves a list of all contacts.
    • CreateContact: Receives a contact record and returns the ID of the created contact.
    • UpdateContact: Receives a contact record and returns the ID of the updated contact.

Accessing Your REST API Endpoints

After deploying your application, your REST API endpoints will be accessible. Examples of such endpoints include:

  • GET https://<server>/PhoneAPI/rest/v1/GetContacts – Retrieves all contacts.
  • GET https://<server>/PhoneAPI/rest/v1/GetContact – Retrieves a specific contact.
  • POST https://<server>/PhoneAPI/rest/v1/CreateContact – Creates a new contact.
  • PUT https://<server>/PhoneAPI/rest/v1/UpdateContact – Updates an existing contact.
  • DELETE https://<server>/PhoneAPI/rest/v1/DeleteContact – Deletes a contact.
  • GET https://<server>/PhoneAPI/rest/v1/GetContactAddresses – Retrieves all addresses of a contact.

Customising Endpoints

OutSystems defines default endpoints based on the HTTP method and the name of the REST API methods, but you have the flexibility to customise these endpoints according to your needs.

Testing Your REST API

You can test your REST API methods using various tools such as Curl or Postman, or by building an OutSystems application specifically for testing purposes.

For manipulation methods (POST or PUT) that require an input parameter as a record, ensure you add the Content-Type header to your request with the value application/json.

Exposing APIs with Hubway Connect

While OutSystems provides a robust way to expose REST APIs, Hubway Connect simplifies and accelerates this process even further. Hubway Connect is a no-code solution designed to allow non-developer users to create, configure, and manage OData connections (APIs) efficiently. Here’s how Hubway Connect enhances your API exposure process:

  1. No-Code API Creation: With Hubway Connect, creating APIs is as simple as a few clicks. You don’t need to write any code, making it accessible to business users and reducing the load on your development team.
  2. Rapid Deployment: APIs can be generated and deployed in minutes, providing real-time access to data stored in OutSystems and other databases.
  3. Enhanced Data Governance: Hubway Connect ensures that data governance and security protocols are adhered to without the need for extensive coding.
  4. Seamless Integration: Easily integrate data from different sources and leverage powerful analytics tools to make informed business decisions.
  5. Cost Efficiency: By reducing the need for extensive development resources, Hubway Connect helps lower the overall cost of API development.

Ready to streamline your API management and boost your OutSystems platform’s capabilities? Discover the power of Hubway Connect today – sign up for a free 15-day trial and experience the benefits of no-code, hassle-free API management.

Was this article helpful?

Related Articles