Make API Requests

Use these components to construct HTTP requests to WatchGuard public APIs:

Component Description

HTTP Method

One of these methods:

  • GET — Requests data from the API
  • POST — Submits data to the API
  • PUT — Updates all data in a resource
  • PATCH — Updates only specified data in a resource
  • DELETE — Deletes data in a resource
  • OPTIONS — Describes the communication options for the resource
  • TRACE — Performs a message loop-back along the path to the resource

API URL

URL of the API.

The base API URL also varies by region. The base API URL for your account appears on the Managed Access page in your WatchGuard Cloud account.

  • APAC Regionhttps://api.jpn.cloud.watchguard.com/rest/
  • EMEA Regionhttps://api.deu.cloud.watchguard.com/rest/
  • NA/Americas Regionhttps://api.usa.cloud.watchguard.com/rest/

Each WatchGuard public API has a version, expressed as <major>.<minor>.<patch>. For more information, see Versioning. You specify the major API version, such as v1, as part of the endpoint URI path:

https://api.usa.cloud.watchguard.com/rest/authpoint/authentication/v1/accounts/{accountid}/resources/{resourceid}/authenticationpolicy

Some endpoint URIs include required path parameters. For example, this endpoint URI must include the {accountid} and {resourceid} path parameters:

https://api.usa.cloud.watchguard.com/rest/authpoint/authentication/{v1}/accounts/{accountid}/resources/{resourceid}/authenticationpolicy

Query Parameters

 

Optional query parameters to filter or limit the requested data. For example:

?startDate=2019-01-01&endDate=2019-02-01

Each endpoint supports different query parameters.

Request Headers

 

Information to include in the HTTP request header.

You must include these custom headers in all requests:

  • Authorization — The access token that you received from the WatchGuard Authentication API. For more information, see Authentication.
  • Content-Type — Specifies the format of the request body, such as application/json.
  • WatchGuard-API-Key — The API Key associated with your WatchGuard Cloud account (shown on the Managed Access page in WatchGuard Cloud). For more information, see Enable API Access.

In curl, you specify custom headers with the -H command. For example:

curl -X POST \ https://api.usa.cloud.watchguard.com/rest/authpoint/authentication/v1/accounts/ACC-1234567/resources/1234/authenticationpolicy \
-H 'Authorization: Bearer eyJraWQiOiJNWnpabklNK2V6Q3BXUE5mM2FXTHhoSmEza0ltcEFMbnluT05DcFdIT2tZPSIsImFsZyI6IlJTMjU2In0.eyJzdWIiOiJjNDQyMTJlMi05MmI1LTRiOTYtYTRmNS1lYWRlODA4OTM1YjIiLCJjdXN0b206YXBpX2tleXMiOiJwMHM1UmQzUkF2NlR2d0VuWEx5YUphR2x0ZWtieEFVUzcwVGVzOXlGIiwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLXdlc3QtMi5hbWF6b25hd3MuY29tXC91cy13ZXN0LTJfa3hXeFdrTFZ5IiwiY29nbml0bzp1c2VybmFtZSI6IjAyNjk0OWM1OWI2NzIxOGNfcndfaWQiLCJhdWQiOiIzb3AybDBqazkxN3FudXFoZnVoanRvcXRzZyIsImV2ZW50X2lkIjoiODczM2ZmMjktOGNhMC00ODMyLTg0NzgtMDNiNWIxMDI3NmQ3IiwidG9rZW5fdXNlIjoiaWQiLCJhdXRoX3RpbWUiOjE1NjkzNTM0NDEsIm5hbWUiOiIwMjY5NDljNTliNjcyMThjX3J3X2lkIiwiY3VzdG9tOmFjY291bnRfaWQiOiJBQ0MtMTIzNTA2OCIsImV4cCI6MTU2OTM1NzA0MSwiY3VzdG9tOnJvbGUiOiIxIiwiaWF0IjoxNTY5MzUzNDQxfQ.MUAeG6QyM7Zog8mM--WK2uJVevLRwz8z2KPpGhQbUnHK04Hy_JdO4F4wH6IV0WVENGsBrcjp5boxcBZgdJE46123MGnB0HvghN5IoAZUOkfFPm7SAN68posHqYLoo14YNedc5GtvOzCxTmi9YepvE5LhsoC6Tgyc0e3ABn18gEZsyxmJFcMBHXOMei7AssYSWAdDyoI7j6jZslxmhXj7_h6T9PyqjLxLjFEq5S6oK9u4IVDVBlRxbURaRVAGb7ywfHiZEPDgceV-Wnv0AIhDzj5dL28AmiGIkWtWinF0UD-NSMKN4vtszK2sUWUSl8ZfVNGU650heiAaUAy7XmiqbA' \
-H 'Content-Type: application/json' \
-H 'WatchGuard-API-Key: s9t7El6RZFg8UcmRhYKdwXqBhyuioiWER83Nqd0tL' \
-d '{
	"login": "jdoe",
	"originIpAddress": "198.51.100.98"
	}'
                            

Request Body

 

Data to submit with the API request.

Some API endpoints require that you include data in JSON format in the request body.

In curl, you specify the data to submit with the -d command. For example:

-d '{
	"login": "jdoe",
	"originIpAddress": "198.51.100.98"
	}'