Skip to content

Latest commit

 

History

History
81 lines (53 loc) · 2.71 KB

UpdateCampaignAPI.md

File metadata and controls

81 lines (53 loc) · 2.71 KB

\UpdateCampaignAPI

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

Method HTTP request Description
UpdateCampaign Put /partner/v1/campaigns/{campaign_id} Update campaign

UpdateCampaign

UpdateCampaign(ctx, campaignId).ContentType(contentType).Authorization(authorization).UpdateCampaignRequest(updateCampaignRequest).Execute()

Update campaign

Example

package main

import (
	"context"
	"fmt"
	"os"
	grabfood "github.com/grab/grabfood-api-sdk-go"
)

func main() {
	contentType := "application/json" // string | 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>" // string | Specify the generated authorization token of the bearer type.
	campaignId := "campaignId_example" // string | 
	updateCampaignRequest := *grabfood.NewUpdateCampaignRequest() // UpdateCampaignRequest | 

	configuration := grabfood.NewConfiguration()
	apiClient := grabfood.NewAPIClient(configuration)
	r, err := apiClient.UpdateCampaignAPI.UpdateCampaign(context.Background(), campaignId).ContentType(contentType).Authorization(authorization).UpdateCampaignRequest(updateCampaignRequest).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `UpdateCampaignAPI.UpdateCampaign``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
campaignId string

Other Parameters

Other parameters are passed through a pointer to a apiUpdateCampaignRequest struct via the builder pattern

Name Type Description Notes
contentType string 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 string Specify the generated authorization token of the bearer type.

updateCampaignRequest | UpdateCampaignRequest | |

Return type

(empty response body)

Authorization

No authorization required

HTTP request headers

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

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