雇用主の作成例
Indeedで雇用主の例を作成し、確認します。
始める前に
- Indeed パートナーになる。また、Indeed PLUS のみ、Indeed から
employerIdTypeを受け取ります。 - 2-legged アクセストークンを取得する
Indeed PLUS APIを呼び出すと、5,000ミリ秒後にタイムアウトとなります。
API を呼び出す
patchEmployer ミューテーション:
mutation PatchEmployerExample($employerIdType: String!) { patchEmployer(input: { id: { type: $employerIdType, id: "1" } employerName: "Partner Test Company" employerAttributes: { employerType: JURIDICAL_PERSON countrySpecificAttributes: { country: "JP", taxId: "1234567890123" } localeSpecificAttributes: { country: "JP" language: "ja" isGlobalDefault: true description: "Describe your employer organization" headquarterAddress: "東京都千代田区丸の内1-9-2" leader: { name: "Sample CEO name" } } } }) { attributeUpdated }}このコードスニペットには、次のパラメータが含まれています。
{ "employerIdType": "<employerIdType>"}<employerIdType> をご自身の employerIdType に置き換えてください。
この curl コマンドは、ヘッダーと patchEmployer ミューテーションを指定して、https://apis.indeed.com/graphql に POST リクエストを送信します。
curl -X POST \ -L 'https://apis.indeed.com/graphql' \ -H 'Authorization: Bearer <access_token>' \ -H 'Content-Type: application/json' \ -d '{"query":"mutation PatchEmployerExample($employerIdType: String!) {\n\tpatchEmployer(\n\t\tinput: {\n\t\t\tid: { type: $employerIdType, id: \"1\" }\n\t\t\temployerName: \"Partner Test Company\"\n\t\t\temployerAttributes: {\n\t\t\t\temployerType: JURIDICAL_PERSON\n\t\t\t\tcountrySpecificAttributes: { country: \"JP\", taxId: \"1234567890123\" }\n\t\t\t\tlocaleSpecificAttributes: {\n\t\t\t\t\tcountry: \"JP\"\n\t\t\t\t\tlanguage: \"ja\"\n\t\t\t\t\tisGlobalDefault: true\n\t\t\t\t\tdescription: \"Describe your employer organization\"\n\t\t\t\t\theadquarterAddress: \"東京都千代田区丸の内1-9-2\"\n\t\t\t\t\tleader: { name: \"Sample CEO name\" }\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t) {\n\t\tattributeUpdated\n\t}\n}\n","operationName":"PatchEmployerExample","variables":{"employerIdType": "<employerIdType>"}}'リクエストヘッダー:
| ヘッダー | 値 | 説明 |
|---|---|---|
|
| このヘッダーを使用してサーバーで認証し、保護されたリソースにアクセスします。 このヘッダーで
アクセストークンを取得する、Authorization header、およびBasic authentication schemeをご覧ください。 |
|
| リソースのメディアタイプです。 Content-Type ヘッダーをご覧ください。 |
--data パラメータは GraphQL クエリを指定します。ここで、<employerIdType> はご自身の employerIdType です。
GraphQL リクエストの送信に Insomnia を使用する場合は、curl コマンドを Insomnia にインポートできます。Import an API specification as a design document in Insomnia をご覧ください。
成功したレスポンスでは、PatchEmployerPayload オブジェクトが返されます。
{ "data": { "patchEmployer": { "attributeUpdated": true } }}次のステップ
-
レスポンスで受け取った GraphQL エラーをトラブルシューティングする。
-
たとえば、
headquarterAddressを変更して雇用主を更新します。 -
さらに雇用主を作成するには、
id.idを変更します。たとえば、1を2に更新します。 -
求人の作成例をご覧ください。