losant_rest 1.8.7 → 1.8.9
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 +38618 -21196
- data/docs/application.md +76 -0
- data/docs/auth.md +0 -36
- data/docs/dashboards.md +1 -1
- data/docs/dataTableRows.md +2 -2
- data/docs/device.md +1 -0
- data/docs/events.md +81 -0
- data/docs/file.md +43 -0
- data/docs/me.md +50 -13
- data/lib/losant_rest.rb +0 -4
- data/lib/losant_rest/application.rb +90 -0
- data/lib/losant_rest/application_api_token.rb +2 -0
- data/lib/losant_rest/application_api_tokens.rb +2 -0
- data/lib/losant_rest/application_certificate.rb +2 -0
- data/lib/losant_rest/application_certificate_authorities.rb +2 -0
- data/lib/losant_rest/application_certificate_authority.rb +2 -0
- data/lib/losant_rest/application_certificates.rb +2 -0
- data/lib/losant_rest/application_key.rb +2 -0
- data/lib/losant_rest/application_keys.rb +2 -0
- data/lib/losant_rest/applications.rb +2 -0
- data/lib/losant_rest/audit_log.rb +2 -0
- data/lib/losant_rest/audit_logs.rb +2 -0
- data/lib/losant_rest/auth.rb +2 -42
- data/lib/losant_rest/client.rb +2 -18
- data/lib/losant_rest/dashboard.rb +2 -0
- data/lib/losant_rest/dashboards.rb +3 -1
- data/lib/losant_rest/data.rb +2 -0
- data/lib/losant_rest/data_table.rb +2 -0
- data/lib/losant_rest/data_table_row.rb +2 -0
- data/lib/losant_rest/data_table_rows.rb +4 -2
- data/lib/losant_rest/data_tables.rb +2 -0
- data/lib/losant_rest/device.rb +4 -0
- data/lib/losant_rest/device_recipe.rb +2 -0
- data/lib/losant_rest/device_recipes.rb +2 -0
- data/lib/losant_rest/devices.rb +2 -0
- data/lib/losant_rest/edge_deployments.rb +2 -0
- data/lib/losant_rest/event.rb +2 -0
- data/lib/losant_rest/events.rb +103 -0
- data/lib/losant_rest/experience.rb +2 -0
- data/lib/losant_rest/experience_domain.rb +2 -0
- data/lib/losant_rest/experience_domains.rb +2 -0
- data/lib/losant_rest/experience_endpoint.rb +2 -0
- data/lib/losant_rest/experience_endpoints.rb +2 -0
- data/lib/losant_rest/experience_group.rb +2 -0
- data/lib/losant_rest/experience_groups.rb +2 -0
- data/lib/losant_rest/experience_slug.rb +2 -0
- data/lib/losant_rest/experience_slugs.rb +2 -0
- data/lib/losant_rest/experience_user.rb +2 -0
- data/lib/losant_rest/experience_users.rb +2 -0
- data/lib/losant_rest/experience_version.rb +2 -0
- data/lib/losant_rest/experience_versions.rb +2 -0
- data/lib/losant_rest/experience_view.rb +2 -0
- data/lib/losant_rest/experience_views.rb +2 -0
- data/lib/losant_rest/file.rb +2 -0
- data/lib/losant_rest/files.rb +2 -0
- data/lib/losant_rest/flow.rb +2 -0
- data/lib/losant_rest/flow_version.rb +2 -0
- data/lib/losant_rest/flow_versions.rb +2 -0
- data/lib/losant_rest/flows.rb +2 -0
- data/lib/losant_rest/integration.rb +2 -0
- data/lib/losant_rest/integrations.rb +2 -0
- data/lib/losant_rest/me.rb +57 -13
- data/lib/losant_rest/notebook.rb +2 -0
- data/lib/losant_rest/notebooks.rb +2 -0
- data/lib/losant_rest/org.rb +2 -0
- data/lib/losant_rest/org_invites.rb +2 -0
- data/lib/losant_rest/orgs.rb +2 -0
- data/lib/losant_rest/version.rb +1 -1
- data/lib/losant_rest/webhook.rb +2 -0
- data/lib/losant_rest/webhooks.rb +2 -0
- data/schemas/advancedEventQuery.json +817 -0
- data/schemas/{dataTableQuery.json → advancedQuery.json} +5 -4
- data/schemas/apiTokens.json +4 -1
- data/schemas/application.json +30 -1
- data/schemas/applicationApiTokenPost.json +5 -0
- data/schemas/applicationCertificate.json +29 -1
- data/schemas/applicationCertificateAuthorities.json +36 -3
- data/schemas/applicationCertificateAuthority.json +32 -2
- data/schemas/applicationCertificateAuthorityPatch.json +3 -1
- data/schemas/applicationCertificateAuthorityPost.json +3 -1
- data/schemas/applicationCertificatePatch.json +3 -1
- data/schemas/applicationCertificatePost.json +3 -1
- data/schemas/applicationCertificates.json +33 -2
- data/schemas/applicationKeys.json +4 -1
- data/schemas/applicationPatch.json +28 -0
- data/schemas/applicationPost.json +28 -0
- data/schemas/applications.json +34 -2
- data/schemas/auditLog.json +0 -3
- data/schemas/auditLogFilter.json +0 -3
- data/schemas/auditLogs.json +4 -4
- data/schemas/authedDevice.json +7 -0
- data/schemas/dashboard.json +3970 -72
- data/schemas/dashboardPatch.json +3969 -72
- data/schemas/dashboardPost.json +3969 -72
- data/schemas/dashboardSendReport.json +4 -0
- data/schemas/dashboardUpdateEvents.json +46 -0
- data/schemas/dashboards.json +3974 -73
- data/schemas/dataTableRows.json +4 -1
- data/schemas/dataTableRowsExport.json +11 -7
- data/schemas/dataTables.json +4 -1
- data/schemas/deviceRecipes.json +4 -1
- data/schemas/devices.json +4 -1
- data/schemas/event.json +19 -2
- data/schemas/eventPost.json +0 -1
- data/schemas/eventTagsSummary.json +28 -0
- data/schemas/events.json +841 -3
- data/schemas/eventsDeleted.json +9 -0
- data/schemas/eventsExport.json +830 -0
- data/schemas/experienceDomain.json +6 -2
- data/schemas/experienceDomainPatch.json +14 -10
- data/schemas/experienceDomainPost.json +8 -4
- data/schemas/experienceDomains.json +6 -2
- data/schemas/experienceEndpoints.json +4 -1
- data/schemas/experienceGroup.json +2 -2
- data/schemas/experienceGroupPatch.json +2 -2
- data/schemas/experienceGroupPost.json +2 -2
- data/schemas/experienceGroups.json +6 -3
- data/schemas/experienceSlugPatch.json +2 -2
- data/schemas/experienceSlugPost.json +2 -2
- data/schemas/experienceUsers.json +4 -1
- data/schemas/experienceViews.json +4 -1
- data/schemas/files.json +4 -1
- data/schemas/flow.json +4 -0
- data/schemas/flowPatch.json +6 -2
- data/schemas/flowPost.json +4 -0
- data/schemas/flowVersion.json +8 -0
- data/schemas/flowVersionPost.json +4 -0
- data/schemas/flowVersions.json +12 -1
- data/schemas/flows.json +8 -1
- data/schemas/flowsImportPost.json +10 -2
- data/schemas/flowsImportResult.json +12 -0
- data/schemas/githubLogin.json +6 -15
- data/schemas/integrations.json +4 -1
- data/schemas/notebooks.json +4 -1
- data/schemas/org.json +2 -4
- data/schemas/orgPatch.json +2 -1
- data/schemas/orgPost.json +2 -1
- data/schemas/orgs.json +6 -5
- data/schemas/passwordResetFinish.json +0 -4
- data/schemas/passwordResetInput.json +0 -4
- data/schemas/resourceTransfer.json +0 -8
- data/schemas/userCredentials.json +6 -15
- data/schemas/userPost.json +6 -15
- data/schemas/webhooks.json +4 -1
- data/test/basic_test.rb +15 -0
- metadata +8 -23
- data/docs/solution.md +0 -133
- data/docs/solutionUser.md +0 -139
- data/docs/solutionUsers.md +0 -96
- data/docs/solutions.md +0 -91
- data/lib/losant_rest/solution.rb +0 -174
- data/lib/losant_rest/solution_user.rb +0 -180
- data/lib/losant_rest/solution_users.rb +0 -138
- data/lib/losant_rest/solutions.rb +0 -134
- data/schemas/authedSolutionUser.json +0 -18
- data/schemas/fileUploadPostResp.json +0 -109
- data/schemas/solution.json +0 -76
- data/schemas/solutionMe.json +0 -150
- data/schemas/solutionPatch.json +0 -48
- data/schemas/solutionPost.json +0 -52
- data/schemas/solutionUser.json +0 -103
- data/schemas/solutionUserCredentials.json +0 -34
- data/schemas/solutionUserPatch.json +0 -74
- data/schemas/solutionUserPost.json +0 -80
- data/schemas/solutionUsers.json +0 -149
- data/schemas/solutions.json +0 -118
data/lib/losant_rest/devices.rb
CHANGED
data/lib/losant_rest/event.rb
CHANGED
data/lib/losant_rest/events.rb
CHANGED
@@ -20,6 +20,8 @@
|
|
20
20
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
21
|
# SOFTWARE.
|
22
22
|
|
23
|
+
require "json"
|
24
|
+
|
23
25
|
module LosantRest
|
24
26
|
|
25
27
|
# Class containing all the actions for the Events Resource
|
@@ -29,6 +31,98 @@ module LosantRest
|
|
29
31
|
@client = client
|
30
32
|
end
|
31
33
|
|
34
|
+
# Delete events
|
35
|
+
#
|
36
|
+
# Authentication:
|
37
|
+
# The client must be configured with a valid api
|
38
|
+
# access token to call this action. The token
|
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, events.*, or events.delete.
|
41
|
+
#
|
42
|
+
# Parameters:
|
43
|
+
# * {string} applicationId - ID associated with the application
|
44
|
+
# * {hash} query - Query to apply to filter the events (https://api.losant.com/#/definitions/advancedEventQuery)
|
45
|
+
# * {string} losantdomain - Domain scope of request (rarely needed)
|
46
|
+
# * {boolean} _actions - Return resource actions in response
|
47
|
+
# * {boolean} _links - Return resource link in response
|
48
|
+
# * {boolean} _embedded - Return embedded resources in response
|
49
|
+
#
|
50
|
+
# Responses:
|
51
|
+
# * 200 - If request successfully deletes a set of Events (https://api.losant.com/#/definitions/eventsDeleted)
|
52
|
+
#
|
53
|
+
# Errors:
|
54
|
+
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
55
|
+
# * 404 - Error if events were not found (https://api.losant.com/#/definitions/error)
|
56
|
+
def delete(params = {})
|
57
|
+
params = Utils.symbolize_hash_keys(params)
|
58
|
+
query_params = { _actions: false, _links: true, _embedded: true }
|
59
|
+
headers = {}
|
60
|
+
body = nil
|
61
|
+
|
62
|
+
raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
|
63
|
+
|
64
|
+
body = params[:query] if params.has_key?(:query)
|
65
|
+
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
66
|
+
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
67
|
+
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|
68
|
+
query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
|
69
|
+
|
70
|
+
path = "/applications/#{params[:applicationId]}/events/delete"
|
71
|
+
|
72
|
+
@client.request(
|
73
|
+
method: :post,
|
74
|
+
path: path,
|
75
|
+
query: query_params,
|
76
|
+
headers: headers,
|
77
|
+
body: body)
|
78
|
+
end
|
79
|
+
|
80
|
+
# Request an export of an application's event data
|
81
|
+
#
|
82
|
+
# Authentication:
|
83
|
+
# The client must be configured with a valid api
|
84
|
+
# access token to call this action. The token
|
85
|
+
# must include at least one of the following scopes:
|
86
|
+
# all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, events.*, or events.export.
|
87
|
+
#
|
88
|
+
# Parameters:
|
89
|
+
# * {string} applicationId - ID associated with the application
|
90
|
+
# * {hash} exportData - Export options for events (https://api.losant.com/#/definitions/eventsExport)
|
91
|
+
# * {string} losantdomain - Domain scope of request (rarely needed)
|
92
|
+
# * {boolean} _actions - Return resource actions in response
|
93
|
+
# * {boolean} _links - Return resource link in response
|
94
|
+
# * {boolean} _embedded - Return embedded resources in response
|
95
|
+
#
|
96
|
+
# Responses:
|
97
|
+
# * 200 - If generation of export was successfully started (https://api.losant.com/#/definitions/success)
|
98
|
+
#
|
99
|
+
# Errors:
|
100
|
+
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
101
|
+
# * 404 - Error if application was not found (https://api.losant.com/#/definitions/error)
|
102
|
+
def export(params = {})
|
103
|
+
params = Utils.symbolize_hash_keys(params)
|
104
|
+
query_params = { _actions: false, _links: true, _embedded: true }
|
105
|
+
headers = {}
|
106
|
+
body = nil
|
107
|
+
|
108
|
+
raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
|
109
|
+
|
110
|
+
body = params[:exportData] if params.has_key?(:exportData)
|
111
|
+
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
112
|
+
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
113
|
+
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|
114
|
+
query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
|
115
|
+
|
116
|
+
path = "/applications/#{params[:applicationId]}/events/export"
|
117
|
+
|
118
|
+
@client.request(
|
119
|
+
method: :post,
|
120
|
+
path: path,
|
121
|
+
query: query_params,
|
122
|
+
headers: headers,
|
123
|
+
body: body)
|
124
|
+
end
|
125
|
+
|
32
126
|
# Returns the events for an application
|
33
127
|
#
|
34
128
|
# Authentication:
|
@@ -46,6 +140,7 @@ module LosantRest
|
|
46
140
|
# * {string} filterField - Field to filter the results by. Blank or not provided means no filtering. Accepted values are: subject
|
47
141
|
# * {string} filter - Filter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering.
|
48
142
|
# * {string} state - If provided, return events only in the given state. Accepted values are: new, acknowledged, resolved
|
143
|
+
# * {hash} query - Event filter JSON object which overides the filterField, filter, and state parameters. (https://api.losant.com/#/definitions/advancedEventQuery)
|
49
144
|
# * {string} losantdomain - Domain scope of request (rarely needed)
|
50
145
|
# * {boolean} _actions - Return resource actions in response
|
51
146
|
# * {boolean} _links - Return resource link in response
|
@@ -72,6 +167,8 @@ module LosantRest
|
|
72
167
|
query_params[:filterField] = params[:filterField] if params.has_key?(:filterField)
|
73
168
|
query_params[:filter] = params[:filter] if params.has_key?(:filter)
|
74
169
|
query_params[:state] = params[:state] if params.has_key?(:state)
|
170
|
+
query_params[:query] = params[:query] if params.has_key?(:query)
|
171
|
+
query_params[:query] = JSON.dump(query_params[:query]) if query_params.has_key?(:query)
|
75
172
|
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
76
173
|
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
77
174
|
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|
@@ -98,6 +195,7 @@ module LosantRest
|
|
98
195
|
# Parameters:
|
99
196
|
# * {string} applicationId - ID associated with the application
|
100
197
|
# * {string} filter - Filter to apply against event subjects. Supports globbing. Blank or not provided means no filtering.
|
198
|
+
# * {hash} query - Event filter JSON object which overides the filter parameter. (https://api.losant.com/#/definitions/advancedEventQuery)
|
101
199
|
# * {string} losantdomain - Domain scope of request (rarely needed)
|
102
200
|
# * {boolean} _actions - Return resource actions in response
|
103
201
|
# * {boolean} _links - Return resource link in response
|
@@ -117,6 +215,8 @@ module LosantRest
|
|
117
215
|
raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
|
118
216
|
|
119
217
|
query_params[:filter] = params[:filter] if params.has_key?(:filter)
|
218
|
+
query_params[:query] = params[:query] if params.has_key?(:query)
|
219
|
+
query_params[:query] = JSON.dump(query_params[:query]) if query_params.has_key?(:query)
|
120
220
|
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
121
221
|
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
122
222
|
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|
@@ -145,6 +245,7 @@ module LosantRest
|
|
145
245
|
# * {string} filterField - Field to filter the events to act on by. Blank or not provided means no filtering. Accepted values are: subject
|
146
246
|
# * {string} filter - Filter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering.
|
147
247
|
# * {string} state - If provided, act on events only in the given state. Accepted values are: new, acknowledged, resolved
|
248
|
+
# * {hash} query - Event filter JSON object which overides the filterField, filter, and state parameters. (https://api.losant.com/#/definitions/advancedEventQuery)
|
148
249
|
# * {hash} updates - Object containing updated information for the events (https://api.losant.com/#/definitions/eventPatch)
|
149
250
|
# * {string} losantdomain - Domain scope of request (rarely needed)
|
150
251
|
# * {boolean} _actions - Return resource actions in response
|
@@ -169,6 +270,8 @@ module LosantRest
|
|
169
270
|
query_params[:filterField] = params[:filterField] if params.has_key?(:filterField)
|
170
271
|
query_params[:filter] = params[:filter] if params.has_key?(:filter)
|
171
272
|
query_params[:state] = params[:state] if params.has_key?(:state)
|
273
|
+
query_params[:query] = params[:query] if params.has_key?(:query)
|
274
|
+
query_params[:query] = JSON.dump(query_params[:query]) if query_params.has_key?(:query)
|
172
275
|
body = params[:updates] if params.has_key?(:updates)
|
173
276
|
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
174
277
|
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
data/lib/losant_rest/file.rb
CHANGED
data/lib/losant_rest/files.rb
CHANGED
data/lib/losant_rest/flow.rb
CHANGED
data/lib/losant_rest/flows.rb
CHANGED
data/lib/losant_rest/me.rb
CHANGED
@@ -20,6 +20,8 @@
|
|
20
20
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
21
|
# SOFTWARE.
|
22
22
|
|
23
|
+
require "json"
|
24
|
+
|
23
25
|
module LosantRest
|
24
26
|
|
25
27
|
# Class containing all the actions for the Me Resource
|
@@ -35,7 +37,7 @@ module LosantRest
|
|
35
37
|
# The client must be configured with a valid api
|
36
38
|
# access token to call this action. The token
|
37
39
|
# must include at least one of the following scopes:
|
38
|
-
# all.
|
40
|
+
# all.User, me.*, or me.addRecentItem.
|
39
41
|
#
|
40
42
|
# Parameters:
|
41
43
|
# * {hash} data - Object containing recent item info (https://api.losant.com/#/definitions/recentItem)
|
@@ -79,7 +81,7 @@ module LosantRest
|
|
79
81
|
# The client must be configured with a valid api
|
80
82
|
# access token to call this action. The token
|
81
83
|
# must include at least one of the following scopes:
|
82
|
-
# all.
|
84
|
+
# all.User, me.*, or me.changePassword.
|
83
85
|
#
|
84
86
|
# Parameters:
|
85
87
|
# * {hash} data - Object containing the password change info (https://api.losant.com/#/definitions/changePassword)
|
@@ -123,7 +125,7 @@ module LosantRest
|
|
123
125
|
# The client must be configured with a valid api
|
124
126
|
# access token to call this action. The token
|
125
127
|
# must include at least one of the following scopes:
|
126
|
-
# all.
|
128
|
+
# all.User, me.*, or me.delete.
|
127
129
|
#
|
128
130
|
# Parameters:
|
129
131
|
# * {hash} credentials - User authentication credentials (https://api.losant.com/#/definitions/userCredentials)
|
@@ -167,7 +169,7 @@ module LosantRest
|
|
167
169
|
# The client must be configured with a valid api
|
168
170
|
# access token to call this action. The token
|
169
171
|
# must include at least one of the following scopes:
|
170
|
-
# all.
|
172
|
+
# all.User, me.*, or me.disableTwoFactorAuth.
|
171
173
|
#
|
172
174
|
# Parameters:
|
173
175
|
# * {hash} data - Object containing two factor auth properties (https://api.losant.com/#/definitions/disableTwoFactorAuth)
|
@@ -211,7 +213,7 @@ module LosantRest
|
|
211
213
|
# The client must be configured with a valid api
|
212
214
|
# access token to call this action. The token
|
213
215
|
# must include at least one of the following scopes:
|
214
|
-
# all.
|
216
|
+
# all.User, me.*, or me.disconnectGithub.
|
215
217
|
#
|
216
218
|
# Parameters:
|
217
219
|
# * {string} losantdomain - Domain scope of request (rarely needed)
|
@@ -252,7 +254,7 @@ module LosantRest
|
|
252
254
|
# The client must be configured with a valid api
|
253
255
|
# access token to call this action. The token
|
254
256
|
# must include at least one of the following scopes:
|
255
|
-
# all.
|
257
|
+
# all.User, me.*, or me.disconnectTwitter.
|
256
258
|
#
|
257
259
|
# Parameters:
|
258
260
|
# * {string} losantdomain - Domain scope of request (rarely needed)
|
@@ -293,7 +295,7 @@ module LosantRest
|
|
293
295
|
# The client must be configured with a valid api
|
294
296
|
# access token to call this action. The token
|
295
297
|
# must include at least one of the following scopes:
|
296
|
-
# all.
|
298
|
+
# all.User, me.*, or me.enableTwoFactorAuth.
|
297
299
|
#
|
298
300
|
# Parameters:
|
299
301
|
# * {hash} data - Object containing two factor auth properties (https://api.losant.com/#/definitions/enableTwoFactorAuth)
|
@@ -337,7 +339,7 @@ module LosantRest
|
|
337
339
|
# The client must be configured with a valid api
|
338
340
|
# access token to call this action. The token
|
339
341
|
# must include at least one of the following scopes:
|
340
|
-
# all.
|
342
|
+
# all.User, all.User.read, me.*, or me.fetchRecentItems.
|
341
343
|
#
|
342
344
|
# Parameters:
|
343
345
|
# * {string} parentId - Parent id of the recent list
|
@@ -383,7 +385,7 @@ module LosantRest
|
|
383
385
|
# The client must be configured with a valid api
|
384
386
|
# access token to call this action. The token
|
385
387
|
# must include at least one of the following scopes:
|
386
|
-
# all.
|
388
|
+
# all.User, all.User.read, me.*, or me.get.
|
387
389
|
#
|
388
390
|
# Parameters:
|
389
391
|
# * {undefined} includeRecent - Should the user include recent app/dashboard info
|
@@ -429,7 +431,7 @@ module LosantRest
|
|
429
431
|
# The client must be configured with a valid api
|
430
432
|
# access token to call this action. The token
|
431
433
|
# must include at least one of the following scopes:
|
432
|
-
# all.
|
434
|
+
# all.User, me.*, or me.patch.
|
433
435
|
#
|
434
436
|
# Parameters:
|
435
437
|
# * {hash} user - Object containing new user properties (https://api.losant.com/#/definitions/mePatch)
|
@@ -477,7 +479,7 @@ module LosantRest
|
|
477
479
|
# The client must be configured with a valid api
|
478
480
|
# access token to call this action. The token
|
479
481
|
# must include at least one of the following scopes:
|
480
|
-
# all.
|
482
|
+
# all.User, all.User.read, me.*, or me.payloadCounts.
|
481
483
|
#
|
482
484
|
# Parameters:
|
483
485
|
# * {string} start - Start of range for payload count query (ms since epoch)
|
@@ -516,13 +518,55 @@ module LosantRest
|
|
516
518
|
body: body)
|
517
519
|
end
|
518
520
|
|
521
|
+
# Returns a new auth token based on the current auth token
|
522
|
+
#
|
523
|
+
# Authentication:
|
524
|
+
# The client must be configured with a valid api
|
525
|
+
# access token to call this action. The token
|
526
|
+
# must include at least one of the following scopes:
|
527
|
+
# all.User, or me.*.
|
528
|
+
#
|
529
|
+
# Parameters:
|
530
|
+
# * {string} losantdomain - Domain scope of request (rarely needed)
|
531
|
+
# * {boolean} _actions - Return resource actions in response
|
532
|
+
# * {boolean} _links - Return resource link in response
|
533
|
+
# * {boolean} _embedded - Return embedded resources in response
|
534
|
+
#
|
535
|
+
# Responses:
|
536
|
+
# * 200 - Successful token regeneration (https://api.losant.com/#/definitions/authedUser)
|
537
|
+
#
|
538
|
+
# Errors:
|
539
|
+
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
540
|
+
# * 401 - Unauthorized error if authentication fails (https://api.losant.com/#/definitions/error)
|
541
|
+
def refresh_token(params = {})
|
542
|
+
params = Utils.symbolize_hash_keys(params)
|
543
|
+
query_params = { _actions: false, _links: true, _embedded: true }
|
544
|
+
headers = {}
|
545
|
+
body = nil
|
546
|
+
|
547
|
+
|
548
|
+
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
549
|
+
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
550
|
+
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|
551
|
+
query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
|
552
|
+
|
553
|
+
path = "/me/refreshToken"
|
554
|
+
|
555
|
+
@client.request(
|
556
|
+
method: :get,
|
557
|
+
path: path,
|
558
|
+
query: query_params,
|
559
|
+
headers: headers,
|
560
|
+
body: body)
|
561
|
+
end
|
562
|
+
|
519
563
|
# Moves resources to a new owner
|
520
564
|
#
|
521
565
|
# Authentication:
|
522
566
|
# The client must be configured with a valid api
|
523
567
|
# access token to call this action. The token
|
524
568
|
# must include at least one of the following scopes:
|
525
|
-
# all.
|
569
|
+
# all.User, me.*, or me.transferResources.
|
526
570
|
#
|
527
571
|
# Parameters:
|
528
572
|
# * {hash} transfer - Object containing properties of the transfer (https://api.losant.com/#/definitions/resourceTransfer)
|
@@ -566,7 +610,7 @@ module LosantRest
|
|
566
610
|
# The client must be configured with a valid api
|
567
611
|
# access token to call this action. The token
|
568
612
|
# must include at least one of the following scopes:
|
569
|
-
# all.
|
613
|
+
# all.User, me.*, or me.verifyEmail.
|
570
614
|
#
|
571
615
|
# Parameters:
|
572
616
|
# * {string} losantdomain - Domain scope of request (rarely needed)
|