UploadFile¶
Create Issues by uploading a file directly through the API using this function.
Request¶
POST https://api.uberflip.com/?Version=0.1&Method=UploadFile&APIKey=xxxxxxx&Signature=xxxxxx&TitleId=123&IssueName=Test%20Issue&ResponseType=XML
URL Parameters | Description |
---|---|
Version | The version of the API to call (0.1 ). |
Method | The method being called (UploadFile ). |
APIKey | Your account’s API key. |
Signature | Your account’s API signature. |
UserId | (required for master/reseller accounts) The account identifier of the account to call the method on. |
Query | The search query. |
TitleId | The identifier of the Title to create the Issue in. |
IssueName | The name of the Issue. |
File | The file to upload. |
ResponseType | (optional) The response format (XML or JSON ). Defaults to JSON . |
PublishDate | (optional) The publish date of the Issue. |
Make sure when posting a file (regardless of method) to include the equivalent of enctype=”multipart/form-data”
Examples¶
Sample request (PHP):
$request = array(
'APIKey' => "your-api-key",
'Signature' => "your-api-signature",
'Version' => '0.1',
'Method' => 'UploadFile',
'IssueName' => 'Demo Issue',
'TitleId' => 1234,
'PublishDate' => "2012-12-12 00:00:00",
'ResponseType' => 'JSON'
);
$url = "https://api.uberflip.com//?".http_build_query($request);
$params = array('File' => '@/full/path/to/file.pdf');
$ch = curl_init();
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
$response = curl_exec($ch);
Sample response:
<Response>
<Success>
<Code>OK</Code>
<ID>54321</ID>
<Description>Issue uploaded and created successfully.</Description>
</Success>
</Response>