All URIs are relative to https://panel.sendcloud.sc/api/v3.
| Method | HTTP request | Description |
|---|---|---|
| scPublicV3DsfPostFiles() | POST /dsf/files | Upload a file |
scPublicV3DsfPostFiles($file): \Toppy\Sendcloud\V3\Model\ScPublicV3DsfPostFiles201ResponseUpload a file
API for uploading a file required for ticket creation. The uploaded file is stored in the system, and a unique file token is returned in response.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: HTTPBasicAuth
$config = Toppy\Sendcloud\V3\Configuration::getDefaultConfiguration()
->setUsername('YOUR_USERNAME')
->setPassword('YOUR_PASSWORD');
$apiInstance = new Toppy\Sendcloud\V3\Api\FileUploadApi(
// If you want use custom http client, pass your client which implements `Psr\Http\Client\ClientInterface`.
// This is optional, `Psr18ClientDiscovery` will be used to find http client. For instance `GuzzleHttp\Client` implements that interface
new GuzzleHttp\Client(),
$config
);
$file = '/path/to/file.txt'; // \SplFileObject
try {
$result = $apiInstance->scPublicV3DsfPostFiles($file);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling FileUploadApi->scPublicV3DsfPostFiles: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| file | \SplFileObject**\SplFileObject** |
\Toppy\Sendcloud\V3\Model\ScPublicV3DsfPostFiles201Response
- Content-Type:
multipart/form-data - Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]