All URIs are relative to https://api.postmypost.io/v4.1
| Method | HTTP request | Description |
|---|---|---|
| complete_upload | POST /upload/complete | Complete file upload |
| init_upload | POST /upload/init | Initialize file upload |
| status_upload | GET /upload/status | Check file upload status |
UploadComplete complete_upload(id)
Complete file upload
Completes the file upload process after the file has been successfully sent.
- Bearer Authentication (BearerAuth):
import postmypost_rest_sdk
from postmypost_rest_sdk.models.upload_complete import UploadComplete
from postmypost_rest_sdk.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.postmypost.io/v4.1
# See configuration.py for a list of all supported configuration parameters.
configuration = postmypost_rest_sdk.Configuration(
host = "https://api.postmypost.io/v4.1"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization: BearerAuth
configuration = postmypost_rest_sdk.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with postmypost_rest_sdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = postmypost_rest_sdk.UploadApi(api_client)
id = 56 # int | Upload ID obtained during initialization
try:
# Complete file upload
api_response = api_instance.complete_upload(id)
print("The response of UploadApi->complete_upload:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling UploadApi->complete_upload: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | Upload ID obtained during initialization |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Upload completion | - |
| 400 | Bad request | - |
| 401 | Unauthorized | - |
| 403 | Forbidden | - |
| 404 | Not found | - |
| 422 | Unprocessable Entity | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UploadInit init_upload(init_upload_request)
Initialize file upload
Initializes the file upload process.
- Bearer Authentication (BearerAuth):
import postmypost_rest_sdk
from postmypost_rest_sdk.models.init_upload_request import InitUploadRequest
from postmypost_rest_sdk.models.upload_init import UploadInit
from postmypost_rest_sdk.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.postmypost.io/v4.1
# See configuration.py for a list of all supported configuration parameters.
configuration = postmypost_rest_sdk.Configuration(
host = "https://api.postmypost.io/v4.1"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization: BearerAuth
configuration = postmypost_rest_sdk.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with postmypost_rest_sdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = postmypost_rest_sdk.UploadApi(api_client)
init_upload_request = postmypost_rest_sdk.InitUploadRequest() # InitUploadRequest | Initializes the file upload process. Requires one of the following parameter combinations: - `project_id` and `url` - `project_id`, `name`, and `size`
try:
# Initialize file upload
api_response = api_instance.init_upload(init_upload_request)
print("The response of UploadApi->init_upload:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling UploadApi->init_upload: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| init_upload_request | InitUploadRequest | Initializes the file upload process. Requires one of the following parameter combinations: - `project_id` and `url` - `project_id`, `name`, and `size` |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Upload initialized | - |
| 400 | Bad request | - |
| 401 | Unauthorized | - |
| 403 | Forbidden | - |
| 404 | Not found | - |
| 422 | Unprocessable Entity | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UploadStatus status_upload(id)
Check file upload status
Checks the processing status of an uploaded file.
- Bearer Authentication (BearerAuth):
import postmypost_rest_sdk
from postmypost_rest_sdk.models.upload_status import UploadStatus
from postmypost_rest_sdk.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.postmypost.io/v4.1
# See configuration.py for a list of all supported configuration parameters.
configuration = postmypost_rest_sdk.Configuration(
host = "https://api.postmypost.io/v4.1"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization: BearerAuth
configuration = postmypost_rest_sdk.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with postmypost_rest_sdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = postmypost_rest_sdk.UploadApi(api_client)
id = 56 # int | Upload ID obtained during initialization
try:
# Check file upload status
api_response = api_instance.status_upload(id)
print("The response of UploadApi->status_upload:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling UploadApi->status_upload: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | Upload ID obtained during initialization |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Get upload status | - |
| 400 | Bad request | - |
| 401 | Unauthorized | - |
| 403 | Forbidden | - |
| 404 | Not found | - |
| 422 | Unprocessable Entity | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]