google-api-nodejs-client icon indicating copy to clipboard operation
google-api-nodejs-client copied to clipboard

Add Google Talent Solution (Jobs) Samples for node.js

Open nwkeeley opened this issue 8 years ago • 4 comments

Hi,

Could we add some sample's for Google Talent solution for jobs? There is one request for listing companies which is great, but I am really banging my head on trying to figure out how to POST data.

V2 looked liked service.companies.create({ resource: _data }, (error, result) => {

V3 I cannot figure out ... reading here https://github.com/google/google-api-nodejs-client#specifying-request-body it sounds like it should look like something like ?

const data = {
  parent: `projects/${process.env.GOOGLE_CLOUD_PROJECT}`,
  requestBody: {
    externalId: 'c123',
    displayName: 'CompanyName'
  }
};
service.projects.companies.create(data, (error, result) => {

nwkeeley avatar Aug 24 '18 16:08 nwkeeley

The below request object worked after some trial and error, agree some further NodeJS examples would be useful

const data = { 
  requestBody : {
    company: {
      "displayName": employer.name,
      "externalId": employer.id}
    },
    parent: `projects/${projectId}`
}

mm188200 avatar Sep 07 '18 03:09 mm188200

this is what worked for me, parent needs to be same level as requestBody

    const request = {
      parent: `projects/${projectId}`,
      requestBody: {
        company: {
          'displayName': 'ABC Co',
          'externalId': '12348'
        }
      }
    }

rchan avatar Sep 17 '18 16:09 rchan

@JustinBeckwith I think this issue is a dup of https://github.com/googleapis/google-api-nodejs-client/issues/1296.

grant avatar Dec 12 '18 18:12 grant

👍

JustinBeckwith avatar Dec 12 '18 19:12 JustinBeckwith