Skip to main content

User Oauth Clients Actions

https://api.losant.com/me/oauth-clients

Below are the various requests that can be performed against the User Oauth Clients resource, as well as the expected parameters and the potential responses.

Get​

Returns the private OAuth clients for a user

Method And Url​

GET https://api.losant.com/me/oauth-clients

Authentication​

A valid API access token is required to access this endpoint. The token must include at least one of the following scopes: all.User, all.User.bounded, all.User.read, only.User, only.User.bounded, only.User.read, userOauthClients.*, or userOauthClients.get.

Request Query Parameters​

NameRequiredDescriptionDefaultExample
sortFieldNField to sort the results by. Accepted values are: client_name, id, creationDate, lastUpdatedclient_namesortField=client_name
sortDirectionNDirection to sort the results by. Accepted values are: asc, descascsortDirection=asc
pageNWhich page of results to return0page=0
perPageNHow many items to return per page100perPage=10
filterFieldNField to filter the results by. Blank or not provided means no filtering. Accepted values are: client_namefilterField=client_name
filterNFilter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering.filter=my*app

Request Headers​

NameRequiredDescriptionDefault
AuthorizationYThe token for authenticating the request, prepended with Bearer

Curl Example​

curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X GET \
https://api.losant.com/me/oauth-clients

Successful Responses​

CodeTypeDescription
200User OAuth ClientsCollection of private OAuth clients

Error Responses​

CodeTypeDescription
400ErrorError if malformed request

Post​

Create a new private OAuth client for a user

Method And Url​

POST https://api.losant.com/me/oauth-clients

Authentication​

A valid API access token is required to access this endpoint. The token must include at least one of the following scopes: all.User, only.User, userOauthClients.*, or userOauthClients.post.

Request Headers​

NameRequiredDescriptionDefault
AuthorizationYThe token for authenticating the request, prepended with Bearer

Request Body​

The body of the request should be serialized JSON that validates against the User OAuth Client Post schema. For example, the following would be a valid body for this request:

{
"client_name": "My Private Client",
"description": "Private OAuth client for automation",
"client_uri": "https://example.com",
"logo_uri": "https://example.com/logo.png",
"redirect_uris": [
"https://example.com/callback"
],
"token_endpoint_auth_method": "client_secret_basic",
"scope": [
"only.User.read",
"all.Application.read"
],
"contacts": [
"admin@example.com"
],
"tos_uri": "https://example.com/tos",
"policy_uri": "https://example.com/privacy"
}

Curl Example​

curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X POST \
-d '{"client_name":"My Private Client","description":"Private OAuth client for automation","client_uri":"https://example.com","logo_uri":"https://example.com/logo.png","redirect_uris":["https://example.com/callback"],"token_endpoint_auth_method":"client_secret_basic","scope":["only.User.read","all.Application.read"],"contacts":["admin@example.com"],"tos_uri":"https://example.com/tos","policy_uri":"https://example.com/privacy"}' \
https://api.losant.com/me/oauth-clients

Successful Responses​

CodeTypeDescription
201User OAuth ClientThe successfully created OAuth client. client_secret is only ever returned on this response.

Error Responses​

CodeTypeDescription
400ErrorError if malformed request

Schemas​

Error​

Schema for errors returned by the API

Error Schema​

  • ▶
    {} 3 keys
    • "http://json-schema.org/draft-07/schema#"
    • "object"
    • ▶
      {} 3 keys
      • ▶
        {} 1 key
        • ▶
          {} 1 key
          • ▶
            {} 2 keys

        Error Example​

        • ▶
          {} 2 keys
          • "NotFound"
          • "Application was not found"

        User OAuth Client​

        Schema for a single private OAuth client

        User OAuth Client Schema​

        • ▶
          {} 3 keys
          • "http://json-schema.org/draft-07/schema#"
          • "object"
          • ▶
            {} 17 keys
            • ▶
              {} 2 keys
              • ▶
                {} 2 keys
                • ▶
                  {} 2 keys
                  • ▶
                    {} 2 keys
                    • ▶
                      {} 2 keys
                      • ▶
                        {} 3 keys
                        • ▶
                          {} 2 keys
                          • ▶
                            {} 3 keys
                            • ▶
                              {} 4 keys
                              • ▶
                                {} 5 keys
                                • ▶
                                  {} 3 keys
                                  • ▶
                                    {} 3 keys
                                    • ▶
                                      {} 3 keys
                                      • ▶
                                        {} 4 keys
                                        • ▶
                                          {} 4 keys
                                          • ▶
                                            {} 3 keys
                                            • ▶
                                              {} 3 keys

                                          User OAuth Client Example​

                                          • ▶
                                            {} 17 keys
                                            • "575ec7417ae143cd83dc4a95"
                                            • "2016-06-13T04:00:00.000Z"
                                            • "2016-06-13T04:00:00.000Z"
                                            • "575ec7417ae143cd83dc4a95"
                                            • "8f14e45fceea167a5a36dedd4bea2543"
                                            • "My Private Client"
                                            • "Private OAuth client for automation"
                                            • "https://example.com"
                                            • "https://example.com/logo.png"
                                            • ▶
                                              [] 1 item
                                              • ▶
                                                [] 2 items
                                                • ▶
                                                  [] 1 item
                                                  • "client_secret_basic"
                                                  • ▶
                                                    [] 2 items
                                                    • ▶
                                                      [] 1 item
                                                      • "https://example.com/tos"
                                                      • "https://example.com/privacy"

                                                    User OAuth Client Post​

                                                    Schema for the body of a private OAuth client creation request

                                                    User OAuth Client Post Schema​

                                                    • ▶
                                                      {} 5 keys
                                                      • "http://json-schema.org/draft-07/schema#"
                                                      • "object"
                                                      • ▶
                                                        {} 10 keys
                                                        • ▶
                                                          {} 3 keys
                                                          • ▶
                                                            {} 2 keys
                                                            • ▶
                                                              {} 1 key
                                                              • ▶
                                                                {} 1 key
                                                                • ▶
                                                                  {} 5 keys
                                                                  • ▶
                                                                    {} 3 keys
                                                                    • ▶
                                                                      {} 4 keys
                                                                      • ▶
                                                                        {} 4 keys
                                                                        • ▶
                                                                          {} 1 key
                                                                          • ▶
                                                                            {} 1 key
                                                                          • false
                                                                          • ▶
                                                                            [] 2 items

                                                                          User OAuth Client Post Example​

                                                                          • ▶
                                                                            {} 10 keys
                                                                            • "My Private Client"
                                                                            • "Private OAuth client for automation"
                                                                            • "https://example.com"
                                                                            • "https://example.com/logo.png"
                                                                            • ▶
                                                                              [] 1 item
                                                                              • "client_secret_basic"
                                                                              • ▶
                                                                                [] 2 items
                                                                                • ▶
                                                                                  [] 1 item
                                                                                  • "https://example.com/tos"
                                                                                  • "https://example.com/privacy"

                                                                                User OAuth Clients​

                                                                                Schema for a collection of private OAuth clients

                                                                                User OAuth Clients Schema​

                                                                                • ▶
                                                                                  {} 3 keys
                                                                                  • "http://json-schema.org/draft-07/schema#"
                                                                                  • "object"
                                                                                  • ▶
                                                                                    {} 9 keys
                                                                                    • ▶
                                                                                      {} 2 keys
                                                                                      • ▶
                                                                                        {} 1 key
                                                                                        • ▶
                                                                                          {} 1 key
                                                                                          • ▶
                                                                                            {} 1 key
                                                                                            • ▶
                                                                                              {} 1 key
                                                                                              • ▶
                                                                                                {} 1 key
                                                                                                • ▶
                                                                                                  {} 1 key
                                                                                                  • ▶
                                                                                                    {} 1 key
                                                                                                    • ▶
                                                                                                      {} 2 keys

                                                                                                  User OAuth Clients Example​

                                                                                                  • ▶
                                                                                                    {} 7 keys
                                                                                                    • ▶
                                                                                                      [] 1 item
                                                                                                      • 1
                                                                                                      • 1
                                                                                                      • 1000
                                                                                                      • 0
                                                                                                      • "client_name"
                                                                                                      • "asc"

                                                                                                    Was this page helpful?


                                                                                                    Still looking for help? You can also search the Losant Forums or submit your question there.