Creating Alias Via Admin SDK API for secondary domain - alias

Running a POST with the following:
https://www.googleapis.com/admin/directory/v1/users/{{userid}}/aliases/
With the following as the body in JSON
{
"alias":"person#gsuite.company.com"
}
Im just getting the following error
{
"error": {
"code": 400,
"message": "Invalid Input: alias_email",
"errors": [
{
"message": "Invalid Input: alias_email",
"domain": "global",
"reason": "invalid"
}
]
}
}
I would love some help on this because its getting super frustratinu
Google Support Page
https://developers.google.com/admin-sdk/directory/v1/guides/manage-user-aliases

See comments above, but always give your secondary domains in Google Workplace an alias to the main domain and the domain alais will appear

Related

how can I manage custom errors coming from the server?

I use Jhipster with react as frontend with loopback as server side, I should show custom error ( ex. tax code already present in the archive).
this is format error
{
"error": {
"statusCode": 422,
"name": "UnprocessableEntityError",
"message": "The request body is invalid. See error object `details` property for more info.",
"code": "VALIDATION_FAILED",
"details": [
{
"path": "partitaIva",
"message": "Partita Iva giĆ  presente",
"code": "CUSTOM_ERROR",
"info": {}
}
]
}
}
There could be more errors too, like for a form.
I want to know how to display the error returned by server.

Google API Gmail error 500 Internal error encountered

I try send request https://gmail.googleapis.com/gmail/v1/users/me/messages/ using Postman, but I get:
{
"error": {
"code": 500,
"message": "Internal error encountered.",
"errors": [
{
"message": "Internal error encountered.",
"domain": "global",
"reason": "backendError"
}
],
"status": "INTERNAL"
}
}
Could somebody help me with this issue?
Please use this tool[1] to check your domain, most likely there are some critical problems detected within this domain. Mail-flow is probably affected.
Also check this documentation[2] on domain nameservers.
[1]https://toolbox.googleapps.com/apps/checkmx/
[2]https://support.google.com/a/answer/2573637#H

Not able to create Tag in Google Tag Manager using the Google Tag Manager API

I want to use the Google Tag Manager API to programmatically create Tags in a containers workspace from a JSON file.
In doing so I encountered the following error after sending of a create-Request:
{
"errors": {
"error": {
"errors": [
{
"domain": "global",
"reason": "invalidArgument",
"message": "Bad Request"
}
],
"code": 400,
"message": "Bad Request"
}
}
I then tried to create a minimal tag in the same workspace following this example: https://developers.google.com/tag-manager/api/v2/devguide with the same result.
Its the same for another newly created container and workspace with no other elements in it.
Does someone know a possible solution? Thanks in advance.

UDFs with the php api library

I am trying to add a UDF (I've tried both options of inline vs on cloud storage) and always get the same messsage:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "invalidQuery",
"message": "Unknown TVF: funcName",
"locationType": "other",
"location": "query"
}
],
"code": 400,
"message": "Unknown TVF: funcName"
}
}
I set the resource via.
$udf_resource = new Google_Service_Bigquery_UserDefinedFunctionResource();
$udf_resource->setResourceUri('gs://path/to/bucket/funcName.js');
or
$udf_resource = new Google_Service_Bigquery_UserDefinedFunctionResource();
$udf_resource->setInlineCode("FUNC_NAME_CODE");
both are being inserted into a job query config via.
$query_config->setUserDefinedFunctionResources($udf_resource);
The udf runs fine via. the Web UI.
Is there something I am missing?
passing array to setUserDefinedFunctionResources(), e.g.
$query_config->setUserDefinedFunctionResources([$udf_resource]);

How can I test the Google Translate API with cURL?

I'm attempting to use cURL to test the Google Translate API to see if it will suit my needs. But when I run this
$ curl https://www.googleapis.com/language/translate/v2?key=mykeyhere&source=en&target=de&q=Hello
I receive this in response:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "required",
"message": "Required parameter: q",
"locationType": "parameter",
"location": "q"
},
{
"domain": "global",
"reason": "required",
"message": "Required parameter: target",
"locationType": "parameter",
"location": "target"
}
],
"code": 400,
"message": "Required parameter: q"
}
}
Any ideas what I am doing wrong?
(Also, I understand StackOverflow may not be the best place for the question. I am happy to request that this question be moved to a different StackExchange site if someone will be kind enough to suggest an appropriate site for this question.)
I ended up using this NPM package to test, and once I enabled billing in the Google Developer Console, things worked: https://www.npmjs.org/package/google-translate