Call Web Service

Retrieve and send data via a web service

The Call Web Service action allows you to use a web service to retrieve and send data to another server on the internet.

An understanding of web services is highly recommended before using this action. How and when to use a web service is beyond the scope of this article.

Method supports two types of web services: REST and SOAP. Choosing between the two is dependent on the service you are calling. The parameters for both are explained below.

REST Web Service

REST (Representational State Transfer) makes data available as resources (i.e. nouns). For example: "user", "invoice", "amount". 

  • Web service type: REST
  • Endpoint URL: the server to communicate with
  • HTTP Method: Choose from one of the five http methods:
    • GET
    • POST (Allows to send Body)
    • PUT
    • DELETE
    • PATCH (Allows to send Body)
  • Parameter name: the parameter to send to the server. Value from allows you to choose where to get the parameters. e.g. If you use "Text" for Value from, you can directly type it in. 
  • ⊕ Add another parameter: Select this to add another parameter.
  • Headers - Key: If you only need to send a key to the server, enter the value here. Value from allows you to choose where to get the parameters. e.g. If you use "Text" for Value from, you can directly type it in. 
  • Body (available for POST and PATCH): If the service requires body text, enter the value here. Value from allows you to choose where to get the parameters. e.g. If you use "Text" for Value from, you can directly type it in.

SOAP Web Service

SOAP (Simple Object Access Protocol) is its own protocol with more standards. It makes data available as services (verb + noun). For example: "getUser", "payInvoice", "getAmount".

  • Web service type: SOAP
  • Endpoint URL: the server to communicate with
  • SOAP action: function call to specify for SOAP
  • Parameter name: the parameter to send to the server. Value from allows you to choose where to get the parameters. e.g. If you use "Text" for Value from, you can directly type it in. 
  • ⊕ Add another parameter: Select this to add another parameter.

Advanced Options

In both types of services (REST or SOAP), there are further options.

  • Store web service response in an Action Result: the data returned can be placed in an action result to be parsed later.
  • Test Web Service: Use this special screen to test whether or not your request to a web service is successful.

{{ Replace }}

There are times when you wish the Endpoint URL to dynamically change based on a keyword. There is a mechanism in place to change the URL by enclosing it between two curly braces: {{ }}.

In the below example, the Endpoint URL requires an account name. Note the highlighted {{AccountName}}. The curly brackets ({{ }}) indicates we want to replace this word. 

Under Parameter name, we indicate the word we wish to replace, and what we want to replace it with. 

In the example, we want to replace {{AccountName}} with whatever value we have stored in CompanyAccount.

If, for example, the CompanyAccount field held the value "PopAndSkate", then the Endpoint URL would resolve to: 

https://api.company.io/data?name=PopAndSkate 

Examples

Although we don't have many examples, you can see our article on Integrating Method with Slack using the Call Web Service action.

Was this article helpful?

Can’t find what you’re looking for?

Contact Us