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
}
}
Zoho Desk Resources
-
Desk Community Learning Series
-
-
-
-
-
-
-
-
-
Zoho CRM Plus Resources
Zoho Books Resources
Zoho Subscriptions Resources
Zoho Projects Resources
Zoho Sprints Resources
Zoho Orchestly Resources
Zoho Creator Resources
Zoho WorkDrive Resources
Zoho Campaigns Resources
Zoho CRM Resources
Writer Get Started. Write Away!
Writer is a powerful online word processor, designed for collaborative work.