---
title: Retrieving the Authentication DSID
slug: ps/help/en_us/nsa/22x/msp/api/retrieving-the-authentication-dsid
createdAt: 2026-07-22T06:13:53.544Z
---

The Data Set Identification (DSID) is required for API use.

The following CURL command format uses the DSID to query the REST API server:

```bash
curl -v --cookie "DSID=<value>" <api_request_url>
```

The DSID can be retrieved in two ways:

- Using the API, see [Retrieving the DSID Using the API](docId\:OXagpVbmKa9k_UCMTIKCB).
- Using a browser, see [Retrieving the DSID Using a Browser](docId\:OXagpVbmKa9k_UCMTIKCB).

## Retrieving the DSID Using the API

You can use the following code to get a DSID token to use across all API calls:

```bash
def login(url,username,password): tenant_url = url return_dict = {'status': 0} global user_session, dsidlogin_URL = tenant_url + '/login/msp' data = { 'username': username, 'password': password, 'realm': 'ZTA Admin Users', 'btnSubmit': 'Submit', }
user_session = requests.session() r = user_session.get(url=login_URL, verify=False) dssignin = user_session.cookies.get('DSSIGNIN')data = {'username': username,'password': password,'realm': 'ZTA Admin Users','btnContinue': 'Continue the session'} login_cgi = url + '/dana-na/auth/' + dssignin + '/login.cgi' print login_cgi r = user_session.post(url=login_cgi, verify=False, data=data) print('login status code: ', +r.status_code)print('Login_data: ', user_session.cookies) if 'Continue the session' in d: formdatastr = xsauth = None try: p = r'.*name="FormDataStr" value="(.*?)">' x = re.findall(p, d) formdatastr = x[0] except IndexError: print 'Error: unable to get FormDataStr value' try: p = r'.*name="xsauth" value="(.*?)"' x = re.findall(p, d) xsauth = x[0]
except IndexError: print 'Error: unable to get xsauth value' data = {'FormDataStr': formdatastr, 'xsauth': xsauth, 'btnContinue': 'Continue the session'} login_cgi = url + '/dana-na/auth/' + dssignin + '/login.cgi' r = user_session.post(url=login_cgi, verify=False, data=data, allow_redirects=True) dsid = user_session.cookies.get('DSID') print ('DSID: ', dsid) cookies["DSID"]=dsid if dsid is None: raise Exception('LoginError: Unable to get DSID cookie') # self.cookie = dsid session = user_session
```

After the DSID is set in the cookies (refer to code `dsid = user_session.cookies.get('DSID')`) use that session for all other API Calls.

You can use the following CURL command format uses the DSID to query the REST API server:

```bash
curl -v --cookie "DSID=<value>" <api_request_url>
```

The following code demonstrates how to get a list of tenants using the API. It updates the cookie information for DSID from the above code.

```bash
def get_tenants(): input_payload = {"type": "application"}request_uri = host_url + api_version + "msp/tenants" output = requests.get(request_uri, params=input_payload, cookies=cookies)status_code = output.status_coderesponse_json = output.json()print response_json
```

## Retrieving the DSID Using a Browser

You can use a browser to access the DSID. The procedure below describes the process for the *Chrome* browser, but any browser that offers similar tools can also be used.

1. Log in to the MSP Portal interface in the *Chrome* browser.
   The home page appears.
2. Right-click the main map, and select **Inspect** from the context menu.
   The screen divides horizontally and the element view appears to the right of the screen.

:::hint{type="info"}
In the *Edge* browser, you click the **...** control, and then click **Other Tools > Developer Tools**. In the *Firefox* browser, you right-click and select **Inspect Element** from the context menu.
:::

3. In the element view, select the **Network** tab.
4. Select an element from the list of elements (on the left of the tab). For example, *login*, *admin* or *subscriptions*.
   A tab bar appears (on the right of the tab).
5. Select the **Cookies** tab.
   A list of cookies for the page appears.
6. For the *DSID* entry, copy the DSID value and retain this value for future use. For example:

::Image[]{src="https://api.archbee.com/api/optimize/wxZG1KsS4xNkVZYoiu_o9/DGDkg8-S1ixyki6ZXaKNa_ztachromeelements576x262.png" position="flex-start" size="58" width="576" height="262" initialPath="images/zta_chrome_elements_576x262.png" githubPath="images/zta_chrome_elements_576x262.png" showCaption="false"}

You can use the following CURL command format uses the DSID to query the REST API server:

```bash
curl -v --cookie "DSID=<value>" <api_request_url>
```
