withVectorsTab-97x42
We's got 26,191,624 images, yo!

API Access

API Documentation - getMedia

Gets the download url for a file

Authentication

This method requires authentication. The account that you log in as will need an active subscription with downloads available. Use loginUser to log in a user. You will need to set the header "Cookie" to PHPSESSID=session_id where session_id is the session id that is returned by loginUser.

Cookie: PHPSESSID=session_id;

Arguments

Argument Type Element (array) Valid Values Default Value Detail
api_key string none you need a valid api key to use the API
session_id string existing session id none use loginUserto get a session id
id int existing media id none unique media id
download_type int
  • 1 - Photo
  • 2 - Vector
none For vector files, determines the type of file that is downloaded. Photo downloads the media as a jpeg, Vector downloads it as the original vector

Returned Values

Element (path) Name Type Description
/ url string Download url for the file. You may then make a request to this url to get the file. For the request to this url you will need to set the session cookie header the same as you do to authenticate to the api.

Example Query


<?xml version="1.0" encoding="utf-8"?>
<methodCall>
  <methodName>media.getMedia</methodName>
  <params>
    <param>
      <value>
        <string>YOUR_API_KEY</string>
      </value>
    </param>
    <param>
      <value>
        <string>SESSION_ID</string>
      </value>
    </param>
    <param>
      <value>
        <int>158002</int>
      </value>
    </param>
  </params>
</methodCall>

Example Response


<?xml version="1.0" encoding="utf-8"?>
<methodResponse>
  <params>
    <param>
      <value>
        <struct>
          <member>
            <name>url</name>
            <value>
              <string>
              http://www.photoxpress.com/Content/Download/158002/1/2074f30c423ba3034f25db3f0f689e12</string>
            </value>
          </member>
        </struct>
      </value>
    </param>
  </params>
</methodResponse>