Jump to content

Invision Community Blog


Managing successful online communities


4.3: REST API Enhancements

"No man is an island" wrote John Donne. He wrote that a good 200 years before computers were invented, but it rings true for any well written framework like Invision Community.

The included REST API allows developers to fetch data from Invision Community and also allows data to be added.

This data can be used to power widgets on your website, or to be used within other applications you  are already using in a very simple way.

coding-924920_1280.thumb.jpg.f9a754d5c814494cb5312dcee3dd02f7.jpg

 

Several enhancements have been made to the REST API for Invision Community 4.3 that we wanted to let you know about.

These changes are developer-oriented, so if you do not use the REST API with your community please feel free to skip this update.

If you would like to learn more about the REST API available with Invision Community, please see our REST documentation.

Search capabilities

As previously noted, you can now perform searches through the REST API. You can perform searches based on keywords, tags, or both, and you can limit and filter results with parameters similar to when you perform a regular search on the site (e.g. to specific containers, returning only results over a set number of comments, or searching within clubs).

Permission awareness

Several REST API endpoints are now permission-aware when combined with Oauth functionality built into Invision Community 4.3. This means that many REST API endpoints can be called using a specific user's access token, and only results that the specific user would normally be able to see will be returned (and/or they will only be able to submit to areas they normally have permission to). 

Ability to search members

While an endpoint has always been available to retrieve (and add/edit/delete) members, the ability to search for members has now been implemented. You can search by name, email address, and (one or more) group(s), and a paginated response will be returned.

Private conversations

You can now start a new private conversation, reply to an existing private conversation, and delete a private conversation through the REST API.

Other REST API changes

  • You can now specify member's secondary groups when adding or updating a member through the REST API.
  • You can specify the member's registration IP address through the REST API when adding or updating a member.
  • You can now specify other member properties not directly exposed through the REST API when adding or updating a member by setting the rawProperties input field.
  • You can now specify other member properties to retrieve through the REST API through the otherFields request parameter.
  • The REST API now better logs changes to member accounts (so you will be able to more easily identify how a user's name, email address, password, etc. has changed when looking at the member history).
  • You can now retrieve all content a member is following through the REST API, as well as follow a new container/content item, and delete an existing follow.
  • You can now validate an account through the REST API
  • You can now specify a 'perPage' parameter for paginated responses to control how many items are returned per page.

 

Most of these changes were directly culled from client feedback and implemented per specific requests. If there are other REST API changes you would like to see implemented please don't hesitate to leave your feedback!


Comments

Recommended Comments

I don't think I'll be using any of this myself (this seems to be way above my head) but

Quote

Most of these changes were directly culled from client feedback and implemented per specific requests.

is great to read. Cheers!

Share this comment


Link to comment
Share on other sites
22 hours ago, jair101 said:

Related to the permissions awareness, Is there any way to get number of unread topics/replies via Rest API?

Not at this time, no.

21 hours ago, Wildcard Chris said:

Perfect, the member's PMs and "perPage" parameter is exactly what I've been waiting for to use in my app. Thanks!

Great!

9 hours ago, Archimed said:

We can connect Wechat ? :unsure:

If Wechat can integrate with our software by using a ready-built REST API, then sure.

Share this comment


Link to comment
Share on other sites

If user can sign with other platform, like wechat....what about notifications design for email? because if signed with wechat, does not have email in the account...

Share this comment


Link to comment
Share on other sites

If I can request something that is missing in my opinion, then it would be a picture of event in calendar.

POST request to /calendar/events should have a picture option.
In our use case we are creating events assigned to our members via external "event builder", then user have few minutes to change picture (this time is correlated to group permission - how long someone can edit his content). Then only admin/mod can change picture.

Share this comment


Link to comment
Share on other sites
On 2/17/2018 at 6:10 PM, kmk said:

If user can sign with other platform, like wechat....what about notifications design for email? because if signed with wechat, does not have email in the account...

The first time a user visits the community when they login through a remote service, if any details that are required are missing (username or email address) the user will be prompted for those details. Naturally we will be unable to email the user if we do not have an email address for them.

On 2/18/2018 at 5:54 AM, Laxentis said:

If I can request something that is missing in my opinion, then it would be a picture of event in calendar.

POST request to /calendar/events should have a picture option.
In our use case we are creating events assigned to our members via external "event builder", then user have few minutes to change picture (this time is correlated to group permission - how long someone can edit his content). Then only admin/mod can change picture.

Please post requests in the appropriate requests forum. For now I recommend just including the image remotely linked in the event description field.

Share this comment


Link to comment
Share on other sites
2 minutes ago, bfarber said:

The first time a user visits the community when they login through a remote service, if any details that are required are missing (username or email address) the user will be prompted for those details. Naturally we will be unable to email the user if we do not have an email address for them.

On 2/18/2018 at 5:54 AM, Laxentis said:

If user login with wechat and dont provide email, is possible send notification to wechat instead to email?

Share this comment


Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  Ask A Question ×