Method: media/getMediaData
This method return all information about a media
Authentication
This method does not require authentication.
HTTP method
This method is called with HTTP method GET.
Arguments
| Argument | Type | Element (array) | Valid Values | Default Value | Detail | ||
|---|---|---|---|---|---|---|---|
id |
int | existing media id | required | unique media id | |||
thumbnail_size |
Int |
|
required |
|
|||
language_id |
Int |
|
2 |
|
|||
secure_urls |
Int | 0 | Returns HTTPS urls |
Returned Values
| Element (path) | Name | Type | Description | ||
|---|---|---|---|---|---|
| / | id |
int | media unique ID | ||
| / | title |
string | media title (orginal name) | ||
| / | creator_name |
string | media creator name | ||
| / | creator_id |
int | media creator id | ||
| / | media_type_id |
int | media type :
|
||
| / | thumbnail_url |
string | media thumbnail url | ||
| / | thumbnail_width |
int | media thumbnail width | ||
| / | thumbnail_height |
int | media thumbnail_height | ||
| / | thumbnail_html_tag |
string | media thumbnail html source code | ||
| / | country_id |
int | media country ID | ||
| / | country_name |
string | media unique name | ||
| / | nb_views |
int | media views number | ||
| / | nb_downloads |
int | media downloads number | ||
| /keywords/[n]/ | name |
string | media keywords (ranked by pertinence) | ||
| /licenses/ | name |
string | media license name | ||
| /licenses/ | price |
int | media license price (credit) | ||
| /licenses_details/ | name |
string | media license name | ||
| /licenses_details/name/ | width |
int | media license width | ||
| /licenses_details/name/ | height |
int | media license height | ||
| /licenses_details/name/ | dpi |
int | media license resolution (dpi) | ||
| /licenses_details/phrase/ | phrase |
string | media license format description | ||
| /cat1/ | id |
int | media representative category ID | ||
| /cat1/ | name |
string | media representative category name | ||
| /cat2/ | id |
int | media conceptual category ID | ||
| /cat2/ | name |
string | media conceptual category name | ||
| /cat1_hierarchy/[n]/ | id |
int | media representative category ID (n depends on hierarchy level) | ||
| /cat1_hierarchy/[n]/ | name |
string | media representative category name (n depends on hierarchy level) | ||
| /cat2_hierarchy/[n]/ | id |
int | media conceptual category ID (n depends on hierarchy level) | ||
| /cat2_hierarchy/[n]/ | name |
string | media conceptual category name (n depends on hierarchy level) |
Example Query
GET http://API_KEY@api.fotolia.com/Rest/1/media/getMediaData?id=20
Example Response
{
"id":20,
"title":"insecte sans issue",
"creator_name":"Guy Turro",
"creator_id":18,
"media_type_id":1,
"thumbnail_url":"http:\/\/static-p1.fotolia.com\/jpg\/00\/00\/00\/00\/400_F_20_xSvckxpOlCJSU4hLrMyJTnhBbXX3Jt.jpg",
"thumbnail_width":400,
"thumbnail_height":294,
"thumbnail_html_tag":"",
"country_id":756,
"country_name":"Switzerland",
"nb_views":845,
"nb_downloads":1,
"keywords":[
{
"name":"insect"
},
{
"name":"macro"
},
{
"name":"celebrity"
}
],
"licenses":[
{
"name":"M",
"price":5
}
],
"licenses_details":{
"M":{
"ratio":1.245663,
"width":1606,
"height":1183,
"dpi":72,
"phrase":"1606 x 1183 (1,8 MP), 22,3 '' x 16,4 '' @72 dpi"
}
},
"cat1":{
"id":4001008,
"name":"Insect"
},
"cat1_hierarchy":[
{
"id":4000000,
"name":"Fauna & Flora"
},
{
"id":4001000,
"name":"Animal"
},
{
"id":4001008,
"name":"Insect"
}
]
}
Error Codes
001: Service currently unavailable- The requested service is temporarily unavailable.
002: Failed to parse request- The request could not be parsed.
010: Missing API Key- The API key passed is missing.
011: Invalid API Key- The API key passed is not valid or has expired.
031: Invalid Method- This method does not exist in the method list.
032: Method not Available- This method is not available for this API Key.
100: Missing Media ID- The media ID is missing. Media ID is required for this method.
101: Invalid Media ID- The media ID passed is not valid or doesn't correspond to any media.
2001: Invalid Language ID- The language ID passed is not valid or doesn't exist in the fotolia available language list.
2101: Invalid Thumbnail Size- The thumbnail size passed is not valid or doesn't exist in the fotolia available thumbnail size list.


