Skip to content

Latest commit

 

History

History
140 lines (108 loc) · 5.56 KB

UpdateMenuRecordApi.md

File metadata and controls

140 lines (108 loc) · 5.56 KB

UpdateMenuRecordApi

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

Method HTTP request Description
batchUpdateMenu PUT /partner/v1/batch/menu Batch Update Menu
updateMenu PUT /partner/v1/menu Update menu record

batchUpdateMenu

BatchUpdateMenuResponse batchUpdateMenu(contentType, authorization, batchUpdateMenuItem)

Batch Update Menu

Example

// Import classes:
import com.grab.grabfood.client.ApiClient;
import com.grab.grabfood.client.ApiException;
import com.grab.grabfood.client.Configuration;
import com.grab.grabfood.client.models.*;
import com.grab.grabfood.client.api.UpdateMenuRecordApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://partner-api.grab.com/grabfood-sandbox");

    UpdateMenuRecordApi apiInstance = new UpdateMenuRecordApi(defaultClient);
    String 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.
    String authorization = "Bearer <ACCESS_TOKEN_HERE>"; // String | Specify the generated authorization token of the bearer type.
    BatchUpdateMenuItem batchUpdateMenuItem = new BatchUpdateMenuItem(); // BatchUpdateMenuItem | 
    try {
      BatchUpdateMenuResponse result = apiInstance.batchUpdateMenu(contentType, authorization, batchUpdateMenuItem);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling UpdateMenuRecordApi#batchUpdateMenu");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

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.
batchUpdateMenuItem BatchUpdateMenuItem

Return type

BatchUpdateMenuResponse

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. Refer to status and errors for more info. -
400 invalid_argument Description
409 conflict. BatchUpdate ITEM xxx too frequently, retry after 10 seconds -
429 Too Many Requests -

updateMenu

updateMenu(contentType, authorization, updateMenuRequest)

Update menu record

Example

// Import classes:
import com.grab.grabfood.client.ApiClient;
import com.grab.grabfood.client.ApiException;
import com.grab.grabfood.client.Configuration;
import com.grab.grabfood.client.models.*;
import com.grab.grabfood.client.api.UpdateMenuRecordApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://partner-api.grab.com/grabfood-sandbox");

    UpdateMenuRecordApi apiInstance = new UpdateMenuRecordApi(defaultClient);
    String 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.
    String authorization = "Bearer <ACCESS_TOKEN_HERE>"; // String | Specify the generated authorization token of the bearer type.
    UpdateMenuRequest updateMenuRequest = new UpdateMenuRequest(); // UpdateMenuRequest | 
    try {
      apiInstance.updateMenu(contentType, authorization, updateMenuRequest);
    } catch (ApiException e) {
      System.err.println("Exception when calling UpdateMenuRecordApi#updateMenu");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

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.
updateMenuRequest UpdateMenuRequest

Return type

null (empty response body)

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status code Description Response headers
204 Successful. No Content returned. -