Recent Changes to Our REST API

Hi, I’m Eugene Park, and I’m one of the software developers who has been working on our REST API. Yesterday we released a minor update to our REST API to ready ourselves for some improvements we have planned for further down the road. While most things should behave as they did before, we’d like to give a quick overview of what we’ve changed.

Richer Topic & Reply Data

We added a few attributes that had been missing in some of our API responses. In particular, we now include champion status of the author and mood (aka emotitags) with topic data and reply data.

For example, an API GET request to /topics/my_new_topic should yield something like the following as a response.

{
  "id": 1234,
  "subject": "My New Topic",
  "content": "Hello world",
  "emotitag": {
    "feeling": "funky fresh",
    "face": "happy",
    "intensity": 1
  },
  "author": {
    "name": "Eugene",
    "employee": false,
    "champion": false,
    ...
  },
  "employee": false,
  "champion": false,
  ...
}

Notice that the champion and employee attributes are both included at the top level of the JSON object as well for legacy support.

In addition, the star count of a reply is included with reply data as an attribute called star_count.

More RESTful API Behavior

We also modified a few API endpoints to make them more RESTful. In particular, you may now flag and unflag a topic as inappropriate by sending a POST and a DELETE, respectively, to a single endpoint:

/topics/topic_id/flag

with the appropriate request payload.

Likewise a POST and a DELETE to the following API endpoint will flag and unflag a reply, respectively.

/replies/reply_id/flag

The old endpoints for unflagging topics and replies are still available, but they should be considered deprecated.

Along similar lines, a POST and a DELETE to the following endpoint will star and unstar a reply.

/replies/reply_id/star

Again, the previous way of starring and unstarring is still supported but is now deprecated.

Cleaner API Endpoints and Data

We removed some stale API endpoints which correspond to functionality that is no longer supported.

/people/person_id/followed/people
/people/person_id/followed/tags
/tags/tag_name/products
/tags/tag_name/companies
/tags/tag_name/people
/products/product_id/tags
/companies/company_id/tags
/companies/company_id/tags/tag_name/topics

We also cleaned up the person data we send back so that it no longer includes the avatar_path_* attributes; the avatar_url_* attributes that are provided should be sufficient.

The person response data also no longer includes URL values under the followed attribute for companies, products, and people. These URLs were pointing to unsupported API endpoints.

More API Changes to Come!

That’s it for now, but we’re looking forward to making some more substantial changes in the near future. If you would like to learn more about our API, check out our developer resources, and feel free to participate in our developer community.

Posted in Product Updates
3 comments on “Recent Changes to Our REST API
  1. Hooray for progress! As I requested on the GS dev community, please update your documentation and enable an RSS feed or wiki-style changes feed for the API docs so we can track changes to the API.

  2. Lee Bowyer says:

    In case anyone else is now finding their helpcenter install broken after the abrupt removal of the ‘tags’ api – this is the change we made to fix it:

    On line 475 of Satisfaction.php – change the tags() function to:

    function tags($url) {
    return array();
    }

    This stops the code producing a fatal error when attempting to process the xpath() call after failing to to load the tags from the api.

  3. On line 475 of Satisfaction.php – change the tags() function to:
    i had the same isssue thanks for the advice!!

Leave a Reply

Your email address will not be published. Required fields are marked *

*

Request a Demo
Your Awesome Hosts

David Rowley
CTO

Steven Pal
Dir of Consumer Products

Ramya Krishnamurthy
Dir of Business, Data Products

Categories
Join us on Facebook