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
If you've registered your service as a [Swiftype Platform Application](https://swiftype.com/documentation/users), you can use this library to create users and take actions on their behalf. (Learn more about the Platform API [here](https://swiftype.com/documentation/users).)
338
-
339
-
First, create a client using your application's `client_id` and `client_secret`
To retrieve a list of the users for your application (pass optional `page` and `per_page` arguments for pagination):
344
-
345
-
platform_client.users()
346
-
347
-
To create a user that is managed by your application:
348
-
349
-
platform_client.create_user()
350
-
351
-
You can also retrieve users by their ID:
352
-
353
-
platform_client.user(12345)
354
-
355
-
To allow your users to access their Swiftype dashboard, route them to their unique SSO URL. This is generated using their user ID (note that this URL expires after 5 minutes, so the URL should be generated at the time the user is requesting access to their dashboard to avoid having to re-generate the URL):
356
-
357
-
platform_client.sso_url(12345)
358
-
359
-
You can also create resources on behalf of a user. To do this, you'll need the user's `access_token`, which is returned when requesting a User resource.
360
-
361
-
First, create a client with the user's `access_token` (note that you shouldn't pass an `api_key` here when creating the client, since you want the requests to take effect on the User's account):
All of the same Engine APIs documented above will work with your new `user_client` object, but resources will be created on behalf of the User's account rather than your own.
0 commit comments