Call Web Service Action

Share data over the internet with another machine.

Updated over a week ago

NOTE: 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

Description

Web service type

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

Endpoint URL

Url of 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)

Content-Type

Choose from:

  • application/JSON

  • application/XML

  • application/x-www-form-urlencoded

  • text/Plain

  • text/XML

Parameters:

The parameter(s) to send to the server.

  • Parameter name: Type in the name as required by the server.

  • Value from: Where the value is taken from. Type it in via Text, or set it via a control on the screen.

  • You can also ⊕ Add another parameter.

Headers:

If the web service requires a header, you can send a key and a value.

  • Key: Type in the Key as required by the server.

  • Value from: Where the value is taken from. Type it in via Text, or set it via a control on the screen.

  • You also ⊕ Add another header.

Body

(Only visible for POST and PATCH HTTP Method):

If the service requires body text, enter the value here.

Advanced Options


SOAP Web Service

Description

Web service type

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".

Endpoint URL

Url of the server to communicate with

SOAP action

Function call as specified by the server.

Parameters:

The parameter(s) to send to the server.

  • Parameter name: Type in the name as required by the server.

  • Value from: Where the value is taken from. Type it in via Text, or set it via a control on the screen.

  • You can also ⊕ Add another parameter.

Advanced Options


Advanced Options

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

Parameter

Description

Advanced Options

When checked, you can:

  • Store response in: an action / shared result.

  • Store status code in: an action / shared result.

Test Web Service >

Takes you to a separate screen to test whether or not your request to a web service is successful.


{{ Replace }} Keyword

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 above example, we want to replace {{AccountName}} with whatever value we have stored in Account Name.

If, for example, the Account Name 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 Customizing Method to Integrate with Slack.

Did this answer your question?