play

<< Click to Display Table of Contents >>

Navigation:  API > apps >

play

Description

Initiates a Cameyo HTML5 app session.

Syntax

https://api.cameyo.com/apps/[app-id]/play?clientId=...&clientSecret=...&user=user-email&ip=client-ip

Required parameters

app-id: numerical application ID.

user: user account (email address) for the application to be played as. This refers to a Cameyo user account whose profile, identity and settings will be used for the Play session. You can either create a dedicated user for this (api.cameyo.com/users/add) or use an existing user from your organization's Cameyo account.

Optional parameterrs

client-ip: client's IPv4 address. While this parameter is not required, it is recommended, as it will be used for logging and for allowing the IP if PortShield is enabled.

Return

200: success. In this case, a JSON object is returned with a field named redirectUrl. You can then redirect the user's browser to this URL to start the Play session.

400: invalid parameters.

403: authentication failed or insufficient permissions.

Response examples

{"success":true,"message":null,"redirectUrl":"https://online.cameyo.com/app.html?appName=WordPad&token=576ab360-a7ed-450c-b1f8-9c37cb1c8c6c"}

{"success":false,"message":"Invalid pkgId specified","redirectUrl":null}

Best practice

This API should be called through server-side technologies (i.e. ASP.NET, PHP, Node.JS); your clientSecret should never be exposed on the client-side (i.e. HTML Javascript). Once you get a return URL, you can publish it to the client's HTML.

Workflow example

1.Client: https://api.cameyo.com/apps/453345345/play?clientId=[...]&clientSecret=[...]&user=joe@mycompany.com

2.Reply: {"redirectUrl":"https://myserver.cameyo.net/app.html?appName=WordPad&token=a4586831-20e7-4408-a1d0-178e1ae45e34"}

3.Client: redirect user's browser to https://myserver.cameyo.net/app.html?appName=WordPad&token=a4586831-20e7-4408-a1d0-178e1ae45e34