Forum Discussion

Pradeepthi's avatar
10 years ago

API V2 REST API Calls

Hi,

 

Can someone please listout the main differences in API V1 and API v2 in terms of the REST API Calls? Are there any new additions?

 

Thanks,

Deepthi..

  • OlivierS's avatar
    OlivierS
    Lithium Alumni (Retired)

    Pradeepthi I think the closest you will get in terms of comparaison is from this page.

     

    When to use Community API v1

    Use Community API v1 for CREATE, UPDATE, and DELETE operations on the Message, User, and the supporting resources listed above. Use v1 for CREATE, READ, UPDATE, and DELETE operations on all other resources.

    Community REST API v2

    In our 14.10 release, we introduced version 2 of our Community REST API. In v2, we’ve simplified the Community API: fewer calls, increased consistency, increased functionality, and the ability to search and sort by a wide variety of fields of a resource. Documentatio for the Community REST API v2 is contained in a separate knowledge base on the Developers Network

    API v2 exposese more resource fields, accessible through LiQL, a SQL-like query language. Use a LiQL statement to define search criteria for any complex query.

    We recommend using API v2 for all new development, redesigns, or bug fixes to existing components where possible. Community API v2 is well-suited for personalization, faceted navigation, advanced search, and recommended content use cases. In addition, choose v2 for long-lived sessions via OAuth2. (This is particlularly useful for non-Lithium mobile apps.)

    More specifically, v2 is the best choice for READ operations on Message and User objects, as well as READ operations on the following supporting resources:

    • Album
    • Attachment
    • Custom Tag
    • Image
    • Kudo
    • Label
    • Me Too
    • Rating
    • Role
    • Video
    • Pradeepthi's avatar
      Pradeepthi
      Helper
      Thanks Olivier. I was looking at something like the documentaion of V1 APIs. But this is a good start
      • luk's avatar
        luk
        Boss

        Wish there was a resource combining v1 and v2 features (or add v2 calls that do the same to v1 docs), but the two APIs are very different in their approach and thus a comparison is difficult.

         

        v1 uses a classical REST API approach via qualified URLs (more or less) while v2 uses LiQL SQL like query statements passed via a GET param (usually...)