Skip to content

Latest commit

 

History

History
72 lines (50 loc) · 2.58 KB

GetOauthGrabApi.md

File metadata and controls

72 lines (50 loc) · 2.58 KB

Grab\GrabfoodApiSdk\GetOauthGrabApi

All URIs are relative to https://partner-api.grab.com/grabfood-sandbox, except if the operation defines another base path.

Method HTTP request Description
getOauthGrab() POST /grabid/v1/oauth2/token Get Oauth access token

getOauthGrab()

getOauthGrab($content_type, $grab_oauth_request): \Grab\GrabfoodApiSdk\Model\GrabOauthResponse

URI(s):

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');



$apiInstance = new Grab\GrabfoodApiSdk\Api\GetOauthGrabApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$content_type = 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.
$grab_oauth_request = new \Grab\GrabfoodApiSdk\Model\GrabOauthRequest(); // \Grab\GrabfoodApiSdk\Model\GrabOauthRequest | 

$hostIndex = 0;
$variables = [
];

try {
    $result = $apiInstance->getOauthGrab($content_type, $grab_oauth_request, $hostIndex, $variables);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling GetOauthGrabApi->getOauthGrab: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
content_type 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.
grab_oauth_request \Grab\GrabfoodApiSdk\Model\GrabOauthRequest
hostIndex null int Host index. Defaults to null. If null, then the library will use $this->hostIndex instead
variables array Associative array of variables to pass to the host. Defaults to empty array. [optional]

Return type

\Grab\GrabfoodApiSdk\Model\GrabOauthResponse

Authorization

No authorization required

HTTP request headers

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

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