Skip to main content

Veritran Docs

Create a REST Service

You can invoke a REST service to use HTTP communication protocols in your environment. You can use the GET method to request data from a resource, or the POST method to create or update a resource.

Follow the instructions below to create the REST service using either GET or POST method.

  1. In the General Information tab, identify the service with a name that represents the information you want to receive, and a description that explains its functionality. You may also add tags as keywords that will help to identify the service in a search. Click Next to continue.

  2. In the Method tab, define the HTTP method that calls the service to receive information on your end. Select the GET method and add the URL (endpoint that contains the information you need to receive) provided by the client or the service's owner.

    You can invoke one or more business parameters previously created in Middleware by clicking the + icon, or by entering the business parameter's name in the Url field following the ${CODE} format.

    Complete the Query Params with a parameter and its type, which is the data you are sending to the service. Select the type (string or number) from the Type drop-down menu. If you need to call more than one query, click + Add parameter. These queries will be added as inputs on your service's node when using it in the transaction. Click Next to continue.

    rest_get.png

    Note

    The Business Parameters list retrieves all the business parameters with a process type H and their values from your Middleware environment.

  3. In the Settings tab, define the Body, the Headers and the Authorization settings of the method. 

    The method's body provides details for the server to find the information requested and to send a response. Fill in the Response field with the corresponding json.

    rest_get_2.png

    The system generates a default header with its key and value. Click + Add header to add more headers as needed. Click Delete (trashcan icon) to delete a header.

    rest_get_3.png

    In the Authorization tab, you can select Bearer Token as authorization setting.

    rest_get_4.png

    Click Summary to continue.

  4. The Summary modal window shows an overview with the information you provided to create the service. If the summary is correct, click Confirm.

  5. Studio displays a message confirming that the REST service was successfully created. Click Close to return to the External Services page or click Create Transaction to create a transaction that invokes the service.External Services

    success_externalservice.png
  1. In the General Information tab, enter a name that represents the information you want to update or send, and a description for the service. You may also add tags as keywords that will help to identify the service in a search. Click Next to continue.

  2. In the Method tab, define the HTTP method that calls the service to send information to be added to or updated in a database. Add the URL (endpoint where the information will be sent).

    You can invoke one or more business parameters previously created in Middleware by clicking the + icon, or by entering the business parameter's name in the Url field following the ${CODE} format.

    In the Query Params section, complete the key with a parameter you want to update. Select the type (string or number) from the Type drop-down menu. If you need to call more than one query, click + Add parameter. Click Next to continue.

    rest_post.png

    Note

    The Business Parameters list retrieves all the business parameters with a process type H and their values from your Middleware environment.

  3. In the Settings tab, define the Body, the Headers and the Authorization settings of the method. 

    The method's body provides details for the server to add information to a database or to update the information already stored in it, and to send a response. Fill in the Request and Response fields with the corresponding JSON samples.

    rest_post_2.png

    The system generates a default header with its key and value. Click + Add header to add more headers as needed. Click Delete (trashcan icon) to delete a header.

    rest_get_3.png

    In the Authorization tab, you can select Bearer Token as authorization setting.

    rest_get_4.png

    Click Summary to continue.

  4. The Summary modal window shows an overview with the information you provided to create the service. If the summary is correct, click Confirm.

  5. Studio displays a message confirming that the REST service was successfully created. Click Close to return to the External Services page or click Create Transaction to create a transaction that invokes the service.External Services

    success_externalservice.png

To read a use case scenario of a login transaction with a REST service using the GET method, read Create a Configurable Transaction.