# Media
The media API is presented as an Umbraco API controller. Therefore the media API i not accessible on the same URL as the PIM API.
E.g: ~/Umbraco/Api/Media/{endpoint}
POST /GetMediaItemInfo
This endpoint returns info on a specified media item.
{
"MediaIds": [
1,
2,
3
],
"Hash": "dc302da20ca50253746ac555c30b2e31"
}
[
{
"Id":24806,
"Name":"106324.jpg",
"Url":"https://yoursite.com//media/130876/106324.jpg",
"Extension":"jpg",
"FileType":"Image"
}
]
Request
Body parameters: MediaIdsModel
MediaIdsModel | ||
---|---|---|
Property name | Type | Description |
MediaIds | int[] | Array of media ids for the media items |
Hash | string | md5 hash string consistent of the media API secret key + the count of the MediaIds array. |
Response status OK (200)
Return value: MediaItem[]
MediaItem | ||
---|---|---|
Property name | Type | Description |
Id | int | id of the media item |
Name | string | name of the media item |
Url | string | URL of the media item |
Extension | string | The extension of the media item |
FileType | string | File type of the media item |
GET /GetFolder
Gets entire media folder with media items
{
"Id": 3,
"ParentId": 1,
"Name": "String",
"MediaItems":[
{
"Id":24806,
"Name":"106324.jpg",
"Url":"https://yoursite.com//media/130876/106324.jpg",
"Extension":"jpg",
"FileType":"Image"
},
{
"Id":24807,
"Name":"106325.jpg",
"Url":"https://yoursite.com//media/130876/106325.jpg",
"Extension":"jpg",
"FileType":"Image"
}
]
}
Request
Query parameters:
Property name | Type | Description |
---|---|---|
folderId | int | Id of the folder in question |
hash | string | md5 hash string consistent of the media API secret key + the id of the folder |
Response status OK (200)
Return value: Folder
Folder | ||
---|---|---|
Property name | Type | Description |
Id | int | Id of the folder |
ParentId | int | Id of the parent to the folder |
Name | string | Name of the folder |
MediaItems | MediaItems[] | Array of media items contained with the folder |
MediaItem | ||
Property name | Type | Description |
Id | int | id of the media item |
Name | string | name of the media item |
Url | string | URL of the media item |
Extension | string | The extension of the media item |
FileType | string | File type of the media item |
Previous
Next article