Upload Image into Wordpress Media via API
Hi,
I tried to upload image from Zoho Creator into Wordpress Media folder via api.
I have issues wih my code and I don't knw how to fix it.
- post_data = Map();
- post_data.put("media_urls","IMAGE_URL");
- header_data.put("Content-Type","image/jpeg");
- header_data.put("Content-Disposition","attachment; filename=" + imageDownloadResponse);
- header_data.put("Authorization","Basic XXXXXXXXXXXXX");
- uploadResponse = invokeurl
- [
- url :"https://site.com/wp-json/wp/v2/posts"
- type :POST
- parameters:post_data
- headers:header_data
- ];
- info uploadResponse;
First response says that
{
code : "rest_cannot_create",
message : "Sorry, you are not allowed to create posts as this user.",
data : {
status : 401
}
}
Access your files securely from anywhere
Zoho Developer Community
Deliver unforgettable customer experiences
Deliver unforgettable customer experiences
New to Zoho Marketing Plus?
Everything you need to run your marketing
New to Zoho Marketing Plus?
Everything you need to run your marketing
Zoho Desk Resources
-
Desk Community Learning Series
-
-
-
-
-
-
-
-
-
Zoho TeamInbox Resources
Zoho DataPrep Resources
Zoho CRM Plus Resources
Zoho Books Resources
Zoho Subscriptions Resources
Zoho Projects Resources
Zoho Sprints Resources
Qntrl Resources
Zoho Creator Resources
Zoho Campaigns Resources
Zoho CRM Resources
Zoho Show Resources
Writer Get Started. Write Away!
Writer is a powerful online word processor, designed for collaborative work.