1.0.0 • Published 4 years ago

google-my-business-api-client v1.0.0

Weekly downloads
9
License
Creative Commons ...
Repository
-
Last release
4 years ago

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

For Node.js

npm

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

ClassMethodHTTP requestDescription
GoogleMyBusinessApi.AccountsApimybusinessAccountsCreatePOST /v4/accounts
GoogleMyBusinessApi.AccountsApimybusinessAccountsGenerateAccountNumberPOST /v4/accounts/{name}:generateAccountNumber
GoogleMyBusinessApi.AccountsApimybusinessAccountsInvitationsAcceptPOST /v4/accounts/{name}:accept
GoogleMyBusinessApi.AccountsApimybusinessAccountsInvitationsDeclinePOST /v4/accounts/{name}:decline
GoogleMyBusinessApi.AccountsApimybusinessAccountsInvitationsListGET /v4/accounts/{parent}/invitations
GoogleMyBusinessApi.AccountsApimybusinessAccountsListGET /v4/accounts
GoogleMyBusinessApi.AccountsApimybusinessAccountsListRecommendGoogleLocationsGET /v4/accounts/{name}:recommendGoogleLocations
GoogleMyBusinessApi.AccountsApimybusinessAccountsLocationsAdminsCreatePOST /v4/accounts/{parent}/admins
GoogleMyBusinessApi.AccountsApimybusinessAccountsLocationsAdminsListGET /v4/accounts/{parent}/admins
GoogleMyBusinessApi.AccountsApimybusinessAccountsLocationsAssociatePOST /v4/accounts/{name}:associate
GoogleMyBusinessApi.AccountsApimybusinessAccountsLocationsBatchGetPOST /v4/accounts/{name}/locations:batchGet
GoogleMyBusinessApi.AccountsApimybusinessAccountsLocationsBatchGetReviewsPOST /v4/accounts/{name}/locations:batchGetReviews
GoogleMyBusinessApi.AccountsApimybusinessAccountsLocationsClearAssociationPOST /v4/accounts/{name}:clearAssociation
GoogleMyBusinessApi.AccountsApimybusinessAccountsLocationsCreatePOST /v4/accounts/{parent}/locations
GoogleMyBusinessApi.AccountsApimybusinessAccountsLocationsFetchVerificationOptionsPOST /v4/accounts/{name}:fetchVerificationOptions
GoogleMyBusinessApi.AccountsApimybusinessAccountsLocationsFindMatchesPOST /v4/accounts/{name}:findMatches
GoogleMyBusinessApi.AccountsApimybusinessAccountsLocationsGetGoogleUpdatedGET /v4/accounts/{name}:googleUpdated
GoogleMyBusinessApi.AccountsApimybusinessAccountsLocationsListGET /v4/accounts/{parent}/locations
GoogleMyBusinessApi.AccountsApimybusinessAccountsLocationsLocalPostsCreatePOST /v4/accounts/{parent}/localPosts
GoogleMyBusinessApi.AccountsApimybusinessAccountsLocationsLocalPostsListGET /v4/accounts/{parent}/localPosts
GoogleMyBusinessApi.AccountsApimybusinessAccountsLocationsLocalPostsReportInsightsPOST /v4/accounts/{name}/localPosts:reportInsights
GoogleMyBusinessApi.AccountsApimybusinessAccountsLocationsMediaCreatePOST /v4/accounts/{parent}/media
GoogleMyBusinessApi.AccountsApimybusinessAccountsLocationsMediaCustomersListGET /v4/accounts/{parent}/media/customers
GoogleMyBusinessApi.AccountsApimybusinessAccountsLocationsMediaListGET /v4/accounts/{parent}/media
GoogleMyBusinessApi.AccountsApimybusinessAccountsLocationsMediaStartUploadPOST /v4/accounts/{parent}/media:startUpload
GoogleMyBusinessApi.AccountsApimybusinessAccountsLocationsQuestionsAnswersDeleteDELETE /v4/accounts/{parent}/answers:delete
GoogleMyBusinessApi.AccountsApimybusinessAccountsLocationsQuestionsAnswersListGET /v4/accounts/{parent}/answers
GoogleMyBusinessApi.AccountsApimybusinessAccountsLocationsQuestionsAnswersUpsertPOST /v4/accounts/{parent}/answers:upsert
GoogleMyBusinessApi.AccountsApimybusinessAccountsLocationsQuestionsCreatePOST /v4/accounts/{parent}/questions
GoogleMyBusinessApi.AccountsApimybusinessAccountsLocationsQuestionsDeleteDELETE /v4/accounts/{name}
GoogleMyBusinessApi.AccountsApimybusinessAccountsLocationsQuestionsListGET /v4/accounts/{parent}/questions
GoogleMyBusinessApi.AccountsApimybusinessAccountsLocationsQuestionsPatchPATCH /v4/accounts/{name}
GoogleMyBusinessApi.AccountsApimybusinessAccountsLocationsReportInsightsPOST /v4/accounts/{name}/locations:reportInsights
GoogleMyBusinessApi.AccountsApimybusinessAccountsLocationsReviewsDeleteReplyDELETE /v4/accounts/{name}/reply
GoogleMyBusinessApi.AccountsApimybusinessAccountsLocationsReviewsListGET /v4/accounts/{parent}/reviews
GoogleMyBusinessApi.AccountsApimybusinessAccountsLocationsReviewsUpdateReplyPUT /v4/accounts/{name}/reply
GoogleMyBusinessApi.AccountsApimybusinessAccountsLocationsTransferPOST /v4/accounts/{name}:transfer
GoogleMyBusinessApi.AccountsApimybusinessAccountsLocationsVerificationsCompletePOST /v4/accounts/{name}:complete
GoogleMyBusinessApi.AccountsApimybusinessAccountsLocationsVerificationsListGET /v4/accounts/{parent}/verifications
GoogleMyBusinessApi.AccountsApimybusinessAccountsLocationsVerifyPOST /v4/accounts/{name}:verify
GoogleMyBusinessApi.AccountsApimybusinessAccountsUpdateNotificationsPUT /v4/accounts/{name}
GoogleMyBusinessApi.AttributesApimybusinessAttributesListGET /v4/attributes
GoogleMyBusinessApi.CategoriesApimybusinessCategoriesBatchGetGET /v4/categories:batchGet
GoogleMyBusinessApi.CategoriesApimybusinessCategoriesListGET /v4/categories
GoogleMyBusinessApi.ChainsApimybusinessChainsGetGET /v4/accounts/{name}
GoogleMyBusinessApi.ChainsApimybusinessChainsSearchGET /v4/chains:search
GoogleMyBusinessApi.GoogleLocationsApimybusinessGoogleLocationsReportPOST /v4/accounts/{name}:report
GoogleMyBusinessApi.GoogleLocationsApimybusinessGoogleLocationsSearchPOST /v4/googleLocations:search

Documentation for Models

Documentation for Authorization

All endpoints do not require authorization.