My target is to submit WordPress post in custom post type from Ionic App using wp restapi

Hello everyone, for last few days I tried to figure out below error

[HTTP/1.1 401 Unauthorized 1081ms]

{“code”:“rest_cannot_create”,“message”:“Sorry, you are not allowed to create posts as this user.”,“data”:{“status”:401}}

My target is to submit WordPress post in custom post type from Ionic App using wp restapi. Can any one solve my issue.

Hi there,

You will need to authenticate yourself before you are able to access certain functionality using the REST API.
One way of doing this is by using the oauth1 plugin for WordPress. More information can be found here:

The first link explains how to set up the authentication with WP and Postman, the second link shows how I got it to work in my Ionic app.

Good luck :slight_smile:

Thank you for your reply, I tried but its not working. can you please give me a demo code.

@sniemans post contains example code: OAuth1.0a ionic2 client cannot connect to wp-api server