例の求人を作成する
Indeed で例の求人を作成し、確認します。
始める前に
- Indeed パートナーになる。Indeed PLUS のみ、Indeed から
employerIdTypeを受け取ります。 - アクセストークンを取得する。
Indeed PLUS APIを呼び出すと、5,000ミリ秒後にタイムアウトとなります。
API を呼び出す
GraphQL API を呼び出すには、ヘ ッダーと GraphQL クエリまたはミューテーションを指定して、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 SubmitJobPostingExample($employerIdType: String!) {\n jobsIngest {\n createSourcedJobPostings(\n input: {\n jobPostings: [\n {\n body: {\n title: \"Customer Support\"\n description: \"<h2 data-segment-type=\\\"header\\\" data-segment-label=\\\"JobDescription\\\">\\n Description\\n</h2>\\n<div data-segment-type=\\\"content\\\" data-segment-label=\\\"JobDescription\\\">\\n You will be responsible for supporting customers in this role.\\n</div>\\n<h2 data-segment-type=\\\"header\\\" data-segment-label=\\\"Pay\\\">\\n Pay\\n</h2>\\n<div data-segment-type=\\\"content\\\" data-segment-label=\\\"Pay\\\">\\n 2,000 yen per hour\\n</div>\\n<h2 data-segment-type=\\\"header\\\" data-segment-label=\\\"WorkHours\\\">\\n Working hours\\n</h2>\\n<div data-segment-type=\\\"content\\\" data-segment-label=\\\"WorkHours\\\">\\n 8 hours per day\\n At least 4 days per week\\n</div>\\n\"\n descriptionFormatting: RICH_FORMATTING\n benefits: []\n salary: {\n currency: \"JPY\"\n period: \"HOUR\"\n minimumMinor: 2000\n fineGrainedSalaryInformation: {\n totalSalaryMinor: 2000\n workingHours: 1\n fixedOvertimePay: false\n }\n }\n hasProbationaryPeriod: NO\n location: { country: \"JP\", streetAddress: \"108-0023 東京都港区芝浦3-1-21 田町ステーションタワーS18階\" }\n }\n metadata: {\n jobSource: {\n companyName: \"Example Company\"\n sourceName: \"Example Source Name\"\n sourceType: \"Employer\"\n employerIds: [{ type: $employerIdType, id: \"1\" }]\n }\n taxonomyClassification: { jobTypes: [\"75GKK\"], occupations: [\"N3YNG\"], attributes: [\"7ADHN\"] }\n jobPostingId: \"AtsJobPostingId1\"\n datePublished: \"2023-09-01T09:35:00+09:00\"\n url: \"https://example.com/jobs/aaabbbccc\"\n contacts: { contactType: \"contact\", contactInfo: { contactEmail: \"contact@career.example.com\" } }\n }\n }\n ]\n }\n ) {\n results {\n jobPosting {\n sourcedPostingId\n }\n }\n }\n }\n}","operationName":"SubmitJobPostingExample","variables":{"employerIdType": "<employerIdType>"}}'リクエストヘッダー:
| Header | 値 | 説明 |
|---|---|---|
|
| このヘッダーを使用してサーバーで認証し、保護されたリソースにアクセスします。 このヘッダーで
アクセストークンを取得する、Authorization header、およびBasic authentication schemeをご覧ください。 |
|
| リソースのメディアタイプです。 Content-Type ヘッダーをご覧ください。 |
-d パラメーターは GraphQL クエリを指定します。Indeed PLUS のみ、<employerIdType> に自分の employerIdType を指定します。
mutation SubmitJobPostingExample($employerIdType: String!) { jobsIngest { createSourcedJobPostings(input: { jobPostings: [{ body: { title: "Customer Support" description: "<h2 data-segment-type=\"header\" data-segment-label=\"JobDescription\">\n Description\n</h2>\n<div data-segment-type=\"content\" data-segment-label=\"JobDescription\">\n You will be responsible for supporting customers in this role.\n</div>\n<h2 data-segment-type=\"header\" data-segment-label=\"Pay\">\n Pay\n</h2>\n<div data-segment-type=\"content\" data-segment-label=\"Pay\">\n 2,000 yen per hour\n</div>\n<h2 data-segment-type=\"header\" data-segment-label=\"WorkHours\">\n Working hours\n</h2>\n<div data-segment-type=\"content\" data-segment-label=\"WorkHours\">\n 8 hours per day\n At least 4 days per week\n</div>\n" descriptionFormatting: RICH_FORMATTING benefits: [] salary: { currency: "JPY" period: "HOUR" minimumMinor: 2000 fineGrainedSalaryInformation: { totalSalaryMinor: 2000 workingHours: 1 fixedOvertimePay: false } } hasProbationaryPeriod: NO location: { country: "JP", streetAddress: "108-0023 東京都港区芝浦3-1-21 田町ステーションタワーS18階" } } metadata: { jobSource: { companyName: "Example Company" sourceName: "Example Source Name" sourceType: "Employer" employerIds: [{ type: $employerIdType, id: "1" }] } taxonomyClassification: { jobTypes: ["75GKK"] occupations: ["N3YNG"] attributes: ["7ADHN"] } jobPostingId: "AtsJobPostingId1" datePublished: "2023-09-01T09:35:00+09:00" url: "https://example.com/jobs/aaabbbccc" contacts: { contactType: "contact" contactInfo: { contactEmail: "contact@career.example.com" } } } }] }) { results { jobPosting { sourcedPostingId } } } }Insomnia を使用して GraphQL リクエストを送信する場合は、curl コマンドを Insomnia にインポートできます。Insomnia のドキュメントの Import Data をご覧ください。
成功レスポンスは次のとおりです。
{ "data": { "jobsIngest": { "createSourcedJobPostings": { "results": [{ "jobPosting": { "sourcedPostingId": "ea81aaa2-e834-43f7-8cd9-75778c14c2d5" } }] } } }}