I can return the account information with no problems at all but whenever I try to retrieve the information for locations or reviews for a location. I get the error at the bottom of the page.
All code shown below. Code is blue and error is red.
string serviceAccountEmail = "[Removed for Security Reasons]";
string filePath = WebsiteConfiguration.AppDataFilePath + "key.p12";
var certificate = new X509Certificate2(filePath, "notasecret", X509KeyStorageFlags.Exportable);
ServiceAccountCredential credential = new ServiceAccountCredential(
new ServiceAccountCredential.Initializer(serviceAccountEmail)
{
Scopes = new[] { MybusinessServiceScope }
}.FromCertificate(certificate));
string error = "";
// Creates the service.
MyBusinessService service = new MyBusinessService(new BaseClientService.Initializer()
{
HttpClientInitializer = credential,
ApplicationName = "Client for mybusinessapi"
});
try
{
var accountsListRequest = service.Accounts.Locations.Reviews.List("accounts/117775730258471875388/locations/7279417290310182213");
ListReviewsResponse accountsResult = accountsListRequest.Execute();
}
catch(Exception ex)
{
error = ex.Message + ex.InnerException;
}
Google.Apis.Requests.RequestError
Requested entity was not found. [404]
Errors [
Message[Requested entity was not found.] Location[ - ] Reason[notFound] Domain[global]
]