get_post_media
This endpoint is used to get post all attachments. If you provide ‘type’ variable, only that type attachments will be provided otherwise, all attachments will be fetched. Possible vlaue for type var are image, audio, video.
Resource URL
http://localhost/api/userplus/get_post_media/
Method
POST
Required Parameters
- post_id
- key – get API key from Settings > User Plus
Optional Parameters
- type – provide media type. image, audio, video etc to get media for that post.
Endpoint Returns
Array of media info.
Sample Request URL
http://localhost/api/userplus/get_post_media/?key=KEY=HERE&post_id=110&type=image
Sample Response
{
"status": "ok",
"media": {
"2016159605276689": {
"ID": 2016159605276689,
"post_author": "1",
"post_date": "2020-08-14 16:10:22",
"post_date_gmt": "2020-08-14 15:10:22",
"post_content": "",
"post_title": "aldo_women_shoes_n",
"post_excerpt": "",
"post_status": "inherit",
"comment_status": "closed",
"ping_status": "closed",
"post_password": "",
"post_name": "aldo_women_shoes_n",
"to_ping": "",
"pinged": "",
"post_modified": "2020-08-14 16:10:22",
"post_modified_gmt": "2020-08-14 15:10:22",
"post_content_filtered": "",
"post_parent": 868,
"guid": "https://www.wppim.com/wp-content/uploads/2016/01/aldo_women_shoes_n.jpg",
"menu_order": 0,
"post_type": "attachment",
"post_mime_type": "image/jpeg",
"comment_count": "0",
"filter": "raw"
},
"2016159605276690": {
"ID": 2016159605276690,
"post_author": "1",
"post_date": "2020-08-14 16:10:26",
"post_date_gmt": "2020-08-14 15:10:26",
"post_content": "",
"post_title": "EHFCvL7WkAAiLJP",
"post_excerpt": "",
"post_status": "inherit",
"comment_status": "closed",
"ping_status": "closed",
"post_password": "",
"post_name": "ehfcvl7wkaailjp",
"to_ping": "",
"pinged": "",
"post_modified": "2020-08-14 16:10:26",
"post_modified_gmt": "2020-08-14 15:10:26",
"post_content_filtered": "",
"post_parent": 868,
"guid": "https://www.wppim.com/wp-content/uploads/2016/01/EHFCvL7WkAAiLJP.jpeg",
"menu_order": 0,
"post_type": "attachment",
"post_mime_type": "image/jpeg",
"comment_count": "0",
"filter": "raw"
}
}
}