cURL
curl --request GET \
--url https://api.gmbapi.com/external-api/gmb/post/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.gmbapi.com/external-api/gmb/post/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.gmbapi.com/external-api/gmb/post/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gmbapi.com/external-api/gmb/post/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.gmbapi.com/external-api/gmb/post/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.gmbapi.com/external-api/gmb/post/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gmbapi.com/external-api/gmb/post/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"payload": {
"id": "<string>",
"post_id": "<string>",
"location_id": "<string>",
"account": "<string>",
"state": "SENDING",
"source": "app",
"create_time": 123,
"published_time": 123,
"update_time": 123,
"scheduled_time": 123,
"search_url": "<string>",
"last_error": {
"status": 123,
"reason": "<string>",
"message": "<string>",
"details": [
"<unknown>"
],
"at": 123
},
"params": {
"languageCode": "<string>",
"summary": "<string>",
"topicType": "STANDARD",
"callToAction": {
"actionType": "BOOK",
"url": "<string>"
},
"media": [
{
"mediaFormat": "PHOTO",
"sourceUrl": "<string>"
}
],
"event": {
"title": "<string>",
"schedule": {
"startDate": {
"year": 123,
"month": 123,
"day": 123
},
"startTime": {
"hours": 123,
"minutes": 123,
"seconds": 123
},
"endDate": {
"year": 123,
"month": 123,
"day": 123
},
"endTime": {
"hours": 123,
"minutes": 123,
"seconds": 123
}
}
},
"offer": {
"couponCode": "<string>",
"redeemOnlineUrl": "<string>",
"termsConditions": "<string>"
},
"scheduledTime": "2023-11-07T05:31:56Z",
"alertType": "ALERT_TYPE_UNSPECIFIED"
}
}
}{
"error": 123,
"message": "<string>"
}{
"error": 123,
"message": "<string>"
}Posts
Get Post
Returns a post. post_id is null while still SENDING. Poll after Create / Update / Delete until a terminal state.
GET
/
post
/
{id}
cURL
curl --request GET \
--url https://api.gmbapi.com/external-api/gmb/post/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.gmbapi.com/external-api/gmb/post/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.gmbapi.com/external-api/gmb/post/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gmbapi.com/external-api/gmb/post/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.gmbapi.com/external-api/gmb/post/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.gmbapi.com/external-api/gmb/post/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gmbapi.com/external-api/gmb/post/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"payload": {
"id": "<string>",
"post_id": "<string>",
"location_id": "<string>",
"account": "<string>",
"state": "SENDING",
"source": "app",
"create_time": 123,
"published_time": 123,
"update_time": 123,
"scheduled_time": 123,
"search_url": "<string>",
"last_error": {
"status": 123,
"reason": "<string>",
"message": "<string>",
"details": [
"<unknown>"
],
"at": 123
},
"params": {
"languageCode": "<string>",
"summary": "<string>",
"topicType": "STANDARD",
"callToAction": {
"actionType": "BOOK",
"url": "<string>"
},
"media": [
{
"mediaFormat": "PHOTO",
"sourceUrl": "<string>"
}
],
"event": {
"title": "<string>",
"schedule": {
"startDate": {
"year": 123,
"month": 123,
"day": 123
},
"startTime": {
"hours": 123,
"minutes": 123,
"seconds": 123
},
"endDate": {
"year": 123,
"month": 123,
"day": 123
},
"endTime": {
"hours": 123,
"minutes": 123,
"seconds": 123
}
}
},
"offer": {
"couponCode": "<string>",
"redeemOnlineUrl": "<string>",
"termsConditions": "<string>"
},
"scheduledTime": "2023-11-07T05:31:56Z",
"alertType": "ALERT_TYPE_UNSPECIFIED"
}
}
}{
"error": 123,
"message": "<string>"
}{
"error": 123,
"message": "<string>"
}Returns a post. Use the
Terminal states:
id from Create Post, not Google’s post_id. post_id is null while state is SENDING.
| State | Meaning |
|---|---|
SENDING | Not yet confirmed by Google |
SCHEDULED | Accepted with a future scheduledTime |
LIVE | Published |
PROCESSING | Google is still processing |
REJECTED | Google rejected the post |
ERROR | Failed. See last_error |
DELETED | Deleted |
LIVE, PROCESSING, REJECTED, ERROR, DELETED.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Post id returned by Create Post
Query Parameters
Account ID. Required when using an organization token; ignored for account-level tokens.