losant_rest 1.13.0 → 1.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/docs/_schemas.md +19437 -10622
- data/docs/application.md +6 -6
- data/docs/applicationApiTokens.md +1 -1
- data/docs/applications.md +1 -1
- data/docs/dataTable.md +1 -1
- data/docs/dataTableRows.md +1 -1
- data/docs/dataTables.md +1 -1
- data/docs/device.md +43 -0
- data/docs/devices.md +41 -2
- data/docs/edgeDeployment.md +49 -0
- data/docs/embeddedDeployment.md +49 -0
- data/docs/embeddedDeployments.md +215 -0
- data/docs/experience.md +1 -1
- data/docs/experienceDomains.md +1 -1
- data/docs/experienceGroup.md +2 -0
- data/docs/experienceSlugs.md +1 -1
- data/docs/experienceVersion.md +3 -3
- data/docs/experienceVersions.md +2 -2
- data/docs/experienceView.md +4 -4
- data/docs/experienceViews.md +2 -2
- data/docs/file.md +5 -5
- data/docs/files.md +2 -2
- data/docs/flow.md +3 -3
- data/docs/flowVersions.md +44 -0
- data/docs/flows.md +2 -2
- data/docs/instance.md +40 -0
- data/docs/instanceApiToken.md +133 -0
- data/docs/instanceApiTokens.md +91 -0
- data/docs/instanceMembers.md +1 -1
- data/docs/instanceOrg.md +2 -0
- data/docs/instanceOrgInvite.md +139 -0
- data/docs/instanceOrgInvites.md +96 -0
- data/docs/instanceOrgMembers.md +3 -3
- data/docs/instanceOrgs.md +1 -1
- data/docs/me.md +1 -1
- data/docs/org.md +1 -1
- data/docs/userApiToken.md +125 -0
- data/docs/userApiTokens.md +87 -0
- data/lib/losant_rest/application.rb +5 -5
- data/lib/losant_rest/application_api_tokens.rb +1 -1
- data/lib/losant_rest/applications.rb +1 -1
- data/lib/losant_rest/client.rb +38 -2
- data/lib/losant_rest/data_table.rb +1 -1
- data/lib/losant_rest/data_table_rows.rb +1 -1
- data/lib/losant_rest/data_tables.rb +1 -1
- data/lib/losant_rest/device.rb +50 -0
- data/lib/losant_rest/devices.rb +48 -2
- data/lib/losant_rest/edge_deployment.rb +81 -0
- data/lib/losant_rest/embedded_deployment.rb +81 -0
- data/lib/losant_rest/embedded_deployments.rb +280 -0
- data/lib/losant_rest/experience.rb +1 -1
- data/lib/losant_rest/experience_domains.rb +1 -1
- data/lib/losant_rest/experience_group.rb +4 -0
- data/lib/losant_rest/experience_slugs.rb +1 -1
- data/lib/losant_rest/experience_version.rb +3 -3
- data/lib/losant_rest/experience_versions.rb +2 -2
- data/lib/losant_rest/experience_view.rb +4 -4
- data/lib/losant_rest/experience_views.rb +2 -2
- data/lib/losant_rest/file.rb +4 -4
- data/lib/losant_rest/files.rb +2 -2
- data/lib/losant_rest/flow.rb +3 -3
- data/lib/losant_rest/flow_versions.rb +50 -0
- data/lib/losant_rest/flows.rb +2 -2
- data/lib/losant_rest/instance.rb +47 -1
- data/lib/losant_rest/instance_api_token.rb +176 -0
- data/lib/losant_rest/instance_api_tokens.rb +136 -0
- data/lib/losant_rest/instance_member.rb +1 -1
- data/lib/losant_rest/instance_members.rb +2 -2
- data/lib/losant_rest/instance_org.rb +5 -1
- data/lib/losant_rest/instance_org_invite.rb +182 -0
- data/lib/losant_rest/instance_org_invites.rb +138 -0
- data/lib/losant_rest/instance_org_member.rb +1 -1
- data/lib/losant_rest/instance_org_members.rb +4 -4
- data/lib/losant_rest/instance_orgs.rb +3 -3
- data/lib/losant_rest/instances.rb +1 -1
- data/lib/losant_rest/user_api_token.rb +170 -0
- data/lib/losant_rest/user_api_tokens.rb +132 -0
- data/lib/losant_rest/version.rb +1 -1
- data/lib/losant_rest.rb +9 -0
- data/schemas/apiToken.json +2 -1
- data/schemas/apiTokenPost.json +439 -0
- data/schemas/apiTokens.json +4 -2
- data/schemas/application.json +32 -32
- data/schemas/applicationCreationByTemplateResult.json +32 -32
- data/schemas/applicationDashboardPost.json +28 -21
- data/schemas/applicationPatch.json +13 -13
- data/schemas/applicationPost.json +13 -13
- data/schemas/applicationTemplate.json +16 -16
- data/schemas/applicationTemplates.json +16 -16
- data/schemas/applications.json +32 -32
- data/schemas/auditLog.json +4 -0
- data/schemas/auditLogFilter.json +4 -0
- data/schemas/auditLogs.json +4 -0
- data/schemas/authedDevice.json +2 -1
- data/schemas/bulkDeleteResponse.json +12 -0
- data/schemas/dashboard.json +28 -21
- data/schemas/dashboardPatch.json +28 -21
- data/schemas/dashboardPost.json +28 -21
- data/schemas/dashboardSendReport.json +9 -5
- data/schemas/dashboards.json +28 -21
- data/schemas/dataTableRowsDelete.json +1 -1
- data/schemas/device.json +2 -1
- data/schemas/deviceClassFilter.json +4 -2
- data/schemas/devicePatch.json +2 -1
- data/schemas/devicePayloadCounts.json +24 -0
- data/schemas/devicePost.json +2 -1
- data/schemas/deviceRecipe.json +2 -1
- data/schemas/deviceRecipePatch.json +2 -1
- data/schemas/deviceRecipePost.json +2 -1
- data/schemas/deviceRecipes.json +2 -1
- data/schemas/devices.json +4 -2
- data/schemas/devicesExportPayloadCountPost.json +1350 -0
- data/schemas/devicesPatch.json +4 -2
- data/schemas/edgeDeployment.json +20 -0
- data/schemas/edgeDeployments.json +20 -0
- data/schemas/embeddedDeployment.json +179 -0
- data/schemas/embeddedDeploymentExport.json +44 -0
- data/schemas/embeddedDeploymentRelease.json +58 -0
- data/schemas/embeddedDeploymentRemove.json +25 -0
- data/schemas/embeddedDeploymentReplace.json +29 -0
- data/schemas/embeddedDeployments.json +212 -0
- data/schemas/eventsDeleted.json +1 -1
- data/schemas/experienceEndpoint.json +6 -8
- data/schemas/experienceEndpointPatch.json +6 -8
- data/schemas/experienceEndpointPost.json +6 -8
- data/schemas/experienceEndpoints.json +6 -8
- data/schemas/experienceGroup.json +6 -0
- data/schemas/experienceGroups.json +6 -0
- data/schemas/experienceLinkedResources.json +790 -85
- data/schemas/flow.json +252 -16
- data/schemas/flowPatch.json +251 -16
- data/schemas/flowPost.json +252 -16
- data/schemas/flowVersion.json +503 -33
- data/schemas/flowVersionPost.json +251 -16
- data/schemas/flowVersions.json +503 -33
- data/schemas/flowVersionsDeletePost.json +941 -0
- data/schemas/flows.json +253 -16
- data/schemas/flowsImportPost.json +503 -32
- data/schemas/flowsImportResult.json +785 -79
- data/schemas/githubLogin.json +38 -1
- data/schemas/historicalSummary.json +150 -102
- data/schemas/instance.json +150 -77
- data/schemas/instanceMember.json +10 -0
- data/schemas/instanceMemberPost.json +18 -3
- data/schemas/instanceMembers.json +14 -0
- data/schemas/instanceOrg.json +87 -74
- data/schemas/instanceOrgMember.json +14 -0
- data/schemas/instanceOrgMembers.json +8 -0
- data/schemas/instanceOrgPatch.json +64 -26
- data/schemas/instanceOrgPost.json +229 -25
- data/schemas/instanceOrgs.json +91 -74
- data/schemas/instancePatch.json +67 -0
- data/schemas/instanceReportOptionsPost.json +1 -0
- data/schemas/me.json +134 -105
- data/schemas/notebook.json +45 -0
- data/schemas/notebookPatch.json +30 -0
- data/schemas/notebookPost.json +30 -0
- data/schemas/notebooks.json +45 -0
- data/schemas/org.json +145 -110
- data/schemas/orgInvite.json +90 -0
- data/schemas/orgInviteCollection.json +130 -0
- data/schemas/orgInvites.json +82 -77
- data/schemas/orgRoleInfo.json +69 -0
- data/schemas/orgs.json +145 -110
- data/schemas/payloadStats.json +28 -12
- data/schemas/userCredentials.json +38 -1
- data/schemas/userPost.json +38 -1
- data/schemas/validateContextError.json +34 -0
- data/schemas/validateContextSuccess.json +34 -0
- data/schemas/virtualButtonPress.json +4 -0
- metadata +39 -6
@@ -0,0 +1,96 @@
|
|
1
|
+
# Instance Org Invites Actions
|
2
|
+
|
3
|
+
Details on the various actions that can be performed on the
|
4
|
+
Instance Org Invites resource, including the expected
|
5
|
+
parameters and the potential responses.
|
6
|
+
|
7
|
+
##### Contents
|
8
|
+
|
9
|
+
* [Get](#get)
|
10
|
+
* [Post](#post)
|
11
|
+
|
12
|
+
<br/>
|
13
|
+
|
14
|
+
## Get
|
15
|
+
|
16
|
+
Returns a collection of instance organization invites
|
17
|
+
|
18
|
+
```ruby
|
19
|
+
result = client.instance_org_invites.get(
|
20
|
+
instanceId: my_instance_id,
|
21
|
+
orgId: my_org_id)
|
22
|
+
|
23
|
+
puts result
|
24
|
+
```
|
25
|
+
|
26
|
+
#### Authentication
|
27
|
+
The client must be configured with a valid api access token to call this
|
28
|
+
action. The token must include at least one of the following scopes:
|
29
|
+
all.Instance, all.Instance.read, all.User, all.User.read, instanceOrgInvites.*, or instanceOrgInvites.get.
|
30
|
+
|
31
|
+
#### Available Parameters
|
32
|
+
|
33
|
+
| Name | Type | Required | Description | Default | Example |
|
34
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
35
|
+
| instanceId | string | Y | ID associated with the instance | | 575ec8687ae143cd83dc4a97 |
|
36
|
+
| orgId | string | Y | ID associated with the organization | | 575ec8687ae143cd83dc4a97 |
|
37
|
+
| sortField | string | N | Field to sort the results by. Accepted values are: email, role, inviteDate | inviteDate | role |
|
38
|
+
| sortDirection | string | N | Direction to sort the results by. Accepted values are: asc, desc | desc | asc |
|
39
|
+
| filterField | string | N | Field to filter the results by. Blank or not provided means no filtering. Accepted values are: email, role | | email |
|
40
|
+
| filter | string | N | Filter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering. | | my * instance |
|
41
|
+
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
|
42
|
+
|
43
|
+
#### Successful Responses
|
44
|
+
|
45
|
+
| Code | Type | Description |
|
46
|
+
| ---- | ---- | ----------- |
|
47
|
+
| 200 | [Instance Organization Invitations](_schemas.md#instance-organization-invitations) | A collection of instance organization invitations |
|
48
|
+
|
49
|
+
#### Error Responses
|
50
|
+
|
51
|
+
| Code | Type | Description |
|
52
|
+
| ---- | ---- | ----------- |
|
53
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
54
|
+
| 404 | [Error](_schemas.md#error) | Error if instance or organization was not found |
|
55
|
+
|
56
|
+
<br/>
|
57
|
+
|
58
|
+
## Post
|
59
|
+
|
60
|
+
Invites a member to an instance organization
|
61
|
+
|
62
|
+
```ruby
|
63
|
+
result = client.instance_org_invites.post(
|
64
|
+
instanceId: my_instance_id,
|
65
|
+
orgId: my_org_id,
|
66
|
+
invite: my_invite)
|
67
|
+
|
68
|
+
puts result
|
69
|
+
```
|
70
|
+
|
71
|
+
#### Authentication
|
72
|
+
The client must be configured with a valid api access token to call this
|
73
|
+
action. The token must include at least one of the following scopes:
|
74
|
+
all.Instance, all.User, instanceOrgInvites.*, or instanceOrgInvites.post.
|
75
|
+
|
76
|
+
#### Available Parameters
|
77
|
+
|
78
|
+
| Name | Type | Required | Description | Default | Example |
|
79
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
80
|
+
| instanceId | string | Y | ID associated with the instance | | 575ec8687ae143cd83dc4a97 |
|
81
|
+
| orgId | string | Y | ID associated with the organization | | 575ec8687ae143cd83dc4a97 |
|
82
|
+
| invite | [Organization Invitation Post](_schemas.md#organization-invitation-post) | Y | Object containing new invite info | | [Organization Invitation Post Example](_schemas.md#organization-invitation-post-example) |
|
83
|
+
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
|
84
|
+
|
85
|
+
#### Successful Responses
|
86
|
+
|
87
|
+
| Code | Type | Description |
|
88
|
+
| ---- | ---- | ----------- |
|
89
|
+
| 201 | [Instance Organization Invitations](_schemas.md#instance-organization-invitations) | The new organization invite |
|
90
|
+
|
91
|
+
#### Error Responses
|
92
|
+
|
93
|
+
| Code | Type | Description |
|
94
|
+
| ---- | ---- | ----------- |
|
95
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
96
|
+
| 404 | [Error](_schemas.md#error) | Error if instance or organization was not found |
|
data/docs/instanceOrgMembers.md
CHANGED
@@ -13,7 +13,7 @@ parameters and the potential responses.
|
|
13
13
|
|
14
14
|
## Get
|
15
15
|
|
16
|
-
Returns
|
16
|
+
Returns a collection of instance organization members
|
17
17
|
|
18
18
|
```ruby
|
19
19
|
result = client.instance_org_members.get(
|
@@ -33,7 +33,7 @@ all.Instance, all.Instance.read, all.User, all.User.read, instanceOrgMembers.*,
|
|
33
33
|
| Name | Type | Required | Description | Default | Example |
|
34
34
|
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
35
35
|
| instanceId | string | Y | ID associated with the instance | | 575ec8687ae143cd83dc4a97 |
|
36
|
-
| orgId | string | Y | ID associated with the
|
36
|
+
| orgId | string | Y | ID associated with the organization | | 575ec8687ae143cd83dc4a97 |
|
37
37
|
| sortField | string | N | Field to sort the results by. Accepted values are: email, role | email | role |
|
38
38
|
| sortDirection | string | N | Direction to sort the results by. Accepted values are: asc, desc | asc | asc |
|
39
39
|
| filterField | string | N | Field to filter the results by. Blank or not provided means no filtering. Accepted values are: email, role | | email |
|
@@ -78,7 +78,7 @@ all.Instance, all.User, instanceOrgMembers.*, or instanceOrgMembers.post.
|
|
78
78
|
| Name | Type | Required | Description | Default | Example |
|
79
79
|
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
80
80
|
| instanceId | string | Y | ID associated with the instance | | 575ec8687ae143cd83dc4a97 |
|
81
|
-
| orgId | string | Y | ID associated with the
|
81
|
+
| orgId | string | Y | ID associated with the organization | | 575ec8687ae143cd83dc4a97 |
|
82
82
|
| member | [Instance Org Member Post](_schemas.md#instance-org-member-post) | Y | Object containing new member info | | [Instance Org Member Post Example](_schemas.md#instance-org-member-post-example) |
|
83
83
|
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
|
84
84
|
|
data/docs/instanceOrgs.md
CHANGED
@@ -37,7 +37,6 @@ all.Instance, all.Instance.read, all.User, all.User.read, instanceOrgs.*, or ins
|
|
37
37
|
| perPage | string | N | How many items to return per page | 100 | 10 |
|
38
38
|
| filterField | string | N | Field to filter the results by. Blank or not provided means no filtering. Accepted values are: name | | name |
|
39
39
|
| filter | string | N | Filter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering. | | my*org |
|
40
|
-
| summaryExclude | string | N | Comma-separated list of summary fields to exclude from org summaries | | payloadCount |
|
41
40
|
| summaryInclude | string | N | Comma-separated list of summary fields to include in org summary | | payloadCount |
|
42
41
|
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
|
43
42
|
|
@@ -75,6 +74,7 @@ all.Instance, all.User, instanceOrgs.*, or instanceOrgs.post.
|
|
75
74
|
| Name | Type | Required | Description | Default | Example |
|
76
75
|
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
77
76
|
| instanceId | string | Y | ID associated with the instance | | 575ec8687ae143cd83dc4a97 |
|
77
|
+
| summaryInclude | string | N | Comma-separated list of summary fields to include in org summary | | payloadCount |
|
78
78
|
| orgConfig | [Instance Owned Organization Post](_schemas.md#instance-owned-organization-post) | N | Object containing configurations for the new organization | | [Instance Owned Organization Post Example](_schemas.md#instance-owned-organization-post-example) |
|
79
79
|
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
|
80
80
|
|
data/docs/me.md
CHANGED
@@ -376,7 +376,7 @@ all.User, all.User.read, me.*, or me.payloadCounts.
|
|
376
376
|
|
377
377
|
| Code | Type | Description |
|
378
378
|
| ---- | ---- | ----------- |
|
379
|
-
| 200 | [Payload
|
379
|
+
| 200 | [Payload Stats](_schemas.md#payload-stats) | Payload counts, by type and source |
|
380
380
|
|
381
381
|
#### Error Responses
|
382
382
|
|
data/docs/org.md
CHANGED
@@ -247,7 +247,7 @@ all.Organization, all.Organization.read, all.User, all.User.read, org.*, or org.
|
|
247
247
|
|
248
248
|
| Code | Type | Description |
|
249
249
|
| ---- | ---- | ----------- |
|
250
|
-
| 200 | [Payload
|
250
|
+
| 200 | [Payload Stats](_schemas.md#payload-stats) | Payload counts, by type and source |
|
251
251
|
|
252
252
|
#### Error Responses
|
253
253
|
|
@@ -0,0 +1,125 @@
|
|
1
|
+
# User Api Token Actions
|
2
|
+
|
3
|
+
Details on the various actions that can be performed on the
|
4
|
+
User Api Token resource, including the expected
|
5
|
+
parameters and the potential responses.
|
6
|
+
|
7
|
+
##### Contents
|
8
|
+
|
9
|
+
* [Delete](#delete)
|
10
|
+
* [Get](#get)
|
11
|
+
* [Patch](#patch)
|
12
|
+
|
13
|
+
<br/>
|
14
|
+
|
15
|
+
## Delete
|
16
|
+
|
17
|
+
Deletes an API Token
|
18
|
+
|
19
|
+
```ruby
|
20
|
+
result = client.user_api_token.delete(apiTokenId: my_api_token_id)
|
21
|
+
|
22
|
+
puts result
|
23
|
+
```
|
24
|
+
|
25
|
+
#### Authentication
|
26
|
+
The client must be configured with a valid api access token to call this
|
27
|
+
action. The token must include at least one of the following scopes:
|
28
|
+
all.User, userApiToken.*, or userApiToken.delete.
|
29
|
+
|
30
|
+
#### Available Parameters
|
31
|
+
|
32
|
+
| Name | Type | Required | Description | Default | Example |
|
33
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
34
|
+
| apiTokenId | string | Y | ID associated with the API token | | 575ec7417ae143cd83dc4a95 |
|
35
|
+
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
|
36
|
+
|
37
|
+
#### Successful Responses
|
38
|
+
|
39
|
+
| Code | Type | Description |
|
40
|
+
| ---- | ---- | ----------- |
|
41
|
+
| 200 | [Success](_schemas.md#success) | If API token was successfully deleted |
|
42
|
+
|
43
|
+
#### Error Responses
|
44
|
+
|
45
|
+
| Code | Type | Description |
|
46
|
+
| ---- | ---- | ----------- |
|
47
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
48
|
+
| 404 | [Error](_schemas.md#error) | Error if API token was not found |
|
49
|
+
|
50
|
+
<br/>
|
51
|
+
|
52
|
+
## Get
|
53
|
+
|
54
|
+
Retrieves information on an API token
|
55
|
+
|
56
|
+
```ruby
|
57
|
+
result = client.user_api_token.get(apiTokenId: my_api_token_id)
|
58
|
+
|
59
|
+
puts result
|
60
|
+
```
|
61
|
+
|
62
|
+
#### Authentication
|
63
|
+
The client must be configured with a valid api access token to call this
|
64
|
+
action. The token must include at least one of the following scopes:
|
65
|
+
all.User, all.User.read, userApiToken.*, or userApiToken.get.
|
66
|
+
|
67
|
+
#### Available Parameters
|
68
|
+
|
69
|
+
| Name | Type | Required | Description | Default | Example |
|
70
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
71
|
+
| apiTokenId | string | Y | ID associated with the API token | | 575ec7417ae143cd83dc4a95 |
|
72
|
+
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
|
73
|
+
|
74
|
+
#### Successful Responses
|
75
|
+
|
76
|
+
| Code | Type | Description |
|
77
|
+
| ---- | ---- | ----------- |
|
78
|
+
| 200 | [API Token](_schemas.md#api-token) | API token information |
|
79
|
+
|
80
|
+
#### Error Responses
|
81
|
+
|
82
|
+
| Code | Type | Description |
|
83
|
+
| ---- | ---- | ----------- |
|
84
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
85
|
+
| 404 | [Error](_schemas.md#error) | Error if API token was not found |
|
86
|
+
|
87
|
+
<br/>
|
88
|
+
|
89
|
+
## Patch
|
90
|
+
|
91
|
+
Updates information about an API token
|
92
|
+
|
93
|
+
```ruby
|
94
|
+
result = client.user_api_token.patch(
|
95
|
+
apiTokenId: my_api_token_id,
|
96
|
+
apiToken: my_api_token)
|
97
|
+
|
98
|
+
puts result
|
99
|
+
```
|
100
|
+
|
101
|
+
#### Authentication
|
102
|
+
The client must be configured with a valid api access token to call this
|
103
|
+
action. The token must include at least one of the following scopes:
|
104
|
+
all.User, userApiToken.*, or userApiToken.patch.
|
105
|
+
|
106
|
+
#### Available Parameters
|
107
|
+
|
108
|
+
| Name | Type | Required | Description | Default | Example |
|
109
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
110
|
+
| apiTokenId | string | Y | ID associated with the API token | | 575ec7417ae143cd83dc4a95 |
|
111
|
+
| apiToken | [API Token Patch](_schemas.md#api-token-patch) | Y | Object containing new properties of the API token | | [API Token Patch Example](_schemas.md#api-token-patch-example) |
|
112
|
+
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
|
113
|
+
|
114
|
+
#### Successful Responses
|
115
|
+
|
116
|
+
| Code | Type | Description |
|
117
|
+
| ---- | ---- | ----------- |
|
118
|
+
| 200 | [API Token](_schemas.md#api-token) | Updated API token information |
|
119
|
+
|
120
|
+
#### Error Responses
|
121
|
+
|
122
|
+
| Code | Type | Description |
|
123
|
+
| ---- | ---- | ----------- |
|
124
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
125
|
+
| 404 | [Error](_schemas.md#error) | Error if API token was not found |
|
@@ -0,0 +1,87 @@
|
|
1
|
+
# User Api Tokens Actions
|
2
|
+
|
3
|
+
Details on the various actions that can be performed on the
|
4
|
+
User Api Tokens resource, including the expected
|
5
|
+
parameters and the potential responses.
|
6
|
+
|
7
|
+
##### Contents
|
8
|
+
|
9
|
+
* [Get](#get)
|
10
|
+
* [Post](#post)
|
11
|
+
|
12
|
+
<br/>
|
13
|
+
|
14
|
+
## Get
|
15
|
+
|
16
|
+
Returns the API tokens for a user
|
17
|
+
|
18
|
+
```ruby
|
19
|
+
result = client.user_api_tokens.get(optional_params)
|
20
|
+
|
21
|
+
puts result
|
22
|
+
```
|
23
|
+
|
24
|
+
#### Authentication
|
25
|
+
The client must be configured with a valid api access token to call this
|
26
|
+
action. The token must include at least one of the following scopes:
|
27
|
+
all.User, all.User.read, userApiTokens.*, or userApiTokens.get.
|
28
|
+
|
29
|
+
#### Available Parameters
|
30
|
+
|
31
|
+
| Name | Type | Required | Description | Default | Example |
|
32
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
33
|
+
| sortField | string | N | Field to sort the results by. Accepted values are: name, status, id, creationDate, lastUpdated, expirationDate | name | name |
|
34
|
+
| sortDirection | string | N | Direction to sort the results by. Accepted values are: asc, desc | asc | asc |
|
35
|
+
| page | string | N | Which page of results to return | 0 | 0 |
|
36
|
+
| perPage | string | N | How many items to return per page | 100 | 10 |
|
37
|
+
| filterField | string | N | Field to filter the results by. Blank or not provided means no filtering. Accepted values are: name, status | | key |
|
38
|
+
| filter | string | N | Filter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering. | | my*token |
|
39
|
+
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
|
40
|
+
|
41
|
+
#### Successful Responses
|
42
|
+
|
43
|
+
| Code | Type | Description |
|
44
|
+
| ---- | ---- | ----------- |
|
45
|
+
| 200 | [API Token](_schemas.md#api-token) | Collection of API tokens |
|
46
|
+
|
47
|
+
#### Error Responses
|
48
|
+
|
49
|
+
| Code | Type | Description |
|
50
|
+
| ---- | ---- | ----------- |
|
51
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
52
|
+
|
53
|
+
<br/>
|
54
|
+
|
55
|
+
## Post
|
56
|
+
|
57
|
+
Create a new API token for an user
|
58
|
+
|
59
|
+
```ruby
|
60
|
+
result = client.user_api_tokens.post(apiToken: my_api_token)
|
61
|
+
|
62
|
+
puts result
|
63
|
+
```
|
64
|
+
|
65
|
+
#### Authentication
|
66
|
+
The client must be configured with a valid api access token to call this
|
67
|
+
action. The token must include at least one of the following scopes:
|
68
|
+
all.User, userApiTokens.*, or userApiTokens.post.
|
69
|
+
|
70
|
+
#### Available Parameters
|
71
|
+
|
72
|
+
| Name | Type | Required | Description | Default | Example |
|
73
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
74
|
+
| apiToken | [API Token Post](_schemas.md#api-token-post) | Y | API token information | | [API Token Post Example](_schemas.md#api-token-post-example) |
|
75
|
+
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
|
76
|
+
|
77
|
+
#### Successful Responses
|
78
|
+
|
79
|
+
| Code | Type | Description |
|
80
|
+
| ---- | ---- | ----------- |
|
81
|
+
| 201 | [API Token](_schemas.md#api-token) | The successfully created API token |
|
82
|
+
|
83
|
+
#### Error Responses
|
84
|
+
|
85
|
+
| Code | Type | Description |
|
86
|
+
| ---- | ---- | ----------- |
|
87
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
@@ -405,7 +405,7 @@ module LosantRest
|
|
405
405
|
# The client must be configured with a valid api
|
406
406
|
# access token to call this action. The token
|
407
407
|
# must include at least one of the following scopes:
|
408
|
-
# all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, application.*, or application.get.
|
408
|
+
# all.Application, all.Application.cli, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.cli, all.User.read, application.*, or application.get.
|
409
409
|
#
|
410
410
|
# Parameters:
|
411
411
|
# * {string} applicationId - ID of the associated application
|
@@ -453,7 +453,7 @@ module LosantRest
|
|
453
453
|
# The client must be configured with a valid api
|
454
454
|
# access token to call this action. The token
|
455
455
|
# must include at least one of the following scopes:
|
456
|
-
# all.Application, all.Organization, all.User, application.*, or application.patch.
|
456
|
+
# all.Application, all.Application.cli, all.Organization, all.User, all.User.cli, application.*, or application.patch.
|
457
457
|
#
|
458
458
|
# Parameters:
|
459
459
|
# * {string} applicationId - ID of the associated application
|
@@ -547,7 +547,7 @@ module LosantRest
|
|
547
547
|
# The client must be configured with a valid api
|
548
548
|
# access token to call this action. The token
|
549
549
|
# must include at least one of the following scopes:
|
550
|
-
# all.Application, all.Organization, all.User, application.*, or application.patch.
|
550
|
+
# all.Application, all.Application.cli, all.Organization, all.User, all.User.cli, application.*, or application.patch.
|
551
551
|
#
|
552
552
|
# Parameters:
|
553
553
|
# * {string} applicationId - ID of the associated application
|
@@ -646,7 +646,7 @@ module LosantRest
|
|
646
646
|
# The client must be configured with a valid api
|
647
647
|
# access token to call this action. The token
|
648
648
|
# must include at least one of the following scopes:
|
649
|
-
# all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, application.*, or application.get.
|
649
|
+
# all.Application, all.Application.cli, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.cli, all.User.read, application.*, or application.get.
|
650
650
|
#
|
651
651
|
# Parameters:
|
652
652
|
# * {string} applicationId - ID of the associated application
|
@@ -690,7 +690,7 @@ module LosantRest
|
|
690
690
|
# The client must be configured with a valid api
|
691
691
|
# access token to call this action. The token
|
692
692
|
# must include at least one of the following scopes:
|
693
|
-
# all.Application, all.Organization, all.User, application.*, or application.patch.
|
693
|
+
# all.Application, all.Application.cli, all.Organization, all.User, all.User.cli, application.*, or application.patch.
|
694
694
|
#
|
695
695
|
# Parameters:
|
696
696
|
# * {string} applicationId - ID of the associated application
|
@@ -96,7 +96,7 @@ module LosantRest
|
|
96
96
|
#
|
97
97
|
# Parameters:
|
98
98
|
# * {string} applicationId - ID associated with the application
|
99
|
-
# * {hash} apiToken - API token information (https://api.losant.com/#/definitions/
|
99
|
+
# * {hash} apiToken - API token information (https://api.losant.com/#/definitions/apiTokenPost)
|
100
100
|
# * {string} losantdomain - Domain scope of request (rarely needed)
|
101
101
|
# * {boolean} _actions - Return resource actions in response
|
102
102
|
# * {boolean} _links - Return resource link in response
|
@@ -37,7 +37,7 @@ module LosantRest
|
|
37
37
|
# The client must be configured with a valid api
|
38
38
|
# access token to call this action. The token
|
39
39
|
# must include at least one of the following scopes:
|
40
|
-
# all.Organization, all.Organization.read, all.User, all.User.read, applications.*, or applications.get.
|
40
|
+
# all.Organization, all.Organization.read, all.User, all.User.cli, all.User.read, applications.*, or applications.get.
|
41
41
|
#
|
42
42
|
# Parameters:
|
43
43
|
# * {string} sortField - Field to sort the results by. Accepted values are: name, id, creationDate, ownerId, lastUpdated
|
data/lib/losant_rest/client.rb
CHANGED
@@ -27,7 +27,7 @@ module LosantRest
|
|
27
27
|
#
|
28
28
|
# User API for accessing Losant data
|
29
29
|
#
|
30
|
-
# Built For Version 1.
|
30
|
+
# Built For Version 1.22.0
|
31
31
|
class Client
|
32
32
|
attr_accessor :auth_token, :url
|
33
33
|
|
@@ -148,10 +148,22 @@ module LosantRest
|
|
148
148
|
@devices ||= Devices.new(self)
|
149
149
|
end
|
150
150
|
|
151
|
+
def edge_deployment
|
152
|
+
@edge_deployment ||= EdgeDeployment.new(self)
|
153
|
+
end
|
154
|
+
|
151
155
|
def edge_deployments
|
152
156
|
@edge_deployments ||= EdgeDeployments.new(self)
|
153
157
|
end
|
154
158
|
|
159
|
+
def embedded_deployment
|
160
|
+
@embedded_deployment ||= EmbeddedDeployment.new(self)
|
161
|
+
end
|
162
|
+
|
163
|
+
def embedded_deployments
|
164
|
+
@embedded_deployments ||= EmbeddedDeployments.new(self)
|
165
|
+
end
|
166
|
+
|
155
167
|
def event
|
156
168
|
@event ||= Event.new(self)
|
157
169
|
end
|
@@ -248,6 +260,14 @@ module LosantRest
|
|
248
260
|
@instance ||= Instance.new(self)
|
249
261
|
end
|
250
262
|
|
263
|
+
def instance_api_token
|
264
|
+
@instance_api_token ||= InstanceApiToken.new(self)
|
265
|
+
end
|
266
|
+
|
267
|
+
def instance_api_tokens
|
268
|
+
@instance_api_tokens ||= InstanceApiTokens.new(self)
|
269
|
+
end
|
270
|
+
|
251
271
|
def instance_member
|
252
272
|
@instance_member ||= InstanceMember.new(self)
|
253
273
|
end
|
@@ -260,6 +280,14 @@ module LosantRest
|
|
260
280
|
@instance_org ||= InstanceOrg.new(self)
|
261
281
|
end
|
262
282
|
|
283
|
+
def instance_org_invite
|
284
|
+
@instance_org_invite ||= InstanceOrgInvite.new(self)
|
285
|
+
end
|
286
|
+
|
287
|
+
def instance_org_invites
|
288
|
+
@instance_org_invites ||= InstanceOrgInvites.new(self)
|
289
|
+
end
|
290
|
+
|
263
291
|
def instance_org_member
|
264
292
|
@instance_org_member ||= InstanceOrgMember.new(self)
|
265
293
|
end
|
@@ -308,6 +336,14 @@ module LosantRest
|
|
308
336
|
@orgs ||= Orgs.new(self)
|
309
337
|
end
|
310
338
|
|
339
|
+
def user_api_token
|
340
|
+
@user_api_token ||= UserApiToken.new(self)
|
341
|
+
end
|
342
|
+
|
343
|
+
def user_api_tokens
|
344
|
+
@user_api_tokens ||= UserApiTokens.new(self)
|
345
|
+
end
|
346
|
+
|
311
347
|
def webhook
|
312
348
|
@webhook ||= Webhook.new(self)
|
313
349
|
end
|
@@ -322,7 +358,7 @@ module LosantRest
|
|
322
358
|
|
323
359
|
headers["Accept"] = "application/json"
|
324
360
|
headers["Content-Type"] = "application/json"
|
325
|
-
headers["Accept-Version"] = "^1.
|
361
|
+
headers["Accept-Version"] = "^1.22.0"
|
326
362
|
headers["Authorization"] = "Bearer #{self.auth_token}" if self.auth_token
|
327
363
|
path = self.url + options.fetch(:path, "")
|
328
364
|
|
@@ -132,7 +132,7 @@ module LosantRest
|
|
132
132
|
# The client must be configured with a valid api
|
133
133
|
# access token to call this action. The token
|
134
134
|
# must include at least one of the following scopes:
|
135
|
-
# all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, dataTable.*, or dataTable.get.
|
135
|
+
# all.Application, all.Application.cli, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.cli, all.User.read, dataTable.*, or dataTable.get.
|
136
136
|
#
|
137
137
|
# Parameters:
|
138
138
|
# * {string} applicationId - ID associated with the application
|
@@ -136,7 +136,7 @@ module LosantRest
|
|
136
136
|
# The client must be configured with a valid api
|
137
137
|
# access token to call this action. The token
|
138
138
|
# must include at least one of the following scopes:
|
139
|
-
# all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, dataTableRows.*, or dataTableRows.get.
|
139
|
+
# all.Application, all.Application.cli, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.cli, all.User.read, dataTableRows.*, or dataTableRows.get.
|
140
140
|
#
|
141
141
|
# Parameters:
|
142
142
|
# * {string} applicationId - ID associated with the application
|
@@ -37,7 +37,7 @@ module LosantRest
|
|
37
37
|
# The client must be configured with a valid api
|
38
38
|
# access token to call this action. The token
|
39
39
|
# must include at least one of the following scopes:
|
40
|
-
# all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, dataTables.*, or dataTables.get.
|
40
|
+
# all.Application, all.Application.cli, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.cli, all.User.read, dataTables.*, or dataTables.get.
|
41
41
|
#
|
42
42
|
# Parameters:
|
43
43
|
# * {string} applicationId - ID associated with the application
|
data/lib/losant_rest/device.rb
CHANGED
@@ -438,6 +438,56 @@ module LosantRest
|
|
438
438
|
body: body)
|
439
439
|
end
|
440
440
|
|
441
|
+
# Returns payload counts for the time range specified for this device
|
442
|
+
#
|
443
|
+
# Authentication:
|
444
|
+
# The client must be configured with a valid api
|
445
|
+
# access token to call this action. The token
|
446
|
+
# must include at least one of the following scopes:
|
447
|
+
# all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, device.*, or device.payloadCounts.
|
448
|
+
#
|
449
|
+
# Parameters:
|
450
|
+
# * {string} applicationId - ID associated with the application
|
451
|
+
# * {string} deviceId - ID associated with the device
|
452
|
+
# * {string} start - Start of range for payload count query (ms since epoch)
|
453
|
+
# * {string} end - End of range for payload count query (ms since epoch)
|
454
|
+
# * {string} losantdomain - Domain scope of request (rarely needed)
|
455
|
+
# * {boolean} _actions - Return resource actions in response
|
456
|
+
# * {boolean} _links - Return resource link in response
|
457
|
+
# * {boolean} _embedded - Return embedded resources in response
|
458
|
+
#
|
459
|
+
# Responses:
|
460
|
+
# * 200 - Payload counts, by type (https://api.losant.com/#/definitions/devicePayloadCounts)
|
461
|
+
#
|
462
|
+
# Errors:
|
463
|
+
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
464
|
+
# * 404 - Error if device was not found (https://api.losant.com/#/definitions/error)
|
465
|
+
def payload_counts(params = {})
|
466
|
+
params = Utils.symbolize_hash_keys(params)
|
467
|
+
query_params = { _actions: false, _links: true, _embedded: true }
|
468
|
+
headers = {}
|
469
|
+
body = nil
|
470
|
+
|
471
|
+
raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
|
472
|
+
raise ArgumentError.new("deviceId is required") unless params.has_key?(:deviceId)
|
473
|
+
|
474
|
+
query_params[:start] = params[:start] if params.has_key?(:start)
|
475
|
+
query_params[:end] = params[:end] if params.has_key?(:end)
|
476
|
+
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
477
|
+
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
478
|
+
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|
479
|
+
query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
|
480
|
+
|
481
|
+
path = "/applications/#{params[:applicationId]}/devices/#{params[:deviceId]}/payloadCounts"
|
482
|
+
|
483
|
+
@client.request(
|
484
|
+
method: :get,
|
485
|
+
path: path,
|
486
|
+
query: query_params,
|
487
|
+
headers: headers,
|
488
|
+
body: body)
|
489
|
+
end
|
490
|
+
|
441
491
|
# Removes all device data for the specified time range. Defaults to all data.
|
442
492
|
#
|
443
493
|
# Authentication:
|