雇用主の作成例
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にインポートできます。Insomniaへのデザインドキュメントとして API仕様をインポートするをご覧ください。
リクエストが成功すると、PatchEmployerPayloadオブジ ェクトが返されます。
{ "data": { "patchEmployer": { "attributeUpdated": true } }}次のステップ
-
レスポンスで返されたGraphQLエラーをトラブルシューティングする。
-
たとえば
headquarterAddressを変更して、雇用主を更新します。 -
雇用主をさらに作成するには、
id.idを変更します。たとえば、1を2に更新します。 -
求人の作成例をご覧ください。