TagManager v2 batch requests return 404
See original GitHub issueHello. 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.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top GitHub Comments
Yes, i’ve tested and now everything working. 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!