Skip to content

Latest commit

 

History

History
96 lines (67 loc) · 3.47 KB

File metadata and controls

96 lines (67 loc) · 3.47 KB

postmypost_rest_sdk.ProjectsApi

All URIs are relative to https://api.postmypost.io/v4.1

Method HTTP request Description
get_projects GET /projects Get list of projects

get_projects

ProjectsResponse get_projects(sort=sort, page=page, per_page=per_page)

Get list of projects

Retrieve a list of all projects available for your account.

Example

  • Bearer Authentication (BearerAuth):
import postmypost_rest_sdk
from postmypost_rest_sdk.models.projects_response import ProjectsResponse
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.ProjectsApi(api_client)
    sort = 'sort_example' # str | List sorting parameter. Format: `sort=field` — ascending by field, `sort=-field` — descending by field. Multiple fields can be specified separated by a comma: `sort=field,-another_field`.  (optional)
    page = 1 # int | Page number (starts from 1). (optional) (default to 1)
    per_page = 20 # int | Number of items per page (maximum 50). (optional) (default to 20)

    try:
        # Get list of projects
        api_response = api_instance.get_projects(sort=sort, page=page, per_page=per_page)
        print("The response of ProjectsApi->get_projects:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ProjectsApi->get_projects: %s\n" % e)

Parameters

Name Type Description Notes
sort str List sorting parameter. Format: `sort=field` — ascending by field, `sort=-field` — descending by field. Multiple fields can be specified separated by a comma: `sort=field,-another_field`. [optional]
page int Page number (starts from 1). [optional] [default to 1]
per_page int Number of items per page (maximum 50). [optional] [default to 20]

Return type

ProjectsResponse

Authorization

BearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 List of projects -
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]