WordPress.org

Ready to get started?Download WordPress

Forums

JSON API
Feature Request (1 post)

  1. monkeypunch3
    Member
    Posted 7 months ago #

    Have you thought about adding error codes? Currently, if I want to check if someone needs to login or not is to check the error message,

    {"status":"error","error":"You need to login with a user that has 'edit_posts' capacity."}

    But if that terminology changes or needs rewording the application will break. With error codes you could check the error number and know what it's about and display your own message if need be. For example,

    Error Codes
    1000 - This action requires the user to login
    1001 - This user does not have permission for this action.
    1002 - Post does not exist

    http://wordpress.org/plugins/json-api/

Reply

You must log in to post.

About this Plugin

About this Topic

Tags