Skip to content

Commit d8192e9

Browse files
authored
Merge pull request #35 from amabdulr/patch-12
Update UserAgents.md
2 parents d8e0671 + 86e2172 commit d8192e9

File tree

1 file changed

+22
-20
lines changed

1 file changed

+22
-20
lines changed

docs/UserAgents.md

+22-20
Original file line numberDiff line numberDiff 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>
34

45
# User agents
56

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

89
## Dos
910

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+
1417

1518
## Don'ts
1619

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 (\).
2124

2225
## Formatting
2326

24-
Please format your user agent strings accordingly:
27+
Format your user agent strings as follows:
2528

2629
``` Template
2730
ApplicationName VendorName
2831
```
2932

30-
If you want to include version information, do so as follows:
33+
Include version information as follows:
3134

3235
``` Template with version string
3336
ApplicationName/1.0 VendorName
3437
```
3538

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

3841
### Examples
3942

@@ -67,22 +70,21 @@ BurrowFinder/2.5 HappyRabbitProductions
6770

6871
## In practice
6972

70-
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.
7274
### Python library
7375

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

7678
``` Python
7779
import meraki
7880
dashboard = meraki.DashboardAPI(caller='PlanetCraftLite/0.8b LunarCommander')
7981
```
8082

81-
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)
8284

8385
### PowerShell
8486

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

8789
``` PowerShell
8890
$userAgent = 'ApplicationName VendorName'
@@ -91,7 +93,7 @@ $apiCallExample = Invoke-WebRequest -URI $uri -Headers $headers -UserAgent $user
9193

9294
### Java
9395

94-
If using the `HttpURLConnection` module, then use `setRequestProperty` to send the user agent:
96+
If you use the `HttpURLConnection` module, then use `setRequestProperty` to send the user agent:
9597

9698
``` Java
9799
import java.net.HttpURLConnection;

0 commit comments

Comments
 (0)