Skip to content

Commit

Permalink
Change overview to point at v6 rather than v5
Browse files Browse the repository at this point in the history
Change-type: patch
  • Loading branch information
Page- authored and vipulgupta2048 committed May 23, 2024
1 parent 4897088 commit a812f48
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions pages/reference/api/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ To construct an API call, it helps to understand a little about how the underlyi
Knowing the resource you wish to act upon and the method you wish to act with is enough for some requests. For example, if you want to view all fleets you have access to (which includes public fleets), you can use the `GET` method and the `application` resource. Your API call would look like this:

```shell
curl -X GET "{{ $links.apiBase }}/v5/application" \
curl -X GET "{{ $links.apiBase }}/v6/application" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <AUTH_TOKEN>"
```

If you want to limit this to only return fleets related to the authenticated user, use the `my_application` resource. For example:

```shell
curl -X GET "{{ $links.apiBase }}/v5/my_application" \
curl -X GET "{{ $links.apiBase }}/v6/my_application" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <AUTH_TOKEN>"
```
Expand All @@ -53,31 +53,31 @@ The following API call uses `$select` to only return the name and device type fo

```shell
curl -X GET
"{{ $links.apiBase }}/v5/application?\$select=app_name,device_type" \
"{{ $links.apiBase }}/v6/application?\$select=app_name,device_type" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <AUTH_TOKEN>"
```

In some cases, you'll want to get information for one specific resource, rather than all resources of that type. If you happen to know the resource ID, you can simply append it to the resource name:

```shell
curl -X GET "{{ $links.apiBase }}/v5/device(<ID>)" \
curl -X GET "{{ $links.apiBase }}/v6/device(<ID>)" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <AUTH_TOKEN>"
```

This also works for other pieces of unique information as long as you specify them, eg the device uuid for devices:

```shell
curl -X GET "{{ $links.apiBase }}/v5/device(uuid='<UUID>')" \
curl -X GET "{{ $links.apiBase }}/v6/device(uuid='<UUID>')" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <AUTH_TOKEN>"
```

or for resources where multiple elements combine to be unique, eg for device tags the device and tag key are a unique combination:

```shell
curl -X GET "{{ $links.apiBase }}/v5/device(device=<DEVICE ID>,tag_key='<KEY>')" \
curl -X GET "{{ $links.apiBase }}/v6/device(device=<DEVICE ID>,tag_key='<KEY>')" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <AUTH_TOKEN>"
```
Expand All @@ -87,7 +87,7 @@ Many times, however, you won't know the internal ID or other unique info used by

```shell
curl -X GET \
"{{ $links.apiBase }}/v5/device?\$filter=name%20eq%20'<DEVICE NAME>'" \
"{{ $links.apiBase }}/v6/device?\$filter=name%20eq%20'<DEVICE NAME>'" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <AUTH_TOKEN>"
```
Expand All @@ -98,7 +98,7 @@ A final tip for constructing API calls: for some of the fields in the API respon

```shell
curl -X GET \
"{{ $links.apiBase }}/v5/device(uuid='<UUID>')?\$expand=belongs_to__application" \
"{{ $links.apiBase }}/v6/device(uuid='<UUID>')?\$expand=belongs_to__application" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <AUTH_TOKEN>"
```
Expand All @@ -107,7 +107,7 @@ It's also possible to filter on a field that belongs to a linked resource. To fi

```shell
curl -X GET \
"{{ $links.apiBase }}/v5/device?\$filter=belongs_to__application/app_name%20eq%20'<APP_NAME>'" \
"{{ $links.apiBase }}/v6/device?\$filter=belongs_to__application/app_name%20eq%20'<APP_NAME>'" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <AUTH_TOKEN>"
```
Expand Down

0 comments on commit a812f48

Please sign in to comment.