While calling google document api, getting below error. apis are enabled, even after waiting for few hours still getting same error. any suggestion
RpcException: Status(StatusCode="PermissionDenied", Detail="Cloud Document AI API has not been used in project xxxxxxx before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/documentai.googleapis.com/overview?project=xxxxxxx then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.", DebugException="Grpc.Core.Internal.CoreErrorDetailException: {"created":"@1646997388.673000000","description": "Error received from peer ipv4:234.234324.324234:443","file":"......\src\core\lib\surface\call.cc","file_line":1070,"grpc_message": "Cloud Document AI API has not been used in project xxxxxx before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/documentai.googleapis.com/overview?project=xxxx then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.","grpc_status":7}")
ByteString content = ByteString.CopyFrom(bytes);
DocumentProcessorServiceClient documentProcessorServiceClient = new DocumentProcessorServiceClientBuilder
{ CredentialsPath = "D:\\poised-aleph-3xx-6a3xxxx4343a03.json" }
.Build();
ProcessRequest request = new ProcessRequest
{
ProcessorName = ProcessorName.FromProjectLocationProcessor("invoiceprocessor", "us", "343431"),
SkipHumanReview = true,
RawDocument = new RawDocument
{
MimeType = "application/pdf",
Content = content
}
};
request.RawDocument.MimeType = "application/pdf";
request.RawDocument.Content = content;
// Make the request
ProcessResponse response = await
documentProcessorServiceClient.ProcessDocumentAsync(request);
after fixing correct project id, as shown in developer console -> Prediction endpoint
Detail="Permission 'documentai.processors.processOnline' denied on resource
'//documentai.googleapis.com/projects/8xxxxxxxx7/locations/us/processors/axxxxxxxxxx1f' (or it may not exist)."
Adding Document AI Role to service account