Skip to content

Latest commit

 

History

History
196 lines (134 loc) · 6.59 KB

CampaignsApi.md

File metadata and controls

196 lines (134 loc) · 6.59 KB

mosquito_alert.CampaignsApi

All URIs are relative to https://api.mosquitoalert.com/v1

Method HTTP request Description
campaigns_list GET /campaigns/
campaigns_retrieve GET /campaigns/{id}/

campaigns_list

PaginatedCampaignList campaigns_list(country_id=country_id, is_active=is_active, order_by=order_by, page=page, page_size=page_size)

Example

  • Api Key Authentication (cookieAuth):
  • Api Key Authentication (tokenAuth):
  • Bearer (JWT) Authentication (jwtAuth):
import mosquito_alert
from mosquito_alert.models.paginated_campaign_list import PaginatedCampaignList
from mosquito_alert.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.mosquitoalert.com/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = mosquito_alert.Configuration(
    host = "https://api.mosquitoalert.com/v1"
)

# 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 API key authorization: cookieAuth
configuration.api_key['cookieAuth'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['cookieAuth'] = 'Bearer'

# Configure API key authorization: tokenAuth
configuration.api_key['tokenAuth'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['tokenAuth'] = 'Bearer'

# Configure Bearer authorization (JWT): jwtAuth
configuration = mosquito_alert.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with mosquito_alert.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = mosquito_alert.CampaignsApi(api_client)
    country_id = 56 # int | Country in which the campaign is taking place (optional)
    is_active = True # bool |  (optional)
    order_by = ['order_by_example'] # List[str] | Ordenamiento   (optional)
    page = 56 # int | A page number within the paginated result set. (optional)
    page_size = 56 # int | Number of results to return per page. (optional)

    try:
        api_response = api_instance.campaigns_list(country_id=country_id, is_active=is_active, order_by=order_by, page=page, page_size=page_size)
        print("The response of CampaignsApi->campaigns_list:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CampaignsApi->campaigns_list: %s\n" % e)

Parameters

Name Type Description Notes
country_id int Country in which the campaign is taking place [optional]
is_active bool [optional]
order_by List[str] Ordenamiento [optional]
page int A page number within the paginated result set. [optional]
page_size int Number of results to return per page. [optional]

Return type

PaginatedCampaignList

Authorization

cookieAuth, tokenAuth, jwtAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

campaigns_retrieve

Campaign campaigns_retrieve(id)

Example

  • Api Key Authentication (cookieAuth):
  • Api Key Authentication (tokenAuth):
  • Bearer (JWT) Authentication (jwtAuth):
import mosquito_alert
from mosquito_alert.models.campaign import Campaign
from mosquito_alert.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.mosquitoalert.com/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = mosquito_alert.Configuration(
    host = "https://api.mosquitoalert.com/v1"
)

# 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 API key authorization: cookieAuth
configuration.api_key['cookieAuth'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['cookieAuth'] = 'Bearer'

# Configure API key authorization: tokenAuth
configuration.api_key['tokenAuth'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['tokenAuth'] = 'Bearer'

# Configure Bearer authorization (JWT): jwtAuth
configuration = mosquito_alert.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with mosquito_alert.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = mosquito_alert.CampaignsApi(api_client)
    id = 56 # int | A unique integer value identifying this ow campaigns.

    try:
        api_response = api_instance.campaigns_retrieve(id)
        print("The response of CampaignsApi->campaigns_retrieve:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CampaignsApi->campaigns_retrieve: %s\n" % e)

Parameters

Name Type Description Notes
id int A unique integer value identifying this ow campaigns.

Return type

Campaign

Authorization

cookieAuth, tokenAuth, jwtAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 -

[Back to top] [Back to API list] [Back to Model list] [Back to README]