Attempting to create Google My Business Local Post using My Business API and PHP.
A Local Post is created just fine EXCEPT when adding the mediaItem object to the post body.
Getting the error :
{
"error": {
"code": 400,
"message": "Request contains an invalid argument.",
"errors": [{
"message": "Request contains an invalid argument.",
"domain": "global",
"reason": "badRequest"
}],
"status": "INVALID_ARGUMENT"
}
}
Below is the post object with mediaItem that is being sent to localPosts->create
$new_post = new Google_Service_MyBusiness_LocalPost();
$new_post->setSummary('Hello World');
$new_post->setLanguageCode('en-US');
$media = new Google_Service_MyBusiness_MediaItem();
$media->setMediaFormat("PHOTO");
$media->setSourceUrl("https://www.webyhub.com/img/logo.png");
$new_post->setMedia($media);
You will need to do this on Postman to get the detail validation message as to why the image you used is invalid.
Try Advanced Rest Client (or Postman), make a POST request to https://mybusiness.googleapis.com/v4/accounts/{uuid}/locations/{uuid}/localPosts with
Header: Authorization: Bearer {access_token}.
Body Content Type: application/json
Body:
{
"summary":"test",
"topicType":"STANDARD",
"media":[{"mediaFormat": "PHOTO","sourceUrl": "https://example.com/files/test.jpg"}]
}
Also, Creating Post with video uploading is not currently available. I dont know why but I am also stuck on this matter.
Related
So this is my process flow for sending a new email.
I send draftId from front end Gmail to back-end server, and then from draftId, I get messageId.
When I try to later get info on that messageId, the Gmail API Service returns:
"error": {
"errors": [
{
"domain": "global",
"reason": "notFound",
"message": "Not Found"
}
],
"code": 404,
"message": "Not Found"
}
}
I was able to research and look into message history API to see that for some reason, that sent message is marked as deletedMessages.
However, the message shows as in my Sent emails so it is clearly not deleted.
This appears to have started showing up recently as well.
Does anyone have any idea why this happens?
I'm trying to create some slides with the Slides API but I started getting this error Invalid presentation.presentationId: The id is invalid.
I tried to create it through the API reference without success as shown in the image:
Reference request and error image
Is there any limitation on the presentationId or some other required fields I should pass?
This is the exception I get:
{
"error": {
"code": 400,
"message": "Invalid presentation.presentationId: The id is
invalid.",
"errors": [
{
"message": "Invalid presentation.presentationId: The id is invalid.",
"domain": "global",
"reason": "badRequest"
}
],
"status": "INVALID_ARGUMENT"
}
}
You want to create new Slide using Method: presentations.create. If my understanding is correct, how about this?
In your case, please try it using the request body with title and without presentationId as follows.
Note :
At this request body, a new Slide with the filename of "Teste123" is created to the root.
Reference :
Method: presentations.create
If I misunderstand your question, I'm sorry.
Dont specify a presentation ID -- just a title and the API call should work as you expect. The presentation ID will be generated by Slides for you.
Previously, Slides would ignore all presentation IDs passed in on create, but this behavior changed recently. See documentation for presentations.create
I want to send a message to a user from my server once they've finished successfully updating their payment details in a Facebook Messenger Webview, just before I close the webview window and return to the chat.
I'm sending a POST message, as defined, to https://graph.facebook.com/v2.6/me/messages?access_token=ABC In the format of:
{
"recipient": {
"id": 123456789
},
"message": {
"text": "hello, world!"
}
}
...where 123456789 is the valid Page Scoped User Id of the person I'm messaging (currently, that person is an admin of the app while we're in development).
The response I get is:
{
"error": {
"message": "(#100) No matching user found",
"type": "OAuthException",
"code": 100,
"error_subcode": 2018001,
"fbtrace_id": "CTdzskm/2rM"
}
}
Nothing I do seems to change this. I simply cannot get my application to send a message to the Facebook Messenger chat via cURL.
Make sure you are using the same page-scoped access token to send the new message that was used when you received the person's PSID.
I am trying to get Google Play API subscription details using PHP and using following url to get purchase data :
https://www.googleapis.com/androidpublisher/v1/applications/[PACKAGE]/subscriptions/[SKU]/purchases/[PURCHASE_TOKEN]?access_token=[ACCESS_TOKEN]
I am getting the following error:
{
"error": {
"errors": [
{
"domain": "androidpublisher",
"reason": "developerDoesNotOwnApplication",
"message": "This developer account does not own the application."
}
],
"code": 401,
"message": "This developer account does not own the application."
}
}
Please help me sort out.
Just providing the URL does not help you get data of any application. How can you think so.? Isnt it insecure.? You have to get proper data by which you can at least prove ownership for the app..
Since Youtube Api V2 doesn't support like a specific video anymore. Can anyone please explain how to like a video with youtube api v3 ?
I am always getting the following response:
Response
400 Bad Request
- Show headers -
{
"error": {
"errors": [
{
"domain": "youtube.part",
"reason": "unexpectedPart",
"message": "contentDetails",
"locationType": "parameter",
"location": "part"
}
],
"code": 400,
"message": "contentDetails"
}
}
The request is :
Request
POST https://www.googleapis.com/youtube/v3/activities?part=snippet&key={YOUR_API_KEY}
Content-Type: application/json
Authorization: Bearer ya29.AHES6ZQUI8Gn7j93QZBmmdlDe7Ei-iqYseYAKAxyf3qTOHHwDHb-dA
X-JavaScript-User-Agent: Google APIs Explorer
{
"contentDetails": {
"like": {
"resourceId": {
"videoId": "video-id",
"kind": "youtube#video"
}
}
}
}
The part is = snippet
I am following these docs : https://developers.google.com/youtube/v3/docs/activities/insert
The answer is already in the comments, but to elevate it a bit: YouTube API v3: Liking a video in Python has more information about liking a video, though the example there is in Python.
The important part is that liking a video is done via a playlistItems.insert() call, not an activities.insert() call. This is a common source of confusion and I've already asked our tech writer to try to clear things up in the docs.