• Hi, I am using the awesome JSON API plugin. I read I can’t have access to the posts postmeta unless I’m authenticated and I thought maybe your plugin is the solution to that.

    I have installed your plugin but not entirely sure how to use it in my application.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Ali Qureshi

    (@parorrey)

    Hi thinkerman,

    If you want access to CPT data, you don’t need this plugin. you can siomple call the JSON API get_posts and provide it post_type variable in the REST call and it will get you all the data.

    This plugin was developed to authenticate the user for any user related or restricted data. see JSON API User plugin for more details.

    Thread Starter thinkerman

    (@thinkerman)

    Thanks, I did that already and I get the CPT JSON but the post meta data is not in the JSON objects returned.

    If you have any more suggestions as to how I could fix this, I’ll be glad to take them.

    Thanks for the awesome job!

    Plugin Author Ali Qureshi

    (@parorrey)

    JSON API User Plus plugin https://www.parorrey.com/solutions/json-api-user-plus/ will get you all the CPT meta data, endpoint is ‘get_post_meta’. and also allows you to create post, update, delete. There are lot more BuddyPress related endpoints.

    Thread Starter thinkerman

    (@thinkerman)

    Hey, thanks for your response, I see the plugin indeed has the ability to show post meta data but it’s for a user. I need post meta for posts in a calendar plugin.

    Will this plugin also work for it?

    I like to confirm before purchasing it.

    Thanks

    Plugin Author Ali Qureshi

    (@parorrey)

    You can get post meta for any post using its id. here are the details.

    Method: get_post_meta

    This endpoint is used to get post meta for any custom fields of post. If you provide meta_key, only that data will be provided otherwise, all post_meta will be fetched.

    Required argument

    post_id
    key – get API key from Settings > User Plus
    Optional arguments

    meta_key – provide meta_key to get data for that post.
    Example

    You must include one or more vars in your request to add or update post_meta. e.g. ‘name’, ‘website’, ‘skills’. You must provide multiple meta_key vars in this format:
    https://localhost/api/userplus/get_post_meta/?key=KEY=HERE&post_id=110&meta_key=website,skills

    Thread Starter thinkerman

    (@thinkerman)

    Thanks for the reply. I’m not trying to make request for a single post, I’m rather trying to make request for the entite posts in a “post_type=tribe_events” so that the result will show the meta data for all the posts.

    Can I achieve that with this plugin and what would be the format of the query?

    Thanks for your replies.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Access to CPT post data’ is closed to new replies.