You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/UserAgents.md
+22-20
Original file line number
Diff line number
Diff line change
@@ -1,39 +1,42 @@
1
-
<seotitle>Guide: User Agents</seotitle>
2
-
<seodescription>Developers should send unique user agent strings with every API request. In this guide, we cover the basics of formatting and implementation.</seodescription>
1
+
<seotitle>Guide: User agents</seotitle>
2
+
<seodescription>developers must send unique user agent strings with every API request. In this guide, the basics of formatting and implementation are described.
3
+
</seodescription>
3
4
4
5
# User agents
5
6
6
-
When invoking dashboard API, it's best practice to provide a [custom user agent string](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent) with each API request. This helps your customers and Meraki admins monitor API interactions with their environments and helps build their trust. In brief, here are some Dos and Don'ts with user agent strings!
7
+
When you invoke dashboard API, it's best practice to provide a [custom user agent string](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent) with each API request. This helps your customers and Meraki administrators monitor API interactions with their environments and helps build their trust. In brief, here are some Dos and Don'ts with user agent strings.
7
8
8
9
## Dos
9
10
10
-
1. Provide the user agent string in the "User-Agent" header of _every_ API request.
11
-
2. Follow the prescribed format below, which differs minimally from standard practices.
12
-
3. Include only the requested information in your user agent string.
13
-
4. Only use slashes ("/") when optionally providing application version information.
11
+
1. Provide the user agent string in the user agent header of every API request.
12
+
2. Follow the prescribed format below, which differs minimally from standard practices.
13
+
3. Include only the requested information in your user agent string.
14
+
4. Use only slashes ("/") when you optionally provide application version information.
15
+
16
+
14
17
15
18
## Don'ts
16
19
17
-
1. Provide inconsistent or incorrect user agent strings across your application.
18
-
2. Leave out the user agent string from any of your requests.
19
-
3. Add unnecessary information or special characters to your user agent string.
20
-
4. Mix up slashes (e.g. "/") and backslashes (e.g. "\\").
20
+
1. Do not provide inconsistent or incorrect user agent strings across your application.
21
+
2. Do not omit the user agent string from any of your requests.
22
+
3. Do not add unnecessary information or special characters to your user agent string.
23
+
4. Do not mix the forward slash (/) with the backward slash (\).
21
24
22
25
## Formatting
23
26
24
-
Please format your user agent strings accordingly:
27
+
Format your user agent strings as follows:
25
28
26
29
```Template
27
30
ApplicationName VendorName
28
31
```
29
32
30
-
If you want to include version information, do so as follows:
33
+
Include version information as follows:
31
34
32
35
```Template with version string
33
36
ApplicationName/1.0 VendorName
34
37
```
35
38
36
-
Regardless of your branding guidelines, your application name and vendor name *must* omit all spaces, hypens, and special characters. When providing a custom user agent string in API calls, keep in mind that the information is typically exclusively valuable to Meraki dashboard admins, so it's not necessary to include sometimes arcane information, as is common practice amongst web browsers.
39
+
Regardless of your branding guidelines, your application name and vendor name must omit all spaces, hyphens, and special characters. When you provide a custom user agent string in API calls, ensure that the information is typically exclusively useful to Meraki dashboard admins, so it's not necessary to include sometimes arcane information, as is common practice amongst web browsers.
It's usually trivial to add user agent headers to your API requests. All HTTP requests libraries offer some means of appending the User-Agent header to your requests.
71
-
73
+
It's usually trivial to add user agent headers to your API requests. All HTTP request libraries offer some means of appending the user agent header to your requests.
72
74
### Python library
73
75
74
-
If using the Meraki [Python library](pythonLibrary.md), then simply pass the kwarg `caller` in your session definition.
76
+
If you use the Meraki [Python library](pythonLibrary.md), then simply pass the kwarg `caller` in your session definition.
Alternatively, you can modify the library's config.py file to set this globally. [Consult the docs](https://github.com/meraki/dashboard-api-python) for more information.
83
+
Alternatively, you can modify the library's config.py file to set this globally. For more information, see [Official Dashboard API library (SDK) for Python](https://github.com/meraki/dashboard-api-python)
82
84
83
85
### PowerShell
84
86
85
-
If using the `Invoke-WebRequest` method, then provide the `-UserAgent` flag in each of your requests:
87
+
If you use the `Invoke-WebRequest` method, then provide the `-UserAgent` flag in each of your requests:
0 commit comments