google_my_business_api
GoogleMyBusinessApi - JavaScript client for google_my_business_api The Google My Business API provides an interface for managing business location information on Google. This SDK is automatically generated by the Swagger Codegen project:
- API version: 1.0.0
- Package version: 1.0.0
- Build package: io.swagger.codegen.languages.JavascriptClientCodegen For more information, please visit https://google.com
Installation
Node.js
Fornpm
To publish the library as a npm, please follow the procedure in "Publishing npm packages".
Then install it via:
npm install google_my_business_api --save
Local development
To use the library locally without publishing to a remote npm registry, first install the dependencies by changing
into the directory containing package.json
(and this README). Let's call this JAVASCRIPT_CLIENT_DIR
. Then run:
npm install
Next, link it globally in npm with the following, also from JAVASCRIPT_CLIENT_DIR
:
npm link
Finally, switch to the directory you want to use your google_my_business_api from, and run:
npm link /path/to/<JAVASCRIPT_CLIENT_DIR>
You should now be able to require('google_my_business_api')
in javascript files from the directory you ran the last
command above from.
git
If the library is hosted at a git repository, e.g. https://github.com/YOUR_USERNAME/google_my_business_api then install it via:
npm install YOUR_USERNAME/google_my_business_api --save
For browser
The library also works in the browser environment via npm and browserify. After following
the above steps with Node.js and installing browserify with npm install -g browserify
,
perform the following (assuming main.js is your entry file, that's to say your javascript file where you actually
use this library):
browserify main.js > bundle.js
Then include bundle.js in the HTML pages.
Webpack Configuration
Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:
module: {
rules: [
{
parser: {
amd: false
}
}
]
}
Getting Started
Please follow the installation instruction and execute the following JS code:
var GoogleMyBusinessApi = require('google_my_business_api');
var api = new GoogleMyBusinessApi.AccountsApi()
var opts = {
'accessToken': "accessToken_example", // {String} OAuth access token.
'alt': "json", // {String} Data format for response.
'callback': "callback_example", // {String} JSONP
'fields': "fields_example", // {String} Selector specifying which fields to include in a partial response.
'key': "key_example", // {String} API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
'oauthToken': "oauthToken_example", // {String} OAuth 2.0 token for the current user.
'prettyPrint': true, // {Boolean} Returns response with indentations and line breaks.
'quotaUser': "quotaUser_example", // {String} Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
'uploadProtocol': "uploadProtocol_example", // {String} Upload protocol for media (e.g. \"raw\", \"multipart\").
'uploadType': "uploadType_example", // {String} Legacy upload protocol for media (e.g. \"media\", \"multipart\").
'body': new GoogleMyBusinessApi.Account(), // {Account}
'primaryOwner': "primaryOwner_example" // {String} The resource name of the account which will be the primary owner of the account being created. It should be of the form `accounts/{account_id}/`.
};
api.mybusinessAccountsCreate(opts).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Documentation for API Endpoints
All URIs are relative to https://mybusiness.googleapis.com
Class | Method | HTTP request | Description |
---|---|---|---|
GoogleMyBusinessApi.AccountsApi | mybusinessAccountsCreate | POST /v4/accounts | |
GoogleMyBusinessApi.AccountsApi | mybusinessAccountsGenerateAccountNumber | POST /v4/accounts/{name}:generateAccountNumber | |
GoogleMyBusinessApi.AccountsApi | mybusinessAccountsInvitationsAccept | POST /v4/accounts/{name}:accept | |
GoogleMyBusinessApi.AccountsApi | mybusinessAccountsInvitationsDecline | POST /v4/accounts/{name}:decline | |
GoogleMyBusinessApi.AccountsApi | mybusinessAccountsInvitationsList | GET /v4/accounts/{parent}/invitations | |
GoogleMyBusinessApi.AccountsApi | mybusinessAccountsList | GET /v4/accounts | |
GoogleMyBusinessApi.AccountsApi | mybusinessAccountsListRecommendGoogleLocations | GET /v4/accounts/{name}:recommendGoogleLocations | |
GoogleMyBusinessApi.AccountsApi | mybusinessAccountsLocationsAdminsCreate | POST /v4/accounts/{parent}/admins | |
GoogleMyBusinessApi.AccountsApi | mybusinessAccountsLocationsAdminsList | GET /v4/accounts/{parent}/admins | |
GoogleMyBusinessApi.AccountsApi | mybusinessAccountsLocationsAssociate | POST /v4/accounts/{name}:associate | |
GoogleMyBusinessApi.AccountsApi | mybusinessAccountsLocationsBatchGet | POST /v4/accounts/{name}/locations:batchGet | |
GoogleMyBusinessApi.AccountsApi | mybusinessAccountsLocationsBatchGetReviews | POST /v4/accounts/{name}/locations:batchGetReviews | |
GoogleMyBusinessApi.AccountsApi | mybusinessAccountsLocationsClearAssociation | POST /v4/accounts/{name}:clearAssociation | |
GoogleMyBusinessApi.AccountsApi | mybusinessAccountsLocationsCreate | POST /v4/accounts/{parent}/locations | |
GoogleMyBusinessApi.AccountsApi | mybusinessAccountsLocationsFetchVerificationOptions | POST /v4/accounts/{name}:fetchVerificationOptions | |
GoogleMyBusinessApi.AccountsApi | mybusinessAccountsLocationsFindMatches | POST /v4/accounts/{name}:findMatches | |
GoogleMyBusinessApi.AccountsApi | mybusinessAccountsLocationsGetGoogleUpdated | GET /v4/accounts/{name}:googleUpdated | |
GoogleMyBusinessApi.AccountsApi | mybusinessAccountsLocationsList | GET /v4/accounts/{parent}/locations | |
GoogleMyBusinessApi.AccountsApi | mybusinessAccountsLocationsLocalPostsCreate | POST /v4/accounts/{parent}/localPosts | |
GoogleMyBusinessApi.AccountsApi | mybusinessAccountsLocationsLocalPostsList | GET /v4/accounts/{parent}/localPosts | |
GoogleMyBusinessApi.AccountsApi | mybusinessAccountsLocationsLocalPostsReportInsights | POST /v4/accounts/{name}/localPosts:reportInsights | |
GoogleMyBusinessApi.AccountsApi | mybusinessAccountsLocationsMediaCreate | POST /v4/accounts/{parent}/media | |
GoogleMyBusinessApi.AccountsApi | mybusinessAccountsLocationsMediaCustomersList | GET /v4/accounts/{parent}/media/customers | |
GoogleMyBusinessApi.AccountsApi | mybusinessAccountsLocationsMediaList | GET /v4/accounts/{parent}/media | |
GoogleMyBusinessApi.AccountsApi | mybusinessAccountsLocationsMediaStartUpload | POST /v4/accounts/{parent}/media:startUpload | |
GoogleMyBusinessApi.AccountsApi | mybusinessAccountsLocationsQuestionsAnswersDelete | DELETE /v4/accounts/{parent}/answers:delete | |
GoogleMyBusinessApi.AccountsApi | mybusinessAccountsLocationsQuestionsAnswersList | GET /v4/accounts/{parent}/answers | |
GoogleMyBusinessApi.AccountsApi | mybusinessAccountsLocationsQuestionsAnswersUpsert | POST /v4/accounts/{parent}/answers:upsert | |
GoogleMyBusinessApi.AccountsApi | mybusinessAccountsLocationsQuestionsCreate | POST /v4/accounts/{parent}/questions | |
GoogleMyBusinessApi.AccountsApi | mybusinessAccountsLocationsQuestionsDelete | DELETE /v4/accounts/{name} | |
GoogleMyBusinessApi.AccountsApi | mybusinessAccountsLocationsQuestionsList | GET /v4/accounts/{parent}/questions | |
GoogleMyBusinessApi.AccountsApi | mybusinessAccountsLocationsQuestionsPatch | PATCH /v4/accounts/{name} | |
GoogleMyBusinessApi.AccountsApi | mybusinessAccountsLocationsReportInsights | POST /v4/accounts/{name}/locations:reportInsights | |
GoogleMyBusinessApi.AccountsApi | mybusinessAccountsLocationsReviewsDeleteReply | DELETE /v4/accounts/{name}/reply | |
GoogleMyBusinessApi.AccountsApi | mybusinessAccountsLocationsReviewsList | GET /v4/accounts/{parent}/reviews | |
GoogleMyBusinessApi.AccountsApi | mybusinessAccountsLocationsReviewsUpdateReply | PUT /v4/accounts/{name}/reply | |
GoogleMyBusinessApi.AccountsApi | mybusinessAccountsLocationsTransfer | POST /v4/accounts/{name}:transfer | |
GoogleMyBusinessApi.AccountsApi | mybusinessAccountsLocationsVerificationsComplete | POST /v4/accounts/{name}:complete | |
GoogleMyBusinessApi.AccountsApi | mybusinessAccountsLocationsVerificationsList | GET /v4/accounts/{parent}/verifications | |
GoogleMyBusinessApi.AccountsApi | mybusinessAccountsLocationsVerify | POST /v4/accounts/{name}:verify | |
GoogleMyBusinessApi.AccountsApi | mybusinessAccountsUpdateNotifications | PUT /v4/accounts/{name} | |
GoogleMyBusinessApi.AttributesApi | mybusinessAttributesList | GET /v4/attributes | |
GoogleMyBusinessApi.CategoriesApi | mybusinessCategoriesBatchGet | GET /v4/categories:batchGet | |
GoogleMyBusinessApi.CategoriesApi | mybusinessCategoriesList | GET /v4/categories | |
GoogleMyBusinessApi.ChainsApi | mybusinessChainsGet | GET /v4/accounts/{name} | |
GoogleMyBusinessApi.ChainsApi | mybusinessChainsSearch | GET /v4/chains:search | |
GoogleMyBusinessApi.GoogleLocationsApi | mybusinessGoogleLocationsReport | POST /v4/accounts/{name}:report | |
GoogleMyBusinessApi.GoogleLocationsApi | mybusinessGoogleLocationsSearch | POST /v4/googleLocations:search |
Documentation for Models
- GoogleMyBusinessApi.AcceptInvitationRequest
- GoogleMyBusinessApi.Account
- GoogleMyBusinessApi.AccountState
- GoogleMyBusinessApi.AdWordsLocationExtensions
- GoogleMyBusinessApi.AddressInput
- GoogleMyBusinessApi.AddressVerificationData
- GoogleMyBusinessApi.Admin
- GoogleMyBusinessApi.Answer
- GoogleMyBusinessApi.AssociateLocationRequest
- GoogleMyBusinessApi.Attribute
- GoogleMyBusinessApi.AttributeMetadata
- GoogleMyBusinessApi.AttributeValueMetadata
- GoogleMyBusinessApi.Attribution
- GoogleMyBusinessApi.Author
- GoogleMyBusinessApi.BasicMetricsRequest
- GoogleMyBusinessApi.BatchGetBusinessCategoriesResponse
- GoogleMyBusinessApi.BatchGetLocationsRequest
- GoogleMyBusinessApi.BatchGetLocationsResponse
- GoogleMyBusinessApi.BatchGetReviewsRequest
- GoogleMyBusinessApi.BatchGetReviewsResponse
- GoogleMyBusinessApi.BusinessHours
- GoogleMyBusinessApi.CallToAction
- GoogleMyBusinessApi.CaloriesFact
- GoogleMyBusinessApi.Category
- GoogleMyBusinessApi.Chain
- GoogleMyBusinessApi.ChainName
- GoogleMyBusinessApi.ChainUrl
- GoogleMyBusinessApi.ClearLocationAssociationRequest
- GoogleMyBusinessApi.CompleteVerificationRequest
- GoogleMyBusinessApi.CompleteVerificationResponse
- GoogleMyBusinessApi.DeclineInvitationRequest
- GoogleMyBusinessApi.DimensionalMetricValue
- GoogleMyBusinessApi.Dimensions
- GoogleMyBusinessApi.DrivingDirectionMetricsRequest
- GoogleMyBusinessApi.Duplicate
- GoogleMyBusinessApi.EmailInput
- GoogleMyBusinessApi.EmailVerificationData
- GoogleMyBusinessApi.Empty
- GoogleMyBusinessApi.FetchVerificationOptionsRequest
- GoogleMyBusinessApi.FetchVerificationOptionsResponse
- GoogleMyBusinessApi.FindMatchingLocationsRequest
- GoogleMyBusinessApi.FindMatchingLocationsResponse
- GoogleMyBusinessApi.FollowersMetadata
- GoogleMyBusinessApi.FoodMenu
- GoogleMyBusinessApi.FoodMenuItem
- GoogleMyBusinessApi.FoodMenuItemAttributes
- GoogleMyBusinessApi.FoodMenuItemOption
- GoogleMyBusinessApi.FoodMenuSection
- GoogleMyBusinessApi.FoodMenus
- GoogleMyBusinessApi.FreeFormServiceItem
- GoogleMyBusinessApi.GenerateAccountNumberRequest
- GoogleMyBusinessApi.GoogleLocation
- GoogleMyBusinessApi.GoogleUpdatedLocation
- GoogleMyBusinessApi.Ingredient
- GoogleMyBusinessApi.Invitation
- GoogleMyBusinessApi.Item
- GoogleMyBusinessApi.Label
- GoogleMyBusinessApi.LatLng
- GoogleMyBusinessApi.ListAccountAdminsResponse
- GoogleMyBusinessApi.ListAccountsResponse
- GoogleMyBusinessApi.ListAnswersResponse
- GoogleMyBusinessApi.ListAttributeMetadataResponse
- GoogleMyBusinessApi.ListBusinessCategoriesResponse
- GoogleMyBusinessApi.ListCustomerMediaItemsResponse
- GoogleMyBusinessApi.ListInvitationsResponse
- GoogleMyBusinessApi.ListLocalPostsResponse
- GoogleMyBusinessApi.ListLocationAdminsResponse
- GoogleMyBusinessApi.ListLocationsResponse
- GoogleMyBusinessApi.ListMediaItemsResponse
- GoogleMyBusinessApi.ListQuestionsResponse
- GoogleMyBusinessApi.ListRecommendedGoogleLocationsResponse
- GoogleMyBusinessApi.ListReviewsResponse
- GoogleMyBusinessApi.ListVerificationsResponse
- GoogleMyBusinessApi.LocalPost
- GoogleMyBusinessApi.LocalPostEvent
- GoogleMyBusinessApi.LocalPostMetrics
- GoogleMyBusinessApi.LocalPostOffer
- GoogleMyBusinessApi.Location
- GoogleMyBusinessApi.LocationAssociation
- GoogleMyBusinessApi.LocationDrivingDirectionMetrics
- GoogleMyBusinessApi.LocationKey
- GoogleMyBusinessApi.LocationMetrics
- GoogleMyBusinessApi.LocationReview
- GoogleMyBusinessApi.LocationState
- GoogleMyBusinessApi.MatchedLocation
- GoogleMyBusinessApi.MediaInsights
- GoogleMyBusinessApi.MediaItem
- GoogleMyBusinessApi.MediaItemDataRef
- GoogleMyBusinessApi.MenuLabel
- GoogleMyBusinessApi.Metadata
- GoogleMyBusinessApi.MetricRequest
- GoogleMyBusinessApi.MetricValue
- GoogleMyBusinessApi.ModelDate
- GoogleMyBusinessApi.Money
- GoogleMyBusinessApi.Notifications
- GoogleMyBusinessApi.NutritionFact
- GoogleMyBusinessApi.NutritionFacts
- GoogleMyBusinessApi.OpenInfo
- GoogleMyBusinessApi.OrganizationInfo
- GoogleMyBusinessApi.PhoneInput
- GoogleMyBusinessApi.PhoneVerificationData
- GoogleMyBusinessApi.PlaceInfo
- GoogleMyBusinessApi.Places
- GoogleMyBusinessApi.PointRadius
- GoogleMyBusinessApi.PortionSize
- GoogleMyBusinessApi.PostalAddress
- GoogleMyBusinessApi.PriceList
- GoogleMyBusinessApi.Profile
- GoogleMyBusinessApi.Question
- GoogleMyBusinessApi.RegionCount
- GoogleMyBusinessApi.RelationshipData
- GoogleMyBusinessApi.RepeatedEnumAttributeValue
- GoogleMyBusinessApi.ReportGoogleLocationRequest
- GoogleMyBusinessApi.ReportLocalPostInsightsRequest
- GoogleMyBusinessApi.ReportLocalPostInsightsResponse
- GoogleMyBusinessApi.ReportLocationInsightsRequest
- GoogleMyBusinessApi.ReportLocationInsightsResponse
- GoogleMyBusinessApi.Review
- GoogleMyBusinessApi.ReviewReply
- GoogleMyBusinessApi.Reviewer
- GoogleMyBusinessApi.SearchChainsResponse
- GoogleMyBusinessApi.SearchGoogleLocationsRequest
- GoogleMyBusinessApi.SearchGoogleLocationsResponse
- GoogleMyBusinessApi.Section
- GoogleMyBusinessApi.ServiceAreaBusiness
- GoogleMyBusinessApi.ServiceBusinessContext
- GoogleMyBusinessApi.ServiceItem
- GoogleMyBusinessApi.ServiceList
- GoogleMyBusinessApi.ServiceType
- GoogleMyBusinessApi.SpecialHourPeriod
- GoogleMyBusinessApi.SpecialHours
- GoogleMyBusinessApi.StartUploadMediaItemDataRequest
- GoogleMyBusinessApi.StructuredServiceItem
- GoogleMyBusinessApi.TargetLocation
- GoogleMyBusinessApi.TimeDimension
- GoogleMyBusinessApi.TimeInterval
- GoogleMyBusinessApi.TimeOfDay
- GoogleMyBusinessApi.TimePeriod
- GoogleMyBusinessApi.TimeRange
- GoogleMyBusinessApi.TopDirectionSources
- GoogleMyBusinessApi.TransferLocationRequest
- GoogleMyBusinessApi.UpsertAnswerRequest
- GoogleMyBusinessApi.UrlAttributeValue
- GoogleMyBusinessApi.Verification
- GoogleMyBusinessApi.VerificationOption
- GoogleMyBusinessApi.VerifyLocationRequest
- GoogleMyBusinessApi.VerifyLocationResponse
Documentation for Authorization
All endpoints do not require authorization.