Samba Videos App's
Now you can create APP's to consume our platform. To do this, you only need to use your imagination and follow our development standards.
1 - Always create a specific project where developers can create new app's and test them. See here how to create a new project.
2 - Authorize, in this project for testing, the users with "Developer" profile to create/maintain app's. For further information, see our article.
3 - Only users with Developer profile are able to create new app's, and only the Account Owner can "Enable" the created app's. After installing, the app will be automatically enabled for all users of the account.
Creating an App in Samba Videos
To create a new app in Samba Videos is quite simple. Follow the steps below:
1 - Access the menu App's and click the tab "Settings"
2 - In the app's management area, click button "+Create app"
3 - Fill out the form to create application correctly. Click "Create" to finish the process.
Now we're going to illustrate a standard Manifest (Json) to associate an app with Samba Videos. Json contains information about the app extension points.
Obs: The file with the code above is attached to this article, so you can download it.
After creating the app, a token (App ID) will be generated. It's a unique key for identification in Samba Videos.
The full URL of an extension point is determined by the application domain, concatenated with the prefix "sambaapps" and the "URL_path" extension point: <domain> / sambaapps / <URL_path> .
So, for example, for an app hosted at the domain "http://aplicativo-exemplo.com" and with extention point "/info", the full URL of the extension point will be "http://aplicativo-exemplo.com/sambaapps/info".
An app works as a Samba Videos extension. When accessing the extension point, the corresponding app page is displayed on a iframe in Samba Videos, allowing the user interaction with the app. Information on the user context, such as the current project ID, are provided in the extension points calls in the form of parameters (URL parameters). The available extension points are:
Extension of Samba Videos through tabs accessed from the top menu "App's". There's no restriction on the amount of tabs that a app can have.
Parameters sent in the extension point URL: "pid" (Project ID) and "user" (user email).
Extension of Samba Videos involving a specific media. This extension point adds an option to the option list of a media (drop-down menu on the right side of each media, in the list of contents) and in the menu on the top of the edition media screen.
Parameters sent in the extension point URL: "pid" (Project ID), "user" (user email) and "media_id" (Media ID).
Extension of Samba Videos involving multiple medias. This extension point adds an option to the menu "Actions" (drop-down menu at the top of the list of contents). To use it, simply select one or more medias of the list and click the extension point on menu "Actions".
Parameters sent in the extension point URL: "pid" (Project ID), "user" (user email) and "media_ids" (list of the selected media IDs, separated by ",").
Installation e Activation
After development, the app installation must be performed by the "Account Owner". The installation option is located in the option "App's" in the settings menu. After activation, the app will be automatically enabled to all users of the account.
The app activation for each user occurs by sending an activation request to the app, in the standard address: "<domínio>/sambaapps/activate", via GET, with the parameters "user" (encrypted user email) and "access_token" (user's access token).
"http://aplicativo-exemplo.com/sambaapps/activate?user=Encrypted User Email&access_token=USER TOKEN"
The app must return a response with status 200 of this request so the activation is concluded.
If the extension points are not visible for the users of the account after installation, it's possible that the activation failed for absence of an appropriated application response to the activation requests.
- Extension points will be only visible to an user after its first log in affter the app installation in the account (the activation request of the user for a newly installed app occurs in this user log in).
- When creating an app, the field "domain" is optional. To an app without a domain, it will be generated an access, but sending a request for activation does not occur and no extension points will be displayed.
- The developer will no longer be able to access the app after installation. o perform maintenance, the account owner must uninstall the application so that the developer can access it again.