サンプル雇用主を作成する
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ヘッダーをご覧ください。 |
|
| リソースのメディアタイプ。 Content-Typeヘッダーをご覧ください。 |
--dataパラメーターはGraphQLクエリを指定します。<employerIdType>は自分のemployerIdTypeです。
Insomniaを使用してGraphQLリクエストを送信する場合は、curlコマンドをInsomniaにインポートできます。InsomniaでデザインドキュメントとしてAPI仕様をインポートするをご覧ください。
成功時のレスポンスは、PatchEmployerPayloadオブジェクトを返します。
{ "data": { "patchEmployer": { "attributeUpdated": true } }}次のステップ
-
レスポンスで返されたGraphQLエラーをトラブルシューティングする。
-
headquarterAddressなどを変更して雇用主を更新する。 -
別の雇用主を作成するには、
id.idを変更します。たとえば、1を2に変更します。