NAV Navbar
shell php
  • Introduction
  • Requirements
  • Get started
  • API reference
  • Introduction

    Welcome to the MomaPIX REST API Documentation!

    You can use MomaPIX REST API to access MomaPIX resources and interact remotely with MomaPIX database. Each resources is identified by an endpoint.

    The connection to each endpoint is qualified by an URL, some query parameters, an HTTP method, HTTP header and body content. Through these connections developers can create, read and update MomaPIX content from any client-side applications, written in any available languages that support HTTP protocol.

    Requirements

    Information exchange

    The data format for exchanging information with MomaPIX RESTful Web Service follows the conventions of JSON API 1.0 specifications.

    The JSON API media type HTTP header must be specified as follow:

    Content-Type: application/vnd.api+json

    Accept: application/vnd.api+json

    Detailed information about the HTTP negotiation and content structure will be skipped here. We invite you to read the specification at JSON API 1.0 site for more information.

    Furthermore, each JSON document carried in the body of the HTTP requests or HTTP responses complies with what is specified in a JSON scheme as indicated at JSON Schema.

    Authentication and Authorization

    In order to use MomaPIX RESTful Web Service, your application must provide the API KEY assigned to you by the host administrator. An API KEY has to be transfered in the header of each HTTP request.

    Apikey: <your-api-key>

    After the first successful connection, the authorization level will be bound to a personal Bearer Token. The Bearer Token must be provided throw the HTTP request header by each subsequent connection.

    Authorization: Bearer <token-id>

    Bearer tokens have a finite lifetime. The ExpiresIn field in the GET session response indicates the lifetime, in seconds, of the access token. For example, an expire value of 3600 indicates that the access token expires in one hour from the time the response was generated.

    You may wish to obtain specific authorization for specific RESTful service. Login and passoword will let you be recognized by the server.

    While the API KEY is used for authenticate your application, the login and passowrd are used for service authorization.

    Pagination, Sorting and filtering

    Pagination

    When a resourse response includes sevaral items, pagination could be implemented, i.e. just part of the results are shown during a single request according to a page-based strategy. In these scenarios you should specify page[number] parameter in order to browse between pages. If available, the page[size] parameter let you define the number of items per page.

    Sorting

    When a resourse response includes sevaral items, the sort parameters (if available) let you define the order of items. Descending order is implicitly defined; a minus (-) before the sort value let you define ascending order.

    Filtering

    The filter query parameter is reserved for filtering data. Filters or filter values not supported by the resource will be ignored.

    Dealing with languages

    Header request. Example of language tags. 
    
    Accept-language: en
    Accept-language: en-US,it-IT;q=0.9
    Accept-language: cs-CZ,en-US;q=0.9,it-IT;q=0.8
    Content-language: en
    
    Example for response
    
    Content-language: en
    

    The header of the request can be used to specify which languages the client is able to understand and which locale variant is preferred. If language options are available (i.e. the MomaPIX archive you are quering does support multiple language metadata and/or multiple language query string), the server will try to satisfy the request as best as possible.

    Use the Accept-language header parameter to specify the preferred language. The values supplied MUST conform to the RFC5646 for language tags.

    If the client does not supply any information about the preferred language or if the server cannot serve any matching language, the default one will be used.

    The negotiated language will be notified to the client through the Content-language parameter in the response header.

    Get started

    To make your first REST API calls, follow the following steps:

    1. Get you API KEY
    2. Fetch your Bearer Token
    3. Use your login and password for authorization request (if needed)
    4. Make REST API call

    Get you API KEY

    The API KEY should by provided by the host administrator. It will be bound to the IP source address of your application

    Fetch your Bearer Token

    Example Request
    
    curl http://sandbox.momapix.com/testme/rest/session \
        -H "Apikey: 1n29BMfN7EtaPqTzO6D9RIqryZSSiLsJ" \
        -H "Content-Type: application/vnd.api+json" \
        -H "Accept: application/vnd.api+json"
    
    Example Response
    
    {
       "data":{
          "type":"session",
          "id":"tv020jdssst6cbecsf7vnavajd",
          "attributes":{
             "TokenId":"tv020jdssst6cbecsf7vnavajd",
             "ExpiresIn":604800,
             "InteractiveTimeout":604800,
             "LoggedIn":false,
             "Name":null
          }
       }
    

    Your first connection has always to be pointed to the session endpoint

    GET http://sandbox.momapix.com/testme/rest/session

    Insert your API KEY in the HTTP Header request.

    During this connection your API KEY will be verified and a Bearer Token will be assigned and returned in the JSON response body. The Bearer Token have to be used for any subsequent connection.

    Use your login and password for authorization request

    Example Request
    
    curl http://sandbox.momapix.com/testme/rest/session/login \
        -H "Apikey: 1n29BMfN7EtaPqTzO6D9RIqryZSSiLsJ" \
        -H "Content-Type: application/vnd.api+json" \
        -H "Accept: application/vnd.api+json" \
        -H "Authorization: Bearer tv020jdssst6cbecsf7vnavajd" \
        -X PATCH -d '{
            "data": {
                "id": "tv020jdssst6cbecsf7vnavajd",
                "type": "session",
                "attributes": {
                    "username":"client1",
                    "password":"client1"
                    }
                }
            }'
    
    Example Response
    
    {
       "data":{
          "type":"session",
          "id":"tv020jdssst6cbecsf7vnavajd",
          "attributes":{
             "TokenId":"tv020jdssst6cbecsf7vnavajd",
             "ExpiresIn":604800,
             "InteractiveTimeout":604800,
             "LoggedIn":true,
             "Name":"Client One"
          }
       }
    }
    

    If you are going to use your application for fetching information reserved to registered user, you should bind your Bearer Token to your credential by a connection to the /session/login endpoint

    PATCH http://sandbox.momapix.com/testme/rest/session/login

    Insert your assigned Bearer Tokem in the HTTP header request and your username and passowrd in the JSON request body.

    From this point on, any operation will be authorized according to your user profile.

    Make REST API call

    Connect to any of the defined endpoint to fetch or post information you need. The API REFERENCE chapter details information about any available endpoint.

    API reference

    Session

    First connection, to fetch Bearer Token

    Definition
    
    `GET` `http://sandbox.momapix.com/testme/rest/session`
    
    Example Request
    
    curl http://sandbox.momapix.com/testme/rest/session \
        -H "Apikey: 1n29BMfN7EtaPqTzO6D9RIqryZSSiLsJ" \
        -H "Content-Type: application/vnd.api+json" \
        -H "Accept: application/vnd.api+json"
    
    Example Response
    
    {
       "data":{
          "type":"session",
          "id":"tv020jdssst6cbecsf7vnavajd",
          "attributes":{
             "TokenId":"tv020jdssst6cbecsf7vnavajd",
             "ExpiresIn":604800,
             "InteractiveTimeout":604800,
             "LoggedIn":false,
             "Name":null
          }
       }
    }
    
    Example Request
    
    <?php
    $url = 'http://sandbox.momapix.com/testme/rest/session';
    $headers =  [
        'Apikey: 1n29BMfN7EtaPqTzO6D9RIqryZSSiLsJ',
        'Content-Type: application/vnd.api+json',
        'Accept: application/vnd.api+json'
    ];
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, $url);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
    $response = curl_exec($curl);
    $info = curl_getinfo($curl);
    curl_close($curl);
    $output = json_decode($response, true);
    ?>
    
    Example Response
    
    {
       "data":{
          "type":"session",
          "id":"tv020jdssst6cbecsf7vnavajd",
          "attributes":{
             "TokenId":"tv020jdssst6cbecsf7vnavajd",
             "ExpiresIn":604800,
             "InteractiveTimeout":604800,
             "LoggedIn":false,
             "Name":null
          }
       }
    }
    

    Use the /session endpoint for the first connection in order to fetch your Bearer Token

    Response

    A successful request returns the HTTP 200 OK status code and a JSON response body including the following information:

    Login to get authorization

    Definition 
    
    `PATCH` `http://sandbox.momapix.com/testme/rest/session/login`
    
    Example Request
    
    curl http://sandbox.momapix.com/testme/rest/session/login \
        -H "Apikey: 1n29BMfN7EtaPqTzO6D9RIqryZSSiLsJ" \
        -H "Content-Type: application/vnd.api+json" \
        -H "Accept: application/vnd.api+json" \
        -H "Authorization: Bearer tv020jdssst6cbecsf7vnavajd" \
        -X PATCH -d '{
            "data": {
                "id": "tv020jdssst6cbecsf7vnavajd",
                "type": "session",
                "attributes": {
                    "username":"client1",
                    "password":"client1"
                    }
                }
            }'
    
    Example Response
    
    {
       "data":{
          "type":"session",
          "id":"tv020jdssst6cbecsf7vnavajd",
          "attributes":{
             "TokenId":"tv020jdssst6cbecsf7vnavajd",
             "ExpiresIn":604800,
             "InteractiveTimeout":604800,
             "LoggedIn":true,
             "Name":"Client One"
          }
       }
    }
    
    Example Request
    
    <?php
    $url = 'http://sandbox.momapix.com/testme/rest/session/login';
    $headers =  [
        'Authorization: Bearer tv020jdssst6cbecsf7vnavajd',
        'Apikey: 1n29BMfN7EtaPqTzO6D9RIqryZSSiLsJ',
        'Accept: application/vnd.api+json',
        'Content-Type: application/vnd.api+json'
    ];
    $body = '{
        "data": {
            "id": "tv020jdssst6cbecsf7vnavajd",
            "type": "session",
            "attributes": {
                "username":"client1",
                "password":"client1"
            }
        }
    }';
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, $url);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'PATCH');
    curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($body));
    curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
    $response = curl_exec($curl);
    $info = curl_getinfo($curl);
    curl_close($curl);
    $output = json_decode($response, true);
    ?>
    
    Example Response
    
    {
       "data":{
          "type":"session",
          "id":"tv020jdssst6cbecsf7vnavajd",
          "attributes":{
             "TokenId":"tv020jdssst6cbecsf7vnavajd",
             "ExpiresIn":604800,
             "InteractiveTimeout":604800,
             "LoggedIn":true,
             "Name":"Client One"
          }
       }
    }
    

    Use the /session/login resource to request authorization. Your username and password must be provided in the request body

    The JSON request body must include the following attributes:

    Response

    A successful request returns the HTTP 200 OK status code and a JSON response body including the same metadata as the /session endpoint.

    An unsuccessful request returns the HTTP 401 Unauthorized status code and a JSON response body including the error description.

    Logout, to release authorization

    Definition
    
    `PATCH` `http://sandbox.momapix.com/testme/rest/session/logout`
    
    Example Request
    
    curl http://sandbox.momapix.com/testme/rest/session/logout \
        -H "Apikey: 1n29BMfN7EtaPqTzO6D9RIqryZSSiLsJ" \
        -H "Content-Type: application/vnd.api+json" \
        -H "Accept: application/vnd.api+json" \
        -H "Authorization: Bearer tv020jdssst6cbecsf7vnavajd" \
        -X PATCH -d '{
            "data": {
                "id": "tv020jdssst6cbecsf7vnavajd",
                "type": "session",
                "attributes": {
                    }
                }
            }'
    
    Example Response
    
    {
       "data":{
          "type":"session",
          "id":"tv020jdssst6cbecsf7vnavajd",
          "attributes":{
             "TokenId":"tv020jdssst6cbecsf7vnavajd",
             "ExpiresIn":604800,
             "InteractiveTimeout":604800,
             "LoggedIn":false,
             "Name":null
          }
       }
    }
    
    Example Request
    
    <?php
    $url = 'http://sandbox.momapix.com/testme/rest/session/logout';
    $headers =  [
        'Authorization: Bearer tv020jdssst6cbecsf7vnavajd',
        'Apikey: 1n29BMfN7EtaPqTzO6D9RIqryZSSiLsJ',
        'Accept: application/vnd.api+json',
        'Content-Type: application/vnd.api+json'
    ];
    $body = '{
        "data": {
            "id": "tv020jdssst6cbecsf7vnavajd",
            "type": "session",
            "attributes": {
            }
        }
    }';
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, $url);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'PATCH');
    curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($body));
    curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
    $response = curl_exec($curl);
    $info = curl_getinfo($curl);
    curl_close($curl);
    $output = json_decode($response, true);
    ?>
    
    Example Response
    
    {
       "data":{
          "type":"session",
          "id":"tv020jdssst6cbecsf7vnavajd",
          "attributes":{
             "TokenId":"tv020jdssst6cbecsf7vnavajd",
             "ExpiresIn":604800,
             "InteractiveTimeout":604800,
             "LoggedIn":false,
             "Name":null
          }
       }
    }
    

    Use the /session/logout resource to release authorization bound to your Bearer Token

    The JSON request body must include the following informations:

    Response

    A successful request returns the HTTP 200 OK status code and a JSON response body including the same metadata as the /session endpoint.


    Searches

    MomaPIX archives are searchable throw the MomaPIX Query Language (MQL). MQL is a standard language for accessing the database throw the REST API services. An MQL instruction must be submitted as a query parameter to the MomaPIX archive using an HTTP GET request. Basically the MQL allow you to specify the keywords and the attributes value to be matched against the DB. Additional query parameters can be used to fine tune the results.

    GET - searching the db

    Request

    Definition
    
    `GET` `http://sandbox.momapix.com/testme/rest/search/items?<query parametes>`
    
    Example Request
    
    curl -i http://sandbox.momapix.com/testme/rest/search/items?\
        filter=postion%3A1%20foobar&fields[items]=title,caption,date&page[number]=1&page[size]=100 \
        -H "Apikey: 1n29BMfN7EtaPqTzO6D9RIqryZSSiLsJ" \
        -H "Accept: application/vnd.api+json" \
        -H "Authorization: Bearer tv020jdssst6cbecsf7vnavajd"
    
    
    
    Definition
    
    `GET` `http://sandbox.momapix.com/testme/rest/search/items?<query parametes>`
    
    Example Request
    
    <?php
    $url = 'http://sandbox.momapix.com/testme/rest/search/items?\
         filter=postion%3A1%20foobar&fields[items]=title,caption,date&page[number]=1&page[size]=100';
    $headers =  [
        'Authorization: Bearer tv020jdssst6cbecsf7vnavajd',
        'Apikey: 1n29BMfN7EtaPqTzO6D9RIqryZSSiLsJ',
        'Accept: application/vnd.api+json'
    ];
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, $url);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
    $response = curl_exec($curl);
    $info = curl_getinfo($curl);
    curl_close($curl);
    $output = json_decode($response, true);
    
    

    MomaPIX is a Digital Asset Managemet software used primarily for organizing visual content. Any resource archived in the database is called ITEM. Items are usually grouped together according to some common characteristics. A collection of items is called EVENT.

    Use the /rest/search/items endpoint and the GET method followed by the query parameters to submit a search request and retrieving matching items

    GET /rest/search/items?<query parameters>

    Use the /rest/search/events endpoint and the GET method followed by the query parameters to submit a search request and retrieving matching events. A matched event is any event for which at least one matching item exists.

    GET /rest/search/events?<query parameters>

    A query parameter is a pair of key and value. The available keys are listed below:

    Keys Possible value Default Description
    page[number] positive integer 1 The page number to show
    page[size] positive integer beetween 1 and 999 100 The pagination size. Not all values are accepted. This number will be always rounded to the next or the max value supported. Some supported value can be 10,16,20,25,32,50,64,96,100,200,250. Check with the OPTIONS method to get details information.
    sort date,relevance The sort criteria to be applied to the results
    fields[items] comma separated strings Fields (related to returned items) to be included in the response JSON body. By default, in order to optimize the use of bandwidth, only a subset of attributes are returned. More optimization can be reached specifing a smaller subset. The all special value let you ask for the complete list of available fields. Check the /search/items endpoint with the OPTIONS method to get detailed list of available value.
    fields[events] comma separated strings Fields (related to returned events) to be included in the response JSON body. By default, in order to optimize the use of bandwidth, only a subset of attributes are returned. More optimization can be reached specifing a smaller subset. The all special value let you ask for the complete list of available fields. Check the /search/events endpoint with the OPTIONS method to get detailed list of available value.
    filter MQL String Keywords and attributes to be matched against the db. Read the MQL chapter to better understand the syntax

    Non-existent keys will be ignored. Invalid MQL String will generate an error. Invalid value for other existing keys will be ignored and the default value will be used instead.

    MomaPIX Query Language

    MQL (MomaPIX Query Language) is the language used to send a search request to a MomaPIX archive. An MQL statement consists of two essential parts:

    An MQL string MUST be URL-encode according to RFC 3986 and must be forwarded to the server as the value of the filter key in the HTTP GET query string .

    filter=<MQL string>

    Searching by keywords

    The keywords part is mandatory. Blank search is usually not allowed. There may be exceptions to this rule depending on the MomaPIX archive.

    The keywords part consists of one or more words separated by space.

    The keywords part can also be used to search by id or by file name.

    All the terms indicated in the keywords part are searched within the general index of the momapix database.

    It is possible to use particular operators to modify the default logic with which the search is carried out.

    The available operators are listed below.

    Rule Example Results
    the space between words implies default AND logic star wars match any records with both the words star and wars
    operator | can be used to switch to the OR logic star | wars match any records with at least one of the words star and wars
    round brackets can be used for grouping words audience | (star wars) match any records with the word audience OR both the words star and wars
    operator - implements the NOT logic start -wars match any records with the word star and without the word wars
    operator " can be used for exact search of sentences "star wars is back" match any records with the exatct phrase "star wars is back"
    operator @ can be used to specify the db field to be searched @caption star match any records with the word star in the caption. Use the OPTIONS method to know the list of avaliable fields.
    colon (:) and double quote(") are reserved characters and can't be used in the keywords string "star wars: a new hope" syntax error!

    Here's an example MQL string that uses some of these operators:

    "star wars is back" | @caption star | (audience friday -pope)

    The full meaning of this search is:

    Filtering results with attributes

    The attribute:value pairs part is optional but, if present, MUST always precede the keywords part. attribute and value MUST be separated by colon. attribute:value pairs MUST be separated by space.

    The attributes available depends on the MomaPIX server configuration. Some very generic attributes and their possible values usually availables are the following:

    Attribute Value Description
    position 1
    2
    4
    8
    portrait orientation
    landscape
    squared
    panoramic

    Values con be combined using a binary OR operation, so 3 means portrait or landscape orientation. Setting this attribute to value 15 or not using this attribute:value pair is equivalent.
    license 1
    2
    4
    Rights-managed license
    Royalty free
    Copyright free

    Values con be combined using a binary OR operation, so 3 means Rights-managed or Royalty free orientation.
    media_type 1
    2
    4
    8
    Photo
    Video
    Audio
    Text

    Values con be combined using a binary OR operation
    image_size 1
    2
    3
    4
    5
    6
    At least 70MB
    At least 48MB
    At least 24MB
    At least 15MB
    At least 5MB
    At least 1MB

    This filter only have meaning for images. It refers to the size in memory.
    subject_date YYYYMMDD-YYYYMMDD
    YYYYMMDD-
    -YYYYMMDD
    YYYYMMDD
    Search within a date interval
    Search after a date
    Search before a date
    Search in a particular date

    Here's an example MQL string that uses some of these attributes for tuning a keywords search:

    media_type:1 license:6 position:2 subject_date:20180101- "star wars is back" | star | (audience wednesday -pope)*

    The full meaning of this search is:

    Many other attributes can be available according to the server configuration. Use the OPTIONS method to retrive details.

    Dealing with languages

    The keywords part of the MQL string, unless otherwise specified, should be provided in the same language indicated in the request header Accept-language parameter (See requirement chapter abount it). A different language can be used by specifying it with the Content-language parameter in the request header. In such a circumstance, the server that supports queries in languages ​​other than the one used for the database, will translate the keywords before sending the request. If translation features is not available, che Content-language paramenter supplied in the request will be ignored.

    Response

    Example Response
    {
        "data": {
            "type": "search",
            "id": "iiutyyyhhhrnndt5673652tteyhgdfefs",
            "meta": {
                "hit": 1,
                "page": 1,
                "show": 100
            },
            "links": {
                "self": "http://sandbox.my.momapix.com/testme/rest/search/items?filter=foobar&page[number]=1&page[size]=100",
                "first": "http://sandbox.my.momapix.com/testme/rest/search/items?filter=foobar&page[number]=1&page[size]=100",
                "last": "http://sandbox.my.momapix.com/testme/rest/search/items?filter=foobar&page[number]p=1&page[size]=100"
            },
            "relationship": {
                "items": {
                    "data": [
                        {
                            "type": "items",
                            "id": 3000
                        }
                    ]
                }
             }
           },
        "included": [
            {
                "type": "items",
                "id": 3000,
                "attributes": {
                    "caption": "foobar",
                    "date": "2020-01-01",
                    "title": "- nuovo servizio caricato da XXX il 01-01-2020 001"
    
                }
            ]
        }
    }
    

    A successful request returns the HTTP 200 OK status code and a JSON response body with detail abount matched resources.

    The JSON body will include the following strutured object:

    name content
    meta A pool of attributes specifing how many records has been found (hit attribute) and how many records have been returned according to pagination parameters (page and show attributes).
    relationship An object with the list of resource returned. For each resource the type and id are specified.
    links According to request and pagination settings, links will be provided for fetching the next , the previus, the last and the first pool of results.
    included An array of resources. Those can be items object resource or events object resource according to the type of request performed. The list of attributes returned for each resource will be set according to the field[items] or fields[events] query parameter.

    A request that do not match any record returns the HTTP 200 OK status code and a JSON response body without relationship and included properties.

    A request that cannot be understood for any type of syntax error in the query string returns the HTTP 400 Bad Request status code.

    Information about a specific item or a specific event can be retrived using the didicated endpoints /rest/items/<id> and /rest/events/<id_event>

    For detail about the attributes returned within each items object resource from the /rest/search/items endpoint check the get response paragraph in the Items section.

    For detail about the attributes returned within each events object resource from the /rest/search/events endpoint check the get response paragraph in the Events section.

    Download

    The download of files from a MomaPIX archive can be done connecting to the endpoint /rest/download. This endpoint is accessible via three different HTTP methods:

    POST, GET, OPTIONS

    Use the POST method to request the creation of a downloadable object. The downloadable object is an object containing an article or a collection of articles. The download of an article consists of the file representing the article itself. The download of a collection of articles consists of a zip file that contains all the articles requested.

    Use the GET method to start the download of the created downloadable object.

    Use the OPTIONS method to ask the server about available download parameters.

    Considering what has been said, downloading a file from a MomaPIX site is a process that requires two consecutive requests: a POST request followed by a GET request. Let's see the details below.

    POST - creating the downloadable object

    Request

    Definition 
    
    POST http://sandbox.momapix.com/testme/rest/download
    
    Example Request
    
    curl -i http://sandbox.momapix.com/testme/rest/download \
        -H "Apikey: 1n29BMfN7EtaPqTzO6D9RIqryZSSiLsJ" \
        -H "Content-Type: application/vnd.api+json" \
        -H "Accept: application/vnd.api+json" \
        -H "Authorization: Bearer tv020jdssst6cbecsf7vnavajd" \
        -X POST --data '{
            "data": {
                "type": "download",
                "relationships": {
                    "items":{
                        "data":[
                            {
                                "type":"item",
                                "id":"3004"
                            },
                            {
                                "type":"item",
                                "id":"3006"
                            },
                            [...]
                        ]
                    }
                }
            }
        }'
    
    Example Success Response
    
    {
      "data": {
        "type": "download",
        "id": "f719ae386dd1f170944db2fa9386aee4",
        "attributes": {
          "expirationTime": "UTC_TIMESTAMP",
          "downloadLimit": 1
        },
        "links": {
          "self": "http://sandbox.my.momapix.com/testme/rest/download?h=f719ae386dd1f170944db2fa9386aee4"
        }
      }
    }
    
    
    Definition 
    
    POST http://sandbox.momapix.com/testme/rest/download
    
    Example Request
    <?php
    $url = 'http://sandbox.momapix.com/testme/rest/download';
    $headers =  [
        'Authorization: Bearer tv020jdssst6cbecsf7vnavajd',
        'Apikey: 1n29BMfN7EtaPqTzO6D9RIqryZSSiLsJ',
        'Accept: application/vnd.api+json',
        'Content-Type: application/vnd.api+json'
    ];
    $body = '{
        "data": {
            "type": "download",
            "relationships": {
                "items":{
                    "data":[
                        {
                            "type":"item",
                            "id":"3004"
                        },
                        {
                            "type":"item",
                            "id":"3006"
                        },
                        [...]
                    ]
                }
            }
        }
    }';
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, $url);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($body));
    curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
    $response = curl_exec($curl);
    $info = curl_getinfo($curl);
    curl_close($curl);
    $output = json_decode($response, true);
    ?>
    
    Example Success Response
    
    {
      "data": {
        "type": "download",
        "id": "f719ae386dd1f170944db2fa9386aee4",
        "attributes": {
          "expirationTime": "UTC_TIMESTAMP",
          "downloadLimit": 1
        },
        "links": {
          "self": "http://sandbox.my.momapix.com/testme/rest/download?h=f719ae386dd1f170944db2fa9386aee4"
        }
      }
    }
    
    

    Use the /rest/download endpoint and the POST method to request the creation of a downloadable object. Use the body of the request to transmit a JSON specifing details about the wished content.

    POST http://sandbox.momapix.com/testme/rest/download

    The JSON request body MUST include the following attributes:

    "items" -> "data" -> [list of item entities]

    An item entities MUST include the following attributes:

    An item entities MAY include the following attributes:

    None of the above attributes are necessarily managed by the MomaPIX server. Use the OPTIONS method to know details available on the MomaPIX installation you are connecting to.

    Response

    A successful request returns the HTTP 201 Created status code and a JSON body describing the downloadable object created; it's identified by the Id attribute reported in the JSON response. The link attribute contains the complete uri to use for fetching the downloadable object. The same link is returned within the header in the Location attribute.

    A partial successful request returns the HTTP 201 Created status code and a JSON body describing the downloadable object (the same description available after a successful request) plus a meta attributes describing the error occurred. This situation accurrs when only a subset of the requested items are available for download.

    If none of the items requested are availables for download an HTTP 403 Forbidden error is returned with a JSON body describing the error occurred.

    GET - fetching the downloadable object

    Request
    GET http://sandbox.my.momapix.com/testme/rest/download?h=<download hash code>
    
    Example Request
    
    curl -i http://sandbox.momapix.com/testme/rest/download?h=f719ae386dd1f170944db2fa9386aee4 \
        -H "Apikey: 1n29BMfN7EtaPqTzO6D9RIqryZSSiLsJ" \
        -H "Content-Type: application/vnd.api+json" \
        -H "Accept: application/vnd.api+json;q=0.9,*/*;q= 0.8" \
        -H "Authorization: Bearer tv020jdssst6cbecsf7vnavajd"
    
    Example Request
    <?php
    $url = 'http://sandbox.momapix.com/testme/rest/download?h=adadaPqTzO6D9RIqryZSSdf44';
    $headers =  [
        'Authorization: Bearer tv020jdssst6cbecsf7vnavajd',
        'Apikey: 1n29BMfN7EtaPqTzO6D9RIqryZSSiLsJ',
        'Content-Type: application/vnd.api+json',
        'Accept: application/vnd.api+json;q=0.9,*/*;q= 0.8'
    ];
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, $url);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
    $response = curl_exec($curl);
    $info = curl_getinfo($curl);
    curl_close($curl);
    $output = json_decode($response, true);
    

    Use the /rest/download endpoint and the GET method followed by the one-time hash code identifier obtained during the previous POST call to start downloading the object.

    GET /rest/download?h=<download hash code>

    Response

    A successful request returns an HTTP 200 OK status code and the requested file to be locally saved.

    An unsuccessful request return an HTTP 40x status code and a JSON body describing the error occurred.

    OPTIONS - information abaut download options

    Request

    Each MomaPIX installation offers different possibilities for downloading files. Query to the /rest/download using the OPTIONS method in order to get more informartion and retrive the JSON scheme url. Any available features are describe in the JSON scheme.

    OPTIONS /rest/download

    Items

    An ITEM is tha main resource archived in a MomaPIX archive. Usually it is a visual file (image or video) with its related metadata, but it can be any kind of file. Management of items is realized throw the endpoint /rest/item. This endpoint is accessible via two different HTTP methods:

    GET, OPTIONS

    GET - fetching information abount an item

    Definition 
    
    GET http://sandbox.my.momapix.com/testme/rest/items/<id>
    
    Example Request
    
    curl -i http://sandbox.my.momapix.com/testme/rest/items/2241382 \
        -H "Apikey: 1n29BMfN7EtaPqTzO6D9RIqryZSSiLsJ" \
        -H "Content-Type: application/vnd.api+json" \
        -H "Accept: application/vnd.api+json" \
        -H "Authorization: Bearer tv020jdssst6cbecsf7vnavajd"
    
    Example Success Response
    
    {
       "data":{
          "type":"items",
          "id":2241382,
          "attributes":{
              "url_thumb_l":"http://sandbox.d0.momapix.com/testme/22108728d56d06bd29a753f9645185bf27d7fb176ff531414702faefe29c156e3c/Preview2241382.jpg",
             "url_thumb_m":"http://sandbox.d0.momapix.com/testme/22108728d56d06bd29a753f9645185bf27d7fb176ff531414702faefe29c156e3c/Image2241382.jpg",
             "url_stream_m":null,
             "xsize":3543,
             "ysize":2362,
             "id_event":699106,
             "id":2241382,
             "file_size":2278,
             "file_name":"phpimmg2241382.jpg",
             "file_extension":"jpg",
             "mime_type":"image/jpeg",
             "archive":"photo",
             "license":"RM",
             "uploaded_date":"2021-01-19 11:00:32",
             "lastupdate_date":"2021-01-19 11:49:45",
             "creation_date":"0000-00-00 00:00:00",
             "caption":"10/04/2018 Roma, stadio Olimpico, quarti di finale Champions League 2017-18, Roma-Barcellona, nella foto Daniele De Rossi e Edin Dzeko a fine partita",
             "keywords":"SPORT,CALCIO,ESTERNO,CON ALTRI",
             "copyrightstatus":"unmarked",
             "category":"SPO",
             "date":"2018-04-10",
             "credit":"Supplier Two",
             "headline":"Quarti di finale Champions League Roma-Barcellona"
          }
       }
    }
    

    Request

    Use the GET method to retrive information on a specific item:

    GET /rest/items/<id>

    Response

    A successful request returns an HTTP 200 OK status code and an item object resource enclosed in the JSON response body.

    The list of attribute returned in the item object resource is the complete list of valued attribute available on the server and corrisponds the same list of attributes returned inside the included section after a successfull request to the endpoint /rest/search/items or to the endpoint /rest/events unsing the parameter fields[items]=all

    Non valued attributes will not be returned.

    The item object resource returned by the rest/items endpoint includes the following attributes:

    name description
    url_thumb_l url of image preview
    url_thumb_m url of image thumbnail
    url_stream_m url of video preview
    xsize width in pixel
    ysize height in pixel
    id_event id of the related event
    id id of the item
    mime_type mime type of the current item
    file_size file size of the current item
    file_name original file name of the current item
    file_extension original file extension of the current item
    uploaded_date upload date and time of the file
    lastupdate_date last udate and time of the file
    creation_date creation date of the file
    archive type of item (photo,video,audio,text)
    license license of the item (RM for right-managed, RF for royalty-free, CF for copyright free

    Other attributes may be returned according on the server configuration. The other attributes returned are usually the ones describing the media type of the items according to the IPTC standard (e.g. title, headline, caption, keywords, category, date, author etc... etc...).

    An unsuccessful request returns an HTTP 40x status code and a JSON body describing the error occurred.

    Events

    An EVENT is a collection of ITEMS having some common characteristics . Such a set of items share an attribute named id_event that must be used in order to fetch information about an event. The endpoint /rest/events is accessible via two different HTTP methods:

    GET, OPTIONS

    GET - fetching information abount an event

    Definition 
    
    GET http://sandbox.my.momapix.com/testme/rest/events/2241382
    
    Example Request
    
    curl -i http://sandbox.my.momapix.com/testme/rest/items/2241382 \
        -H "Apikey: 1n29BMfN7EtaPqTzO6D9RIqryZSSiLsJ" \
        -H "Content-Type: application/vnd.api+json" \
        -H "Accept: application/vnd.api+json" \
        -H "Authorization: Bearer tv020jdssst6cbecsf7vnavajd"
    
    Example Success Response
    
    {
      "data": {
        "type": "events",
        "id": 100010,
        "attributes": {
          "text": null,
          "headline": "vestaglia"
        },
        "relationships": {
          "items": {
            "meta": {
              "hit": 5,
              "page": 1,
              "show": 100
            },
            "links": {
              "self": "http://sandbox.my.momapix.com/momapix1/rest/events/100010?page[number]=1&page[size]=100",
              "first": "http://sandbox.my.momapix.com/momapix1/rest/events/100010?page[number]=1&page[size]=100",
              "last": "http://sandbox.my.momapix.com/momapix1/rest/events/100010?page[number]=1&page[size]=100"
            },
            "data": [{
              "type": "items",
              "id": 3870
            }, 
            ...
            ]
          }
        }
      },
      "included": [{
        "type": "items",
        "id": 3870,
        "attributes": {
          "url_thumb_l": "http://sandbox.d0.momapix.com/momapix1/22ef1ac78f738966ca99b3c7db9e67e95aea45f0ca3ef7eb75a3ad90fa65f43ab0/Preview3870.jpg",
          "url_thumb_m": "http://sandbox.d0.momapix.com/momapix1/22ef1ac78f738966ca99b3c7db9e67e95aea45f0ca3ef7eb75a3ad90fa65f43ab0/Image3870.jpg",
          "url_stream_m": null,
          "xsize": 3543,
          "ysize": 4724,
          "id_event": 100010,
          "id": 3870,
          "mime_type": "image/jpeg",
          "archive": "photo",
          "license": "RM",
          "date": "2021-01-15",
          "headline": "vestaglia"
        }
      }, 
      ...
      ]
    }
    

    Request

    Use the GET method to retrive information about a specific event:

    GET /rest/events/<id>

    This endpoint supports the use of query parameters for setting pagination and fields filtering. The available keys are listed below:

    Keys Possible value Default Description
    page[number] positive integer 1 The page number to show
    page[size] positive integer beetween 1 and 999 100 The pagination size. Not all values are accepted. This number will be always rounded to the next or the max value supported. Some supported value can be 10,16,20,25,32,50,64,96,100,200,250.
    fields[items] comma separated strings Fields (related to returned items) to be included in the response JSON body. By default, in order to optimize the use of bandwidth, only a subset of attributes are returned. More optimization can be reached specifing a smaller subset. The all special value let you ask for the complete list of available fields.
    fields[events] comma separated strings Fields (related to fetched event) to be included in the response JSON body. By default, in order to optimize the use of bandwidth, only a subset of attributes are returned. More optimization can be reached specifing a smaller subset. The all special value let you ask for the complete list of available fields.

    An example of fully qualified request to the /rest/events endpoint is the following:

    https://<server address>/rest/events/100010

    The meaning of this request is:

    An example of fully qualified request to the /rest/events endpoint with query parametes is the following:

    https://<server address>/rest/items/100010?page[number]=1&page[size]=10&fields[items]=all&fields[events]=date,title`

    The meaning of this request is:

    Response

    A successful request returns an HTTP 200 OK status code and an event object resource JSON response body.

    The event object resource includes the following strutured object:

    name content
    type Always set to "events"
    id Always set to event id
    attributes An attributes object with information about the event. The list of returned attributes is set according to the fields[events] query parameter.
    relationships A relationships object containing meta-information about the pagination status (meta object), a set of link for fetching first, last, next and previous pool of related resources (link object), and an array with the list of related items returned in the included section.
    included An array of items object resource. The list of attributes returned for each resource will be set according to the field[items] query parameter.

    The attributes object returned by the rest/events endpoint includes the following attributes:

    name description
    url_thumb_l url of preview used to represent the event. It coincides with the preview of the first item of the event.
    url_thumb_m url of thumbnail used to represent the event. It coincides with the thumbnail of the first item of the event.
    xsize width in pixel of item used to represent the event.
    ysize height in pixel item used to represent the event.
    numberofitemsinevent number of items belonging to the event.
    text a text, could be very long (usually an article), describing the event.

    Other attributes may be returned according on the server configuration. The other attributes returned are all the attributes common to all the items of the event (for example, title and date).

    For information about the attributes returned within each items object resource from the /rest/events endpoint check the get response paragraph in the Items section.

    An unsuccessful request returns an HTTP 40x status code and a JSON body describing the error occurred.

    Reports

    Use /rest/reports/<resource> endpoint the fetch information from the MomaPIX backend reports panel. All the report resourses support pagination, sort and filtering.

    Pagination policy is the same for each resource and can be specified in the query part of the GET request using the following parameters:

    Parameter Type Description
    page[number] > 0
    default is 1
    The page number to show
    page[size] 10,100,250,500,999
    default is 100
    The pagination size

    Sort and filtering policies are specific to each resource.

    Parameter Type Description
    sort database field Database field to use for sorting
    q MQL string MQL syntax using database report view fields for filtering
    fields[reports/report_type] string "all", "default", or comma-separated list of attributes fields

    Downloads report

    In addition to the common MQL filters, it is possible to filter by dates

    Parameter Type Description
    download_date YYYYMMDD-YYYYMMDD Download date range
    publication_date YYYYMMDD-YYYYMMDD Download date range
    curl -G "http://sandbox.momapix.com/momapix/rest/reports/downloads" \
        -H "Apikey: 1n29BMfN7EtaPqTzO6D9RIqryZSSiLsJ" \
        -H "Content-Type: application/vnd.api+json" \
        -H "Accept: application/vnd.api+json" \
        -H "Authorization: Bearer ggg8dpugtesue2khfhmbg0hk0n" \
        -d page[number]=1 \
        -d page[size]=100 \
        -d download_date=20180101-20180201 \
        -d q=resolution:low \
        -d fields[reports/downloads]=all \
    
    Response
    
    {
        "data":{
            "type":"reports/downloads",
            "id":"ggg8dpugtesue2khfhmbg0hk0n",
            "meta":{
                "hit":"5",
                "page":1,
                "show":"64"
            },
            "links":{
                "self":"http://sandbox.momapix.com/momapix/rest/search?q=libero&p=1&s=64",
                "first":"http://sandbox.momapix.com/momapix/rest/search?q=libero&p=1&s=64",
                "last":"http://sandbox.momapix.com/momapix/rest/search?q=libero&p=1&s=64"
            },
            "data":[
                {
                    "id":"9",
                    "idfoto":"3004",
                    "id_item":"",
                    "id_connector":"0",
                    "thumb_src":"",
                    "id_event":"3000",
                    "id_remote":"0",
                    "id_user":"2",
                    "credit":"Claudio Melissari \/ VANDAX",
                    "subject_date":"2005-11-03",
                    "filename":"phpimmg103871.jpg",
                    "resolution":"high",
                    "watermark":"0",
                    "supplier_account":"root",
                    "client_account":"claudio",
                    "ipv4":"3232241409",
                    "download_date":"2018-02-02 10:08:07",
                    "method":"SINGLE_DOWNLOAD",
                    "agent":""
                },
                {
                    "id":"7",
                    "idfoto":"3064",
                    "id_item":"",
                    "id_connector":"0",
                    "thumb_src":"",
                    "id_event":"3007",
                    "id_remote":"0",
                    "id_user":"9",
                    "credit":"IMAGOECONOMICA",
                    "subject_date":"2018-01-08",
                    "filename":"A74P3485.JPG",
                    "resolution":"high",
                    "watermark":"0",
                    "supplier_account":"root",
                    "client_account":"anonymous",
                    "ipv4":"3232241409",
                    "download_date":"2018-01-17 11:47:35",
                    "method":"MANUAL_ENTRY",
                    "agent":""
                }
            ]
        }
    }
    
    Example request
    curl -G "http://sandbox.momapix.com/momapix/rest/reports/downloads" \
        -H "Apikey: 1n29BMfN7EtaPqTzO6D9RIqryZSSiLsJ" \
        -H "Content-Type: application/vnd.api+json" \
        -H "Accept: application/vnd.api+json" \
        -H "Authorization: Bearer ggg8dpugtesue2khfhmbg0hk0n" \
        -d page[number]=1 \
        -d page[size]=100 \
        -d download_date=20180101-20180201 \
        -d q=resolution:low \
    <?php
    $url = 'http://sandbox.momapix.com/momapix/rest/reports/downloads';
    $headers =  [
        'Authorization: Bearer tv020jdssst6cbecsf7vnavajd',
        'Apikey: 1n29BMfN7EtaPqTzO6D9RIqryZSSiLsJ',
        'Accept: application/vnd.api+json',
        'Content-Type: application/vnd.api+json'
    ];
    $query_params = [
        'page[number]'          =>  1,
        'page[size]'            =>  100,
        'filter[download_date]' =>  '20180101-20180201',
        'filter[resolution]'    =>  'low'
    ];
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, $url.'?'.http_build_query($query_params));
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
    $response = curl_exec($curl);
    $info = curl_getinfo($curl);
    curl_close($curl);
    $output = json_decode($response, true);
    ?>
    
    Response
    
    {
        "data":{
            "type":"reports/downloads",
            "id":"ggg8dpugtesue2khfhmbg0hk0n",
            "meta":{
                "hit":"5",
                "page":1,
                "show":"64"
            },
            "links":{
                "self":"http://sandbox.momapix.com/momapix/rest/search?q=libero&p=1&s=64",
                "first":"http://sandbox.momapix.com/momapix/rest/search?q=libero&p=1&s=64",
                "last":"http://sandbox.momapix.com/momapix/rest/search?q=libero&p=1&s=64"
            },
            "data":[
                {
                    "id":"9",
                    "idfoto":"3004",
                    "id_item":"",
                    "id_connector":"0",
                    "thumb_src":"",
                    "id_event":"3000",
                    "id_remote":"0",
                    "id_user":"2",
                    "credit":"Claudio Melissari \/ VANDAX",
                    "subject_date":"2005-11-03",
                    "filename":"phpimmg103871.jpg",
                    "resolution":"high",
                    "watermark":"0",
                    "supplier_account":"root",
                    "client_account":"claudio",
                    "ipv4":"3232241409",
                    "download_date":"2018-02-02 10:08:07",
                    "method":"SINGLE_DOWNLOAD",
                    "agent":""
                },
                {
                    "id":"7",
                    "idfoto":"3064",
                    "id_item":"",
                    "id_connector":"0",
                    "thumb_src":"",
                    "id_event":"3007",
                    "id_remote":"0",
                    "id_user":"9",
                    "credit":"IMAGOECONOMICA",
                    "subject_date":"2018-01-08",
                    "filename":"A74P3485.JPG",
                    "resolution":"high",
                    "watermark":"0",
                    "supplier_account":"root",
                    "client_account":"anonymous",
                    "ipv4":"3232241409",
                    "download_date":"2018-01-17 11:47:35",
                    "method":"MANUAL_ENTRY",
                    "agent":""
                }
            ]
        }
    }
    

    Use the /reports/downloads resource to list downloaded items.

    Request

    GET http://sandbox.momapix.com/momapix/rest/reports/downloads

    Available filters by query string parameters are listed below:

    Parameter Type Description
    resolution high,low,pdf Download format
    file_type photo,video,text File type
    idfoto >0 The id of the item
    id_event >0 The id of the event
    method SINGLEGROUP_DOWNLOAD, SINGLE_DOWNLOAD, GROUP_DOWNLOAD, MANUAL_ENTRY, SYNDICATION, ONLINE_ORDER, ONLINE_SALES Download method, i.e single or group download, only single download, only group download, manual entry (download insert by and for accounting), syndication, online order or online sale
    ipv4 string IP address e.g. 100.101.102.103
    doc_status: 0
    8
    1
    2
    4
    all types
    only pro-forma
    only invoices
    only reversals
    only statements
    Values con be combined using a binary OR operation, so 3 means invoices or reversals documents.
    client_name string Client name
    client_account string Client account
    client_tag string Client tag
    client_identification string
    supplier_name string Supplier name
    supplier_account string Supplier account
    supplier_tag string
    supplier_identification string
    watermark 0,1 With/without watermark
    category 3 chars category e.g. DFL
    filename string Filename
    source string Source
    keywords string Keywords
    order_id string Order ID
    sale_description string Sale description
    download_date yyyymmdd-yyyymmdd Download date (from date - to date)
    Both needed
    publication_date yyyymmdd-yyyymmdd Publication date (from date - to date)
    Both needed
    order_date yyyymmdd-yyyymmdd Order date (from date - to date)
    Both needed
    fields[reports/downloads] string "all", "default", or comma-separated list of attributes fields

    Invalid filters or invalid filter values will be skipped or default will be used.

    Response

    A successful request returns the HTTP 200 OK status code and a JSON response body that includes metadata information (page, hits and shown), an array of downloaded items and hyper text link for browsing between related resources

    Request

    GET http://sandbox.momapix.com/momapix/rest/reports/downloads/<downloads_report_id>

    Response

    A successful request returns the HTTP 200 OK status code and a JSON response body that includes the single download report item

    Uploads

    Use the /reports/uploads resource to list uploads items.

    Request

    GET http://sandbox.momapix.com/momapix/rest/reports/uploads

    Available filter for MQL are listed below:

    Parameter Type Description
    filter=id_item: >0 The id of the item
    filter=current_section: string Section. Es.: "public"
    filter=supplier_account: string Supplier account
    filter=file_name: string Filename
    filter=ipv4: string IP address
    upload_date aaaammdd-aaaammdd Upload date (from date - do date)
    Both needed
    publication_date aaaammdd-aaaammdd Download date (from date - do date)
    Both needed
    fields[reports/uploads] string "all", "default", or comma-separated list of attributes fields

    Invalid filters or invalid filter values will be skipped or default will be used.

    Response

    A successful request returns the HTTP 200 OK status code and a JSON response body that includes metadata information (page, hits and shown), an array of uploads items and hyper text link for browsing between related resources

    Request

    GET http://sandbox.momapix.com/momapix/rest/reports/uploads/<uploads_report_id>

    Response

    A successful request returns the HTTP 200 OK status code and a JSON response body that includes the single upload report item

    Searches

    Use the /reports/searches resource to list searches items.

    Request

    GET http://sandbox.momapix.com/momapix/rest/reports/searches

    Available filter for MQL are listed below:

    Parameter Type Description
    filter=ip: IP string IP address
    filter=client_account: string Client account
    filter=language: string 2 chars language code. Es.: "it"
    filter=category: string Category
    filter=keywords: string Keywords string
    date aaaammdd-aaaammdd Search date (from date - do date)
    Both needed
    fields[reports/searches] string "all", "default", or comma-separated list of attributes fields

    Invalid filters or invalid filter values will be skipped or default will be used.

    Response

    A successful request returns the HTTP 200 OK status code and a JSON response body that includes metadata information (page, hits and shown), an array of searches items and hyper text link for browsing between related resources

    Request

    GET http://sandbox.momapix.com/momapix/rest/reports/searches/<searches_report_id>

    Response

    A successful request returns the HTTP 200 OK status code and a JSON response body that includes the single search report item

    Orders

    Use the /reports/orders resource to list orders items.

    Request

    GET http://sandbox.momapix.com/momapix/rest/reports/orders

    Available filter for MQL are listed below:

    Parameter Type Description
    filter=order_id: >0 Order ID
    filter=transaction_id: >0 Transaction ID
    filter=status: string Order status
    filter=sender_email: string Sender email
    filter=total_amount: >0 Total amount
    order_date aaaammdd-aaaammdd Order date (from date - do date)
    Both needed
    fields[reports/orders] string "all", "default", or comma-separated list of attributes fields

    Invalid filters or invalid filter values will be skipped or default will be used.

    Response

    A successful request returns the HTTP 200 OK status code and a JSON response body that includes metadata information (page, hits and shown), an array of uploads items and hyper text link for browsing between related resources

    Request

    GET http://sandbox.momapix.com/momapix/rest/reports/orders/<orders_report_id>

    Response

    A successful request returns the HTTP 200 OK status code and a JSON response body that includes the single order report item

    Visits

    Use the /reports/visits resource to list visits items.

    Request

    GET http://sandbox.momapix.com/momapix/rest/reports/visits

    Available filter for MQL are listed below:

    Parameter Type Description
    fields[reports/visits] string "all", "default", or comma-separated list of attributes fields

    Invalid filters or invalid filter values will be skipped or default will be used.

    Response

    A successful request returns the HTTP 200 OK status code and a JSON response body that includes metadata information (page, hits and shown), an array of visits items and hyper text link for browsing between related resources

    Request

    GET http://sandbox.momapix.com/momapix/rest/reports/visits/<visits_report_id>

    Response

    A successful request returns the HTTP 200 OK status code and a JSON response body that includes the single visit report item

    Syndication

    Use the /reports/syndication resource to list uploads items.

    Request

    GET http://sandbox.momapix.com/momapix/rest/reports/syndication

    Available filter for MQL are listed below:

    Parameter Type Description
    filter=idfoto: >0 The id of the item
    filter=file_name: string Filename
    filter=sender: string Sender
    filter=recipient: string Recipient
    filter=status: string Status. Es.: sent
    filter=format: string Format. Es.: full
    date aaaammdd-aaaammdd Syndication date (from date - do date)
    Both needed
    fields[reports/syndication] string "all", "default", or comma-separated list of attributes fields

    Invalid filters or invalid filter values will be skipped or default will be used.

    Response

    A successful request returns the HTTP 200 OK status code and a JSON response body that includes metadata information (page, hits and shown), an array of syndication items and hyper text link for browsing between related resources

    Request

    GET http://sandbox.momapix.com/momapix/rest/reports/syndication/<syndication_report_id>

    Response

    A successful request returns the HTTP 200 OK status code and a JSON response body that includes the single syndication report item

    Embeds

    Use the /reports/embeds resource to list embeds items.

    Request

    GET http://sandbox.momapix.com/momapix/rest/reports/embeds

    Available filter for MQL are listed below:

    Parameter Type Description
    filter=id_item: >0 The id of the item
    filter=enabled: 0 1
    filter=client_account: string Client account
    filter=size: >0 Embed size
    fields[reports/embeds] string "all", "default", or comma-separated list of attributes fields

    Invalid filters or invalid filter values will be skipped or default will be used.

    Response

    A successful request returns the HTTP 200 OK status code and a JSON response body that includes metadata information (page, hits and shown), an array of embeds items and hyper text link for browsing between related resources

    Request

    GET http://sandbox.momapix.com/momapix/rest/reports/embeds/<embeds_report_id>

    Response

    A successful request returns the HTTP 200 OK status code and a JSON response body that includes the single embed report item

    Logs

    Use the /reports/logs resource to list logs items.

    Request

    GET http://sandbox.momapix.com/momapix/rest/reports/logs

    Available filter for MQL are listed below:

    Parameter Type Description
    filter=account: string Log client account
    filter=ipv4: IP string IP address
    filter=type: string Log channel
    filter=severity: >0 Log severity
    filter=pid: >0 PID
    filter=sid: >0 SID
    date aaaammdd-aaaammdd Log date (from date - do date)
    Both needed
    fields[reports/logs] string "all", "default", or comma-separated list of attributes fields

    Invalid filters or invalid filter values will be skipped or default will be used.

    Response

    A successful request returns the HTTP 200 OK status code and a JSON response body that includes metadata information (page, hits and shown), an array of logs items and hyper text link for browsing between related resources

    Request

    GET http://sandbox.momapix.com/momapix/rest/reports/logs/<log_report_id>

    Response

    A successful request returns the HTTP 200 OK status code and a JSON response body that includes the single log report item