例の採用企業を作成する
Indeed で例の採用企業を作成し、確認します。
始める前に
#- 1.Indeed パートナーになる。Indeed PLUS パートナーは、Indeed から
employerIdTypeも受け取ります。 - 2.アクセストークンを取得する。
Indeed PLUS APIを呼び出すと、5,000ミリ秒後にタイムアウトとなります。
APIの手順
#1. 採用企業を作成する
#ご自身の employerIdType を指定して、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> を Indeed から受け取った採用企業 ID タイプに置き換えてください。
この curl コマンドは、patchEmployer ミューテーションとヘッダーを https://apis.indeed.com/graphql に送信します。
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 | Bearer <token> | このヘッダーを使用してサーバーで認証し、保護されたリソースにアクセスします。このヘッダーで Bearer 認証スキームを使用してアクセストークンを渡します。oauth/v2/tokens エンドポイントでは、リクエストボディで client_id と client_secret を渡す代わりに、Basic 認証スキームを使用します。アクセストークンを取得する、Authorization header (新しいウィンドウで開きます)、およびBasic authentication schemeをご覧ください。 |
Content-Type | application/json | リソースのメディアタイプ (新しいウィンドウで開きます)です。Content-Type ヘッダー (新しいウィンドウで開きます)をご覧ください。 |
-d パラメータには GraphQL クエリが含まれます。<access_token> をご自身のアクセストークンに、<employerIdType> を Indeed から受け取った採用企業 ID タイプに置き換えてください。
Insomnia (新しいウィンドウで開きます) で GraphQL リクエストを送信するには、curl コマンドをインポートします。Insomnia のドキュメントの Import Data (新しいウィンドウで開きます) をご覧ください。
成功したレスポンスでは、PatchEmployerPayload オブジェクトが返されます。
{ "data": { "patchEmployer": { "attributeUpdated": true } }}2. 採用企業をさらに作成する
#別の採用企業を作成するには、id.id を変更して(たとえば、1 から 2 に変更して)、ミューテーションをもう一度呼び出します。
3. 採用企業を更新する
#同じ id.id を指定してミューテーションをもう一度呼び出し、headquarterAddress などの任意の属性を変更します。
関連項目
#ガイド
#- 例の求人を作成する — Indeed で例の求人を作成し、確認する方法を説明します。
- GraphQL エラーをトラブルシューティングする — API から返される GraphQL エラーを診断する方法を説明します。
GraphQL APIリファレンス
#patchEmployer— 採用企業を作成または更新します。