Skip to content

Latest commit

 

History

History
81 lines (54 loc) · 4.53 KB

CreateCampaignApi.md

File metadata and controls

81 lines (54 loc) · 4.53 KB

grabfood.CreateCampaignApi

All URIs are relative to https://partner-api.grab.com/grabfood-sandbox

Method HTTP request Description
create_campaign POST /partner/v1/campaigns Create campaign

create_campaign

CreateCampaignResponse create_campaign(content_type, authorization, create_campaign_request)

Create campaign

Example

import grabfood
from grabfood.models.create_campaign_request import CreateCampaignRequest
from grabfood.models.create_campaign_response import CreateCampaignResponse
from grabfood.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://partner-api.grab.com/grabfood-sandbox
# See configuration.py for a list of all supported configuration parameters.
configuration = grabfood.Configuration(
    host = "https://partner-api.grab.com/grabfood-sandbox"
)


# Enter a context with an instance of the API client
with grabfood.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = grabfood.CreateCampaignApi(api_client)
    content_type = 'application/json' # str | The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats.
    authorization = 'Bearer <ACCESS_TOKEN_HERE>' # str | Specify the generated authorization token of the bearer type.
    create_campaign_request = grabfood.CreateCampaignRequest() # CreateCampaignRequest | 

    try:
        # Create campaign
        api_response = api_instance.create_campaign(content_type, authorization, create_campaign_request)
        print("The response of CreateCampaignApi->create_campaign:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CreateCampaignApi->create_campaign: %s\n" % e)

Parameters

Name Type Description Notes
content_type str The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats.
authorization str Specify the generated authorization token of the bearer type.
create_campaign_request CreateCampaignRequest

Return type

CreateCampaignResponse

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 The API request is successfully processed. -
400 invalid_argument Code

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