在 google Talent Solutions api - symfony 4 上出现 400 错误请求错误
Getting 400 bad request error on google Talent Solutions api - symfony 4
在实施 google 人才解决方案 API 时,出现此错误,
{
"error": {
"code": 400,
"message": "Creation request should not have name set.. Request ID for tracking: 07547685-f322-4e9a-b650-0505e3801a8a:APAb7ISK9V8RN0bV6KYUm3BBwoEpL9WDIg==",
"errors": [
{
"message": "Creation request should not have name set.. Request ID for tracking: 07547685-f322-4e9a-b650-0505e3801a8a:APAb7ISK9V8RN0bV6KYUm3BBwoEpL9WDIg==",
"domain": "global",
"reason": "badRequest"
}
],
"status": "INVALID_ARGUMENT"
}
}
我按照以下步骤进行实施:
- google-api-php-client 客户端库
Symfony 代码:
$client = new \Google_Client();
$client->setAuthConfig("/pathformyclient file/client.json");
$client->addScope(\Google_Service_CloudTalentSolution::JOBS);
$client->setHttpClient(new \GuzzleHttp\Client(['verify' => false]));
$cloudTalentSolutionClient = new \Google_Service_CloudTalentSolution($client);
$projectId = "my project ID";
$parent = sprintf('projects/%s', $projectId);
$company = new \Google_Service_CloudTalentSolution_Company();
$company->setName("company name");
$company->setDisplayName("company name");
$company->setExternalId("1");
$ci = new \Google_Service_CloudTalentSolution_CreateCompanyRequest();
$ci->setCompany($company);
$com = $cloudTalentSolutionClient->projects_companies->create($projectId,ci,array('parent' => $parent));
dump($com);die
请问您能在我遗漏的地方提供帮助或指导我解决此问题。
400 表示您发送了一个错误的请求 - duff 数据!
在你的情况下,幸运的是,他们准确地告诉你你做错了什么 - Creation request should not have name set..
!
所以,不要设置名称,希望下一个请求不会是 HTTP 400!
https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400
在实施 google 人才解决方案 API 时,出现此错误,
{
"error": {
"code": 400,
"message": "Creation request should not have name set.. Request ID for tracking: 07547685-f322-4e9a-b650-0505e3801a8a:APAb7ISK9V8RN0bV6KYUm3BBwoEpL9WDIg==",
"errors": [
{
"message": "Creation request should not have name set.. Request ID for tracking: 07547685-f322-4e9a-b650-0505e3801a8a:APAb7ISK9V8RN0bV6KYUm3BBwoEpL9WDIg==",
"domain": "global",
"reason": "badRequest"
}
],
"status": "INVALID_ARGUMENT"
}
}
我按照以下步骤进行实施:
- google-api-php-client 客户端库
Symfony 代码:
$client = new \Google_Client(); $client->setAuthConfig("/pathformyclient file/client.json"); $client->addScope(\Google_Service_CloudTalentSolution::JOBS); $client->setHttpClient(new \GuzzleHttp\Client(['verify' => false])); $cloudTalentSolutionClient = new \Google_Service_CloudTalentSolution($client); $projectId = "my project ID"; $parent = sprintf('projects/%s', $projectId); $company = new \Google_Service_CloudTalentSolution_Company(); $company->setName("company name"); $company->setDisplayName("company name"); $company->setExternalId("1"); $ci = new \Google_Service_CloudTalentSolution_CreateCompanyRequest(); $ci->setCompany($company); $com = $cloudTalentSolutionClient->projects_companies->create($projectId,ci,array('parent' => $parent)); dump($com);die
请问您能在我遗漏的地方提供帮助或指导我解决此问题。
400 表示您发送了一个错误的请求 - duff 数据!
在你的情况下,幸运的是,他们准确地告诉你你做错了什么 - Creation request should not have name set..
!
所以,不要设置名称,希望下一个请求不会是 HTTP 400!
https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400