Hello. I was trying to send batch request to TagManager API and got 404 error. Here is my code:
var service = new TagManagerService(new BaseClientService.Initializer()
{
HttpClientInitializer = credential, ApplicationName = "..."
});
var batchRequest = new BatchRequest(service);
foreach (var variable in toAdd)
{
batchRequest.Queue<AccountsResource.ContainersResource.WorkspacesResource.VariablesResource.CreateRequest>(
service.Accounts.Containers.Workspaces.Variables.Create(variable, workspace.Path),
(content, error, index, message) =>
{
// ...
});
}
await batchRequest.ExecuteAsync(cancellationToken);
It fails with HttpRequestException:
System.Net.Http.HttpRequestException: Response status code does not indicate success: 404 (Not Found).
at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
at Google.Apis.Requests.BatchRequest.ExecuteAsync(CancellationToken cancellationToken)
I've seen this announcement - https://developers.googleblog.com/2018/03/discontinuing-support-for-json-rpc-and.html and i send homogenous request to specific api. But it still doesn't work.
Request goes to https://www.googleapis.com/batch/tagmanager/v2 and if i open it browser it also shows 404 page. I've checked discovery document - https://www.googleapis.com/discovery/v1/apis/tagmanager/v2/rest - and there is same batch url
"batchPath": "batch/tagmanager/v2"
However, if i initialize batch request with old global batch url value, e.g
var batchRequest = new BatchRequest(service, "https://www.googleapis.com/batch");
it works. But soon this url will be switched off, so this is not a solution.
I'm not sure this is a client library problem, but i hope someone can help me here =) Thx.
Let me take a look, I'll come back when I know more.
I can reproduce your issue exactly.
I believe this is not a problem with the client libraries because:
The problem almost certainly lies in the backend. I will raise this internally and update this issue when I know more. I will keep it open until then.
Thanks for reporting.
Thank you!
As an FYI, this is being fixed. It might take a few days before the fix is in and rolled out, but I'll update here when it's done. Again, thanks for reporting!
The fix has been rolled out. I've tested on my end and it's working. Can you confirm if it's working for you?
Yes, i've tested and now everything working. Thank you!