App creation and roles management
To get an application ID and keys, it should be created following this instruction.
After the application is created, users can be added for the development stage. Click the Developers link and give the required rights (see user roles).
When application is launched on Odnoklassniki the number of GET parameters will be passed in an URL.
Depending on a platform where application was launched (desktop / mobile) lists of this parameters can be different:
- if an application was launched on desktop container parameter will be passed with true value;
- if an application was launched on mobile (browser or webView for Odnoklassniki android app) mob parameter will be passed with true value.
Parameters listed below are transmitted to applications that are opened in iframe:
- as request parameters for HTML applications;
- as flashvars for Flash applications.
|api_server||Yes||String||Main URL of API server, for example: https://api.ok.ru/|
|application_key||Yes||String||Application public key|
|auth_sig||Yes||String||MD5 hash-sum of logged_user_id+session_key+application_secret_key parameters. Can be used for easier checking of a logged in user|
|authorized||Yes||Number||1 if the user has authorized the application; otherwise 0|
|container||No||Boolean||Will be passed as true, if application was launched within native application or iframe (no extra heading from widget.getWidgetContent is required)|
|mob||No||Boolean||Will be passed as true, if application was launched on mobile)|
|mob_platform||No||String||Mobile platform on which game was launched. Passed to game only if parameter mob is true.|
- androidweb - mobile browser on Android platform;
- android - OK android app;
- iosweb - mobile browser on iOS platform;
- ios - OK iOS app;
- mobweb - all other cases
|custom_args||No||String||Custom parameters transmitted when the user opens a custom link in a friend’s news feed, accepts a friend’s offer or reviews a notification from a friend|
|first_start||No||Number||1, if its a new install|
|header_widget||No||String||The name of a mobile widget’s title to be shown on application’s pages|
|logged_user_id||Yes||Long||Authorized user ID that is constant|
|referer||No||String||Referrer for replace. For interaction between users, it is a friend’s ID|
|refplace||No||String||Application launch method (see below)|
|session_key||Yes||String||User session key|
|session_secret_key||Yes||String||User session secret key|
|sig||Yes||String||MD5 hash-sum of the current request and application_secret_key|
|web_server||No||String||Odnoklassniki’s web server address|
|payment_promo_active||No||Boolean||Is there an active promo to show before game launch|
|new_sig||No||Boolean||Is new signature format used|
|ip_geo_location||No||String||User location according to his IP address|
Application launching methods
|direct||Direct link (https://ok.ru/games/[short-name])|
|catalog||From any place in the application catalog or the user’s applications (outdated)|
|banner||From a banner in the application catalog|
|banner_text||From a banner (banner text)|
|banner_img||From a banner (banner image)|
|friend_invitation||The user accepted a friend’s invitation|
|friend_feed||From a post in a friend’s news feed|
|friend_notification||From a notification in the toolbar|
|present||From a present|
|present_tooltip||From a present (tooltip)|
|common_apps||“Applications you have in common with your friend”|
|user_apps||From the catalog: my applications|
|friend_apps||From the catalog: friend’s applications|
|recommended_apps||From the catalog: recommended applications|
|new_apps||From the catalog: new applications|
|top_apps||From the catalog: top applications|
|pay_attention_apps||From the catalog: pay attention|
|app_search_apps||From the catalog: application search|
|shops_catalog_apps||From the catalog: shops & services|
|our_apps||From the catalog: our applications|
|short_apps||From the catalog: entertainment|
|app_preset||From the topical collection of applications|
|showcase_apps||From the catalog: recommended by genre|
|rb_9||Link under the user’s avatar. Appears if the user joins the application|
Full refplaces list - ApplicationReferencePlace.
For some launch methods there is also an option with the “passive_” prefix.
The difference between passive and standard methods is the part of UI the user has launched the game from. The non-passive option is a notification, recommendation, etc. that pops up regardless of the user’s actions, whereas the passive one is the case when the element is not specially marked for the user and is launched in the standard way.