Renren Open Platform Technology architecture

Source: Internet
Author: User

This document introduces the design details and interface definitions for Renren's Open platform technology architecture , and is a chatty document that covers all interfaces provided externally by Renren's open platform. If you want to understand the overall architecture and principles of Renren's open platform, or if you want to look up an interface parameter, you can definitely find the answer here.

The technology architecture of Renren's open platform is in the midst of great changes, and is developing in the direction of more standardization and generalization . However, in order to ensure compatibility and transition, we will continue to provide the previous functionality in the old platform architecture for a longer period of time. Migrating functionality from The Legacy platform architecture to the new Renren Open platform technology architecture will continue, requiring both platform and third parties to work together. In order to describe clearly, in the document involves some new and old interface transition situation, will be indicated in detail.

Directory[Hide]
  • 1 Clear tiered technology architecture
    • 1.1 Auth API
    • 1.2 Rest API
    • 1.3 Widget API
      • 1.3.1 dialog
        • 1.3.1.1 feed Dialog
        • 1.3.1.2 request Dialog
      • 1.3.2 plug-in
        • 1.3.2.1  everyone likes
        • 1.3.2.2 like box (new version not yet online)
        • 1.3.2.3 comment box
        • 1.3.2.4 live Stream Box
        • 1.3.2.5  friends send
    • 1.4 Callback API
      • 1.4.1 Iframe Callback
      • 1.4.2 XNML Callback
      • 1.4.3 Real-time API
    • 1.5 various SDKs
  • 2 The socialized division of the Open platform field

clear and layered technology architecture

The new Renren Open Platform technology architecture follows a clear layered model, with the frame composition as follows:

In the hierarchical architecture shown, Renren's open platform provides different levels of functionality. The red part of the figure indicates that a functional module is not currently available and needs to be provided by the platform or open source community in the future; The yellow section represents a functional module that has been provided in the old platform architecture but is being migrated to the new architecture; the other color is a functional module with a more complete function.

As you can see, Renren's open platform is roughly divided into three tiers, providing services for all forms of third-party applications at the top level:

    • Core Service Layer: Realize the most basic API provided by Renren, define the interface parameters and the calling process, and third party or platform can encapsulate the SDK based on this level of API.
    • SDK layer: A third-party or platform-side SDK for a variety of development languages or development environments.
    • High SDK layer: the Advanced SDK built on top of the core Service layer or SDK layer, such as the Discuz SDK, is encapsulated based on the JS SDK.

Third-party applications can be developed using an API provided by any of the three tiers.

So why should we introduce such a layered architecture? Because it has the following benefits:

    • Versatility. Better support for the web, mobile, desktop and other operating environments, providing a variety of forms of API. This provides rest APIs that require authorization to use, as well as widget APIs that can be used without authorization .
    • Standardization. An important feature of the new architecture is its layered architecture and well-defined API interface, which facilitates a stable and clear programming environment for third parties.
    • The clarity of the industry division of labor. One of the benefits of standardization is the ability to deliver SDK development and maintenance work to third-party open source communities, rather than all of them being done by the platform. The open source community develops the SDK on the API provided by the core Service layer layer, and third-party application developers develop applications based on the SDK.
    • Easy to maintain and understand. A clear hierarchical model and well-defined interface specifications help to reduce the maintenance costs of the platform and facilitate the understanding of the Platform architecture by third parties.
    • Expand the open range and provide more new features. Features that are not available through the rest API for security reasons, such as the Add Friends feature, can be provided by the new widget API.

The following is a detailed description of all the details of the technology architecture of Renren's open platform by way of categorization.

Auth API

If a third party wants to invoke the rest API provided by Renren, it must first be authorized by the user. The Auth API is used to complete user authorization.

At present, Renren open platform for user authorization to follow the industry's latest standard OAuth 2.0, for details, please refer to: User authentication and authorization.

Rest API

The Rest API is an API that is provided by Renren's open platform to invoke using the HTTP protocol, which needs to be completed before it can be invoked.

The interface parameter definitions for each REST API are described in the rest API.

Widget API

The Widget API is an API that is provided by Renren's open platform to access user resources under user control, and because it is done under user control, user authorization is not required (but user authentication is required). This API can support a variety of different operating environments, such as the Web, mobile, desktop programming environment, and so on.

A widget can have multiple views, each of which adapts to a particular operating environment. Widgets can be run in a Web browser, embedded in a native program (Native application), or embedded in a dialog box.

Depending on the usual use, widgets can be broadly divided into two categories: dialog and plug-in.

Dialog

Dialog are typically used for pop-up windows or pop-up dialogs. Typically, a dialog is not displayed in a third-party app by default, but is triggered by a user action.

Typically dialog has a relatively simple user interface.

The following is a list of dialog:

Feed Dialog

The function of Feed dialog is to send new news to Renren through the way of frame and so on after user confirmation. can support Web/wap Web pages (Web/wap website and in-site applications), mobile clients, desktop clients and many other operating environments.

The advantages of the new Feed dialog:

    • No longer dependent on new templates
    • No longer dependent on user authorization (legacy customizations require user authorization to be used, is a bad process)
    • Support for more terminal displays

Request Dialog

The function provided by request dialog is to send an app invitation or gift to a friend after the user confirms it, such as a "one-to-one" or one-to-many, by way of a bullet box. can support Web/wap Web pages (Web/wap website and in-site applications), mobile clients, desktop clients and many other operating environments.

Plug-in

Plug-in is typically used in third-party applications as an embedded module or box, which is displayed by default.

Generally, plug-in has a more complex user interface and is more versatile.

Note : The difference between the dialog and plug-in described above is not a strict technical distinction, but a difference in usage. In practice, the use of the two can be interchangeable. For example, it is also possible to display plug-in by a user's trigger and then a popup window.

The following is a list of plug-in:

everyone likes

Users can see what they like in third-party apps by clicking on the "Like Button" and sending the content to Renren news. If the content has a corresponding public page, the user can also be a fan of the page and receive the latest updates from that page.

Technical documentation see like, a Web configuration and preview interface: Web likes button configuration.

Like Box (new version is not yet online)

Like Box is a social plugin for public page owners. The owner of the page can embed this box directly into its own app (which currently supports only Web sites and Web site apps), and users can click on a third-party site to like to be a fan of the page and browse the page for new and existing followers.

Before the new like box goes online, you can use the old fan widget: technical documentation See fan Widgets, configuration and preview interface see configuration of fan widgets.

Advantages of the new like box:

    • Support Novelty Browsing
    • No longer dependent on AppID (the old fan widget incorrectly relies on the AppID parameter, causing the fan widget to be created only for the app's public page), so it can be used on Renren's public homepage

Comment Box

Comments box is a social plugin that makes it easy for Renren users to comment on third-party apps that currently only support Web sites and Web site apps. The relevant document address.

Live Stream Box

Allows users to talk in real time about a hot topic in a third-party app (currently only supported in Web sites and Web site apps), and users ' comments are sent to Renren home page in the form of Renren.

Technical Documentation: Xn:live-stream; configuration and Preview interface: live stream box Configuration

Friend Pie

Enhance social properties by interacting with friends in third-party apps, which currently only support Web sites and Web site apps, to display a list of friends ' avatars.

Technical documents: xn:friendpile; configuration and preview interface: Friends send configuration

Callback API

Iframe Callback

Iframe callback is used for third-party development of Web site applications, in-depth integration with Renren on canvas pages (i.e., Http://apps.renren.com/yourapp).

An iframe type application is accessed by embedding a third-party page through an IFRAME on a canvas page (that is, Http://apps.renren.com/yourapp), passing some xn_sig_ in the src of the IFRAME The XXX parameter to the third-party server. Third-party servers to parse and verify these parameters, obtain the user's identity (such as UID, session key, etc.), and then use session key to call the rest API, get more information from the user, resulting in a dynamic page.

Information about the XN_SIG_XXX parameter, including how to verify the parameters, see about the Xn_sig parameter.

XNML Callback

XNML callback is used for third-party development in Web site applications or WAP station applications, in-depth integration with Renren on canvas pages (i.e., Http://apps.renren.com/yourapp or Http://mapps.renren.com/yourapp).

The XNML type of application is accessed by the platform Server Proxy user's request when the user accesses the canvas page (i.e., Http://apps.renren.com/yourapp or Http://mapps.renren.com/yourapp). The platform server sends a POST request to a third-party server. In this post request, pass some xn_sig_xxx parameters to the third-party server. Third-party servers to parse and verify these parameters, obtain the user's identity (such as UID, session key, etc.), and then use session key to call the rest API, get more information from the user, resulting in a dynamic page. For security reasons, this dynamic page cannot be a normal HTML page, only the XNML code defined by Renren's open platform can be used to assemble the page and return it to the platform server. Finally, the platform server renders XNML code parsing as normal HTML code, which is returned to the browser.

Information about the XN_SIG_XXX parameter, including how to verify the parameters, see about the Xn_sig parameter.

When a third-party server returns a platform server response, you can use the following three techniques to write labels, CSS, and JavaScript, respectively:

    • XNML
    • Xncss
    • Xnjs

Real-time API

The real-time API is an advanced form of API that can be used by third-party applications to subscribe to information changes in Renren (such as receiving reminders, changes in friend relationships, changes in personal information, etc.) and proactively pushing messages to third parties when the subscription information changes. So you can complete some advanced features such as real-time message reminders. See Real Time API

various SDKs

Part of the SDK is provided by the open platform for Renren, partly by the open source community. The way to open source code is to maintain it.

Please refer to the SDK for the current SDK.

the socialization division of the Open platform field

The new technology architecture of Renren open platform, which is clear and layered, is helpful to promote the socialization division of the Open platform field.

Previously, most of the APIs used by third-party application developers were provided by an open platform official, including various development SDKs. With architectural layering, the API provided by the underlying core Service layer is clearly defined, which clearly distinguishes the development of the underlying interface from the development of the SDK. The benefit is that the open platform focuses on providing the underlying interface and is committed to increasing the type of interface, while the upper-level SDK package can be done by third-party developers themselves or the open source community.

In order to promote the development of open platform field, Renren Open platform advocates the spirit of open source, focus on the power of the open source community, to facilitate the development of third-party developers or access to the code for open source management. This open source code is part of an open platform officially developed by Renren, then released as an open source license, managed by the open source community, and contributed directly by the open source community.

Welcome to join the Renren Open source project!

Renren Open Platform Technology architecture

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.