例の採用企業を作成する
Indeed で例の採用企業を作成し、確認します。
始める前に
- 1.Indeed パートナーになる。Indeed PLUS の場合のみ、Indeed から
employerIdTypeを受け取ります。 - 2.2-legged アクセストークンを取得する。
Indeed PLUS APIを呼び出すと、5,000ミリ秒後にタイムアウトとなります。
APIの手順
1. 採用企業を作成する
employerIdType を指定して patchEmployer ミューテーションを呼び出します。この ID は、Indeed PLUS の場合のみ Indeed から提供されます。
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> をご自身の 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 ヘッダー (新しいウィンドウで開きます)をご覧ください。 |
--data パラメータは GraphQL クエリを指定します。<employerIdType> をご自身の ID に置き換えてください。
Insomnia (新しいウィンドウで開きます) で GraphQL リクエストを送信するには、curl コマンドをインポートします。Insomnia のドキュメントの Import Data (新しいウィンドウで開きます) をご覧ください。
成功したレスポンスでは、PatchEmployerPayload オブジェクトが返されます。
{ "data": { "patchEmployer": { "attributeUpdated": true } }}2. 採用企業をさらに作成する
id.id を変更します(たとえば、1 から 2 に変更します)。
3. 採用企業を更新する
任意の属性を変更します(たとえば、headquarterAddress)。
関連項目
ガイド
- 例の求人を作成する — Indeed で例の求人を作成し、確認します。
- GraphQL エラーをトラブルシューティングする — API からの GraphQL エラーを診断します。
GraphQL APIリファレンス
patchEmployer— 採用企業を作成または更新します。