All URIs are relative to https://partner-api.stg-myteksi.com/grabfood-sandbox
Method | HTTP request | Description |
---|---|---|
GetOauthGrab | Post /grabid/v1/oauth2/token | Get Oauth access token |
GrabOauthResponse GetOauthGrab(ctx).ContentType(contentType).GrabOauthRequest(grabOauthRequest).Execute()
Get Oauth access token
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.
grabOauthRequest := *grabfood.NewGrabOauthRequest("<CLIENT_ID>", "<CLIENT_SECRET>", "client_credentials", "food.partner_api") // GrabOauthRequest |
configuration := grabfood.NewConfiguration()
apiClient := grabfood.NewAPIClient(configuration)
resp, r, err := apiClient.GetOauthGrabAPI.GetOauthGrab(context.Background()).ContentType(contentType).GrabOauthRequest(grabOauthRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `GetOauthGrabAPI.GetOauthGrab``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetOauthGrab`: GrabOauthResponse
fmt.Fprintf(os.Stdout, "Response from `GetOauthGrabAPI.GetOauthGrab`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiGetOauthGrabRequest 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. | |
grabOauthRequest | GrabOauthRequest |
No authorization required
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]