How to set monitor location using ASM API call when creating a new ASM monitor
search cancel

How to set monitor location using ASM API call when creating a new ASM monitor

book

Article ID: 240440

calendar_today

Updated On:

Products

CA App Synthetic Monitor

Issue/Introduction

We are creating monitors using automation through the ASM API calls, but we need to specify the locations to be used since our product can only be accessed in the US. How do we set the specific location using the ASM API calls?

Environment

Release : SAAS

Component : APP SYNTHETIC MONITOR ENVIRONMENTAL

Resolution

The ASM DEV team proposed to use the new API (v3).

https://api.asm.saas.broadcom.com/v3/

In the new API (v3) you have to use location IDs instead. The locations can be retrieved by the GET /locations AP call:

 
You can try the following command.

curl -X GET "https://api.asm.saas.broadcom.com/v3/locations/public" -H  "accept: application/json" -H  "Authorization: Basic <token>"

You need to use your own Authorization string.

Here is how you can get the Authorization string for your account.

Go to https://api.asm.saas.broadcom.com/v3

1- Authorize
use your login and API password. 

2- Execute:  Get api-token

once successful, it will have Authorization: Basic <string> in the responses.

copy the string in the Authorization: Basic in the above curl command.

Run the curl command.