Oauth

Metadata




 
 




Actions

Clients

RESOURCE FIELDS

Name Type Read-only Description
name string The title of the client application
url string The URL to the page about the client application
key string
secret string
Shown only once
scopes array API scopes
logo Logo
description string Short description of what the application does
author string The name of the author of the client application
author_url string The URL to the page about the author
callback_url string The URL of the client application, that will handle OAuth redirects
creator User
last_used_at timestamp
ISO-8601 Format
created_at timestamp
ISO-8601 Format
updated_at timestamp
ISO-8601 Format

RESOURCE FIELDS

Name Type Read-only Description
data buffer
type string
JPEG, PNG or GIF
url string
The URL to view the logo
created_at timestamp
ISO-8601 Format

Retrieve all clients

GET /api/v1/oauth/clients.json

Information

Allowed for Admins & Owners

Response

    {
        "status": 200,
        "data": [




{

    "id": 1,


    "name": "Brewfictus mobile app",
    "url": "https://brewfictus.com/apps/kayako",

    "key": "c054173c-89d2-48c2-b020-1ce3f7874462",
    "secret": null,
    "scopes": [],

    "logo": {
        "url": "https://brewfictus.kayako.com/api/v1/oauth/clients/1/logo",
        "created_at": "2016-12-29T16:07:04+00:00"
    },
    "description": "Support client for mobile devices",
    "author": "Brewfictus",
    "author_url": "https://brewfictus.com",

    "callback_url": "https://brewfictus.com/oauth/callback",
    "creator": 



{
    "id": 1,

    "resource_type": "user"

}
,
    "last_used_at": null,

    "created_at": "2016-12-29T16:06:27+00:00",
    "updated_at": null


    ,"resource_type": "oauth_client"

    ,"resource_url": "https://brewfictus.kayako.com/api/v1/oauth/clients/1"


}

        ],
        "resource": "oauth_client",
        "offset": 0,
        "limit": 10,
        "total_count": 1
    }

Retrieve a client

GET /api/v1/oauth/clients/:id.json

Information

Allowed for Admins & Owners

Response

    {
        "status": 200,
        "data": 



{

    "id": 1,


    "name": "Brewfictus mobile app",
    "url": "https://brewfictus.com/apps/kayako",

    "key": "c054173c-89d2-48c2-b020-1ce3f7874462",
    "secret": null,
    "scopes": [],

    "logo": {
        "url": "https://brewfictus.kayako.com/api/v1/oauth/clients/1/logo",
        "created_at": "2016-12-29T16:07:04+00:00"
    },
    "description": "Support client for mobile devices",
    "author": "Brewfictus",
    "author_url": "https://brewfictus.com",

    "callback_url": "https://brewfictus.com/oauth/callback",
    "creator": 



{
    "id": 1,

    "resource_type": "user"

}
,
    "last_used_at": null,

    "created_at": "2016-12-29T16:06:27+00:00",
    "updated_at": null


    ,"resource_type": "oauth_client"

    ,"resource_url": "https://brewfictus.kayako.com/api/v1/oauth/clients/1"


}
,
        "resource": "oauth_client"
    }

Add a client

POST /api/v1/oauth/clients.json

Information

Allowed for Admins & Owners

Parameters

Name Type Mandatory Description
name string
The title of the client application
url string The URL to the page about the client application
scopes array API scopes allowed for this application
description string Short description of what the application does
author string The name of the author of the client application
author_url string The URL to the page about the author
callback_url string The URL of the client application, that will handle OAuth redirects
logo File Upload Image larger than 100x100 will be scaled down
logo_file_id integer The ID of the image file, see Two-step upload

Response

    {
        "status": 201,
        "data": 



{

    "id": 1,


    "name": "Brewfictus mobile app",
    "url": "https://brewfictus.com/apps/kayako",

    "key": "c054173c-89d2-48c2-b020-1ce3f7874462",
    "secret": "NGQzMDJjYzMtOTAxZS00OGEyLThjNTUtMjkyMzMxN2MyYTA5ZDAxNDhmMWQtYjljNC00MGUxLWFjMTYtMDZjMWRhNjU4Y2Rj",
    "scopes": [],

    "logo": {
        "url": "https://brewfictus.kayako.com/api/v1/oauth/clients/1/logo",
        "created_at": "2016-12-29T16:07:04+00:00"
    },
    "description": "Support client for mobile devices",
    "author": "Brewfictus",
    "author_url": "https://brewfictus.com",

    "callback_url": "https://brewfictus.com/oauth/callback",
    "creator": 



{
    "id": 1,

    "resource_type": "user"

}
,
    "last_used_at": null,

    "created_at": "2016-12-29T16:06:27+00:00",
    "updated_at": null


    ,"resource_type": "oauth_client"

    ,"resource_url": "https://brewfictus.kayako.com/api/v1/oauth/clients/1"


}
,
        "resource": "oauth_client"
    }

Update a client

PUT /api/v1/oauth/clients/:id.json

Information

Allowed for Admins & Owners

Parameters

Name Type Mandatory Description
name string The title of the client application
url string The URL to the page about the client application
scopes array API scopes allowed for this application
description string Short description of what the application does
author string The name of the author of the client application
author_url string The URL to the page about the author
callback_url string The URL of the client application, that will handle OAuth redirects
logo File Upload Image larger than 100x100 will be scaled down
logo_file_id integer The ID of the image file, see Two-step upload

Response

    {
        "status": 200,
        "data": 



{

    "id": 1,


    "name": "Brewfictus mobile app",
    "url": "https://brewfictus.com/apps/kayako",

    "key": "c054173c-89d2-48c2-b020-1ce3f7874462",
    "secret": null,
    "scopes": [],

    "logo": {
        "url": "https://brewfictus.kayako.com/api/v1/oauth/clients/1/logo",
        "created_at": "2016-12-29T16:07:04+00:00"
    },
    "description": "Support client for mobile devices",
    "author": "Brewfictus",
    "author_url": "https://brewfictus.com",

    "callback_url": "https://brewfictus.com/oauth/callback",
    "creator": 



{
    "id": 1,

    "resource_type": "user"

}
,
    "last_used_at": null,

    "created_at": "2016-12-29T16:06:27+00:00",
    "updated_at": null


    ,"resource_type": "oauth_client"

    ,"resource_url": "https://brewfictus.kayako.com/api/v1/oauth/clients/1"


}
,
        "resource": "oauth_client"
    }

Delete a client

DELETE /api/v1/oauth/clients/:id.json

Information

Allowed for Admins & Owners

Response

    {
        "status": 200
    }

Delete clients

DELETE /api/v1/oauth/clients.json

Information

Allowed for Admins & Owners

Arguments

Name Type Mandatory Description
ids string
The comma separated ids

Response

    {
        "status": 200,
        "total_count": 2
    }

User grants

RESOURCE FIELDS

Name Type Read-only Description
user User
client Client
scopes array
API scopes
created_at timestamp
ISO-8601 Format
last_activity_at timestamp
ISO-8601 Format. The timestamp is not accurate.
expiry_at timestamp
ISO-8601 Format

Retrieve user grants

GET /api/v1/oauth/grants.json

Information

Allowed for Admins & Owners

Arguments

Name Type Mandatory Description
user_id integer Filter grants by user ID
client_id integer Filter grants by client ID

Response

    {
        "status": 200,
        "data": [
            {
    "id": 1,
    "user": 



{
    "id": 1,

    "resource_type": "user"

}
,
    "client": 



{

    "id": 1



    ,"resource_type": "oauth_client"


}
,
    "scopes": [ "conversations:write", "configuration:read" ],
    "created_at": "2016-12-16T12:26:43+00:00",
    "last_activity_at": "2017-06-07T18:50:47+00:00",
    "expiry_at": null,
    "resource_type": "oauth_grant",
    "resource_url": "https://brewfictus.kayako.com/api/v1/oauth/grants/1"
}

        ],
        "resource": "oauth_grant",
        "offset": 0,
        "limit": 10,
        "total_count": 1
    }

Retrieve a user grant

GET /api/v1/oauth/grants/:id.json

Information

Allowed for Admins & Owners

Response

    {
        "status": 200,
        "data": {
    "id": 1,
    "user": 



{
    "id": 1,

    "resource_type": "user"

}
,
    "client": 



{

    "id": 1



    ,"resource_type": "oauth_client"


}
,
    "scopes": [ "conversations:write", "configuration:read" ],
    "created_at": "2016-12-16T12:26:43+00:00",
    "last_activity_at": "2017-06-07T18:50:47+00:00",
    "expiry_at": null,
    "resource_type": "oauth_grant",
    "resource_url": "https://brewfictus.kayako.com/api/v1/oauth/grants/1"
}
,
        "resource": "oauth_grant"
    }

Delete a user grant

DELETE /api/v1/oauth/grants/:id.json

Information

Allowed for Admins & Owners

Response

    {
        "status": 200
    }

Delete user grants

DELETE /api/v1/oauth/grants.json

Information

Allowed for Admins & Owners

Arguments

Name Type Mandatory Description
ids string
The comma separated ids

Response

    {
        "status": 200,
        "total_count": 2
    }

Own grants

RESOURCE FIELDS

Name Type Read-only Description
client Client
scopes array
API scopes
created_at timestamp
ISO-8601 Format
last_activity_at timestamp
ISO-8601 Format. The timestamp is not accurate.
expiry_at timestamp
ISO-8601 Format

Client

RESOURCE FIELDS

Name Type Read-only Description
name string
The title of the client application
url string
The URL to the page about the client application
logo Logo
description string
Short description of what the application does
author string
The name of the author of the client application
author_url string
The URL to the page about the author
created_at timestamp
ISO-8601 Format
updated_at timestamp
ISO-8601 Format

Retrieve all own grants

GET /api/v1/oauth/my_grants.json

Information

Allowed for Collaborators, Agents, Admins & Owners

Response

    {
        "status": 200,
        "data": [
            {
    "id": 1,
    "client": 



{


    "name": "Brewfictus mobile app",
    "url": "https://brewfictus.com/apps/kayako",

    "logo": {
        "url": "https://brewfictus.kayako.com/api/v1/oauth/clients/1/logo",
        "created_at": "2016-12-29T16:07:04+00:00"
    },
    "description": "Support client for mobile devices",
    "author": "Brewfictus",
    "author_url": "https://brewfictus.com",

    "created_at": "2016-12-29T16:06:27+00:00",
    "updated_at": null


}
,
    "scopes": [ "conversations:write", "configuration:read" ],
    "created_at": "2016-12-22T15:30:55+00:00",
    "last_activity_at": "2017-06-07T18:51:15+00:00",
    "expiry_at": null,
    "resource_type": "my_oauth_grant",
    "resource_url": "https://brewfictus.kayako.com/api/v1/oauth/my_grants/1"
}

        ],
        "resource": "my_oauth_grant",
        "offset": 0,
        "limit": 10,
        "total_count": 1
    }

Retrieve an own grant

GET /api/v1/oauth/my_grants/:id.json

Information

Allowed for Collaborators, Agents, Admins & Owners

Response

    {
        "status": 200,
        "data": {
    "id": 1,
    "client": 



{


    "name": "Brewfictus mobile app",
    "url": "https://brewfictus.com/apps/kayako",

    "logo": {
        "url": "https://brewfictus.kayako.com/api/v1/oauth/clients/1/logo",
        "created_at": "2016-12-29T16:07:04+00:00"
    },
    "description": "Support client for mobile devices",
    "author": "Brewfictus",
    "author_url": "https://brewfictus.com",

    "created_at": "2016-12-29T16:06:27+00:00",
    "updated_at": null


}
,
    "scopes": [ "conversations:write", "configuration:read" ],
    "created_at": "2016-12-22T15:30:55+00:00",
    "last_activity_at": "2017-06-07T18:51:15+00:00",
    "expiry_at": null,
    "resource_type": "my_oauth_grant",
    "resource_url": "https://brewfictus.kayako.com/api/v1/oauth/my_grants/1"
}
,
        "resource": "my_oauth_grant"
    }

Delete an own grant

DELETE /api/v1/oauth/my_grants/:id.json

Information

Allowed for Collaborators, Agents, Admins & Owners

Response

    {
        "status": 200
    }

Delete own grants

DELETE /api/v1/oauth/my_grants.json

Information

Allowed for Collaborators, Agents, Admins & Owners

Arguments

Name Type Mandatory Description
ids string
The comma separated ids

Response

    {
        "status": 200,
        "total_count": 2
    }