{"_id":"@activeprospect/node-marketo","_rev":"86-9d406433602eaaa6ee1102452b541296","name":"@activeprospect/node-marketo","dist-tags":{"latest":"0.7.10"},"versions":{"0.2.5":{"name":"@activeprospect/node-marketo","version":"0.2.5","_id":"@activeprospect/node-marketo@0.2.5","maintainers":[{"name":"aaronrenner","email":"aaron.renner@gmail.com"},{"name":"jgrayson03","email":"jonathan@activeprospect.com"},{"name":"apadmin","email":"dev@activeprospect.com"},{"name":"benkhicks","email":"benkhicks@gmail.com"},{"name":"alexkwolfe","email":"alexkwolfe@gmail.com"},{"name":"zalary","email":"zalary@activeprospect.com"},{"name":"kellym","email":"kellymartinv@gmail.com"},{"name":"chasingsublimity","email":"blake.sager@activeprospect.com"},{"name":"cgrayson","email":"cgrayson@airpost.net"},{"name":"steveodom","email":"steve.odom@gmail.com"},{"name":"mikebetts","email":"mike.betts@activeprospect.com"},{"name":"justinwinslow","email":"justin@jwin.me"}],"homepage":"https://github.com/usermindinc/node-marketo#readme","bugs":{"url":"https://github.com/usermindinc/node-marketo/issues"},"dist":{"shasum":"a96ada35b61d3c95edbd534011c036ec1f2a8bec","tarball":"https://registry.npmjs.org/@activeprospect/node-marketo/-/node-marketo-0.2.5.tgz","fileCount":34,"integrity":"sha512-DKvccM0AnLrDdK3ncqC2Dc7VxTYs+hJx0bV63TUOCnh1DljZBh9BepzcCWqpuCYvCpdmVuTubBVPxhN+Yq7amA==","signatures":[{"sig":"MEYCIQCrypI0W1xCw7S/M9bLC/SM01adA4pN6RMZhh259/T0tAIhAMDGheW4zsTyQfonptKWy0MXD+EAnZxSKVk+dpg2vk3S","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":51283,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcLT1VCRA9TVsSAnZWagAAb3sP/0YLIfswkCyl6HHqGPlo\nT/YGOLFos3FImmtDoj8FwjdephmIU3gL34kh6wzOT+Dl4UrMeBzBMzVnkGrL\nyTuGbNffz5BmfGLGAvApUPslCKxRWpJ/gJUl58ZIJww5fiznCrIXnbidYfR/\ndykZY9AYqBUnSXjeFltaAFKqW5EvmPiJesPXtc95MIYEAX0GFa3I+rWDbOwY\nOSU8sDxTVN2ldBBk1OffCd3/cnv3i/wLnjoAtGLllDbny5k/7YrzgiODASAj\nx7xXbtYx0FUlYmmsQO7oPQKD6wO94JR+aVcu+EX3xDdNhRkGg7bjFA0uJ1go\n/xPptmi6DPqBvgF3AkrS9tocct5A2QRw/3GNrPNgSyvpLU7V/xKHZuo5UUfH\nQlG2VCvNP0O2PKJerk6qMorvwN3Nh0m7rSUMtJd5nrBRD1gM2w4DNNrevq8g\nOBbLbcxkjcO6jBUra9UuwDSHONutX1pfMXB15la2A1mXsh7ZBIvZbYj/tz3L\nCRXulWVpMjV8NJbqi7NT7znGAKgseaPLugZ3JeJyy3tlNGl+tKF9sD/L1r3/\n8HO9y2GYBiyEauyqYUPkwKbS95y5AtAnU3QrcJ7iG+pGVSQxhspYw7ZRNOgK\n7AgUWGCj3uPrTKJKzAev3W0iGaBoKI7BLghFgcyq/4mcyLDSzmejoLZTFp+3\nnTtl\r\n=M7hf\r\n-----END PGP SIGNATURE-----\r\n"},"engines":{"node":">=0.10.29"},"gitHead":"0ea437d0736472355cd59b0f451b3d5b979e909a","scripts":{"test":"mocha test/*test.js --exit"},"_npmUser":{"name":"chasingsublimity","email":"blake.sager@activeprospect.com"},"repository":{"url":"git+https://github.com/usermindinc/node-marketo.git","type":"git"},"_npmVersion":"6.5.0","description":"marketo rest client","directories":{},"_nodeVersion":"8.9.4","dependencies":{"bunyan":"1.0.x","lodash":"^4.17.11","moment":"^2.23.0","backoff":"2.4.x","restler":"^3.4.0","bluebird":"2.3.x"},"_hasShrinkwrap":false,"devDependencies":{"mocha":"^5.2.0","replay":"1.11.x"},"_npmOperationalInternal":{"tmp":"tmp/node-marketo_0.2.5_1546468692830_0.6611180832055568","host":"s3://npm-registry-packages"}},"0.7.9":{"name":"@activeprospect/node-marketo","version":"0.7.9","_id":"@activeprospect/node-marketo@0.7.9","maintainers":[{"name":"philga","email":"maestro7@gmail.com"},{"name":"jgrayson03","email":"jonathan@activeprospect.com"},{"name":"apadmin","email":"dev@activeprospect.com"},{"name":"alexkwolfe","email":"alexkwolfe@gmail.com"},{"name":"kellym","email":"kellymartinv@gmail.com"},{"name":"chasingsublimity","email":"blakemsager@gmail.com"},{"name":"cgrayson","email":"cgrayson@airpost.net"},{"name":"steveodom","email":"steve.odom@gmail.com"},{"name":"mikebetts","email":"mike.betts@activeprospect.com"},{"name":"justinwinslow","email":"justin@jwin.me"},{"name":"sborrazas","email":"hi@sborrazas.com"},{"name":"samullen","email":"samullen@gmail.com"},{"name":"jarrmiller","email":"jarrod.miller@activeprospect.com"},{"name":"ddaskal","email":"dean+npm@activeprospect.com"},{"name":"nathanielinman","email":"nate@theoestudio.com"},{"name":"benjmartin","email":"benjamin.martin2010@gmail.com"},{"name":"sammarten","email":"sam.marten@activeprospect.com"},{"name":"cullentaylor","email":"cullen.taylor@activeprospect.com"},{"name":"phoenix16t","email":"jimenez.eddie@gmail.com"},{"name":"rford-ap","email":"richard.ford@activeprospect.com"},{"name":"gabriel.roldan.ap","email":"gabriel.roldan@activeprospect.com"}],"homepage":"https://github.com/activeprospect/node-marketo#readme","bugs":{"url":"https://github.com/activeprospect/node-marketo/issues"},"dist":{"shasum":"e1f61bc1e1fc46bfbd06be52fa12423554b99c58","tarball":"https://registry.npmjs.org/@activeprospect/node-marketo/-/node-marketo-0.7.9.tgz","fileCount":76,"integrity":"sha512-aKR+E115bI2vSM0jtNEBFDhg6e3b9qnGlBakuso8iowhAHjxF7eqJyzqgxBHyKVKI4HJy3wUN9J7lpmyIJ/E9Q==","signatures":[{"sig":"MEUCIQCfHYokpGE9QkuuMsC6YGlErGcFkEuqY9XhTqzDrUY2xAIgIYawyZ9x0jTbJ6YDSHFZk3WeBBAb5zTyJobRaGQFAS4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":134795,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgOWRUCRA9TVsSAnZWagAAcHIP/iKF+2uyLlJBiwsroVuQ\nHc+MVOPgUaFuoeg0YczgyMRM/3GQK3dpAy+lR6f0KG7RkiZm0gdTPxaznhMg\nhv7lP1YxEAMzxa626i62MxnYP0dX2cqS1kUUJtBLbMRAznDJaQL1YZ/S31Pc\nBrdraBRPers22n0DXGicDotziPgx+QPULWwLHU5XzEYsoB0gn3vOnowVAKx3\nEu0WGczixzGF1w1MN2x9s4yL6hbj8BuaKWXHENkVaGZMsMxCY26wiURp+PnI\nAH29656MSZQDC+SvXKXhORSupzjY9X/HR6MTTr5HQVHQfxJ8mtpQbZ8gmSa8\n+uLLR4E9h3neOR8O17906TSF5ooYTEWLljbrDt/DaEwBtGUOWDpqR/F5O8pY\nKRzXGlpFbBLm3WUGYy1EGRs7gnlaiTValWyp2d2pvjmXqIGdGsARDljo9am8\nvuephaJzS3x9QAZXNhV1sfs98R9ENl+5fU/OqeI6p+enX/lV0hTmRdKmEc/x\nPJJY+g9Z4s4UcEW/tJ46NXQpSltcQ4eNnRj5yxfBo6dKRLhWUY9Pw8WIuScF\nR/phiseHEP/w1wad82rjoxAKoSG5/wR99LDqz3CUwK0nRsTbwmSztGjHJpwG\nc+PXjjsso9BQR+hT7jdNHOs/KCaMzX7Mq6K98b4Ispj/I6fK7/mPd9u9eOPZ\nMmYl\r\n=XDXX\r\n-----END PGP SIGNATURE-----\r\n"},"engines":{"node":">=4.8.5"},"gitHead":"2b6b7a9e4ecb931f62918332a1351d2080ca3c42","scripts":{"test":"mocha test/*test.js --exit","testRecord":"REPLAY=record mocha -t 10000 test/*test.js --exit"},"_npmUser":{"name":"cgrayson","email":"cgrayson@airpost.net"},"repository":{"url":"git+https://github.com/activeprospect/node-marketo.git","type":"git"},"_npmVersion":"6.14.8","description":"forked marketo rest client","directories":{},"_nodeVersion":"12.19.0","dependencies":{"qs":"6.9.x","bunyan":"1.0.x","lodash":"^4.17.21","moment":"2.24.0","backoff":"2.4.x","bluebird":"2.3.x","iconv-lite":"0.2.11"},"_hasShrinkwrap":false,"devDependencies":{"nock":"^11.7.0","mocha":"^8.3.0","replay":"2.1.x","rewire":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/node-marketo_0.7.9_1614373972152_0.5591554338420952","host":"s3://npm-registry-packages"}},"0.7.10":{"name":"@activeprospect/node-marketo","version":"0.7.10","_id":"@activeprospect/node-marketo@0.7.10","maintainers":[{"name":"alisimbanegavi","email":"alison.simbanegavi@activeprospect.com"},{"name":"ap_luisferreira","email":"Luis.Ferreira@activeprospect.com"},{"name":"samuelelder","email":"samuel.elder@activeprospect.com"},{"name":"jgrayson03","email":"jonathan@activeprospect.com"},{"name":"apadmin","email":"dev@activeprospect.com"},{"name":"alexkwolfe","email":"alexkwolfe@gmail.com"},{"name":"kellym","email":"kellymartinv@gmail.com"},{"name":"cgrayson","email":"cgrayson@airpost.net"},{"name":"steveodom","email":"steve.odom@gmail.com"},{"name":"mikebetts","email":"mike.betts@activeprospect.com"},{"name":"justinwinslow","email":"justin@jwin.me"},{"name":"samullen","email":"samullen@gmail.com"},{"name":"jarrmiller","email":"jarrod.miller@activeprospect.com"},{"name":"ddaskal","email":"daskas88@gmail.com"},{"name":"nathanielinman","email":"nate@theoestudio.com"},{"name":"benjmartin","email":"benjamin.martin2010@gmail.com"},{"name":"sammarten","email":"sam.marten@activeprospect.com"},{"name":"rford-ap","email":"richard.ford@activeprospect.com"},{"name":"gabriel.roldan.ap","email":"gabriel.roldan@activeprospect.com"},{"name":"stwf-ap","email":"steven.fuchs@activeprospect.com"},{"name":"asedarski","email":"alicia.sedarski@activeprospect.com"}],"homepage":"https://github.com/activeprospect/node-marketo#readme","bugs":{"url":"https://github.com/activeprospect/node-marketo/issues"},"dist":{"shasum":"e36181fd796e80b263072ceff7c26e1a8065dd8b","tarball":"https://registry.npmjs.org/@activeprospect/node-marketo/-/node-marketo-0.7.10.tgz","fileCount":76,"integrity":"sha512-sNaG1zdyojoSTdNjrXVxMDBOcDALEpdQqiuEl6RcDWxQ3DI9YmahI4iZnudtjiDCm6rqx/kse7SYY4GcQgzUFg==","signatures":[{"sig":"MEUCIQC6qs9E8IQA1EkBN+EITpI1UdCKVdz5qIuH+fEZhiBppwIgAZ9cd8VYMiMWTGTjQYuxHyjNvLQuWBCGyBvPbJ0llKU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":116358},"engines":{"node":">=4.8.5"},"gitHead":"26d8dbff91fe86fc74d0871e0390c720ca11ff3b","scripts":{"test":"mocha test/*test.js --exit","testRecord":"REPLAY=record mocha -t 10000 test/*test.js --exit"},"_npmUser":{"name":"kellym","email":"kellymartinv@gmail.com"},"repository":{"url":"git+https://github.com/activeprospect/node-marketo.git","type":"git"},"_npmVersion":"6.14.15","description":"forked marketo rest client","directories":{},"_nodeVersion":"12.22.6","dependencies":{"bunyan":"1.0.x","lodash":"^4.17.21","moment":"2.24.0","backoff":"2.4.x","request":"^2.88.2","bluebird":"2.3.x"},"_hasShrinkwrap":false,"devDependencies":{"nock":"^11.7.0","mocha":"^8.3.0","replay":"2.1.x","rewire":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/node-marketo_0.7.10_1632168598644_0.3204462761185556","host":"s3://npm-registry-packages"}}},"time":{"created":"2019-01-02T22:38:12.830Z","modified":"2026-08-19T17:28:40.574Z","0.2.5":"2019-01-02T22:38:12.974Z","0.7.9":"2021-02-26T21:12:52.322Z","0.7.10":"2021-09-20T20:09:58.917Z"},"bugs":{"url":"https://github.com/activeprospect/node-marketo/issues"},"homepage":"https://github.com/activeprospect/node-marketo#readme","repository":{"url":"git+https://github.com/activeprospect/node-marketo.git","type":"git"},"description":"forked marketo rest client","maintainers":[{"email":"dev@activeprospect.com","name":"apadmin"},{"email":"alexkwolfe@gmail.com","name":"alexkwolfe"},{"email":"steve.odom@gmail.com","name":"steveodom"},{"email":"dpjones09@gmail.com","name":"dpjones09"},{"email":"john.bench@activeprospect.com","name":"johnb2"},{"email":"Luis.Ferreira@activeprospect.com","name":"ap_luisferreira"},{"email":"alison.simbanegavi@activeprospect.com","name":"alisimbanegavi"},{"email":"benjamin.martin2010@gmail.com","name":"benjmartin"},{"email":"omar.vazquez@activeprospect.com","name":"vzqzacap"},{"email":"sam.marten@activeprospect.com","name":"sammarten"},{"email":"gabriel.roldan@activeprospect.com","name":"gabriel.roldan.ap"},{"email":"steven.fuchs@activeprospect.com","name":"stwf-ap"},{"email":"jose.salina@activeprospect.com","name":"josevsp"},{"email":"shoeb.khan@activeprospect.com","name":"apshoebkhan"},{"email":"ricky.mcmurtrey@activeprospect.com","name":"rickymcmurtrey"},{"email":"matteo.pandolfi@activeprospect.com","name":"matteo.pandolfi"},{"email":"carl.hannusch@activeprospect.com","name":"carlhannusch"},{"email":"petra.terbe@activeprospect.com","name":"terbepetra"},{"email":"jarrmill@outlook.com","name":"jarrodbmiller"},{"email":"stefano.santonocito@activeprospect.com","name":"stefano.santonocito"},{"email":"carlo.anselmi@activeprospect.com","name":"carlo.anselmi"},{"email":"josh.evensen@activeprospect.com","name":"jevensen"},{"email":"christian.celora@leadsbridge.com","name":"celolb"},{"email":"dusan.pantelic@activeprospect.com","name":"dusan.pantelic.ap"},{"email":"chris.snyder@activeprospect.com","name":"jastingo"},{"email":"it@activeprospect.com","name":"it-activeprospect"},{"email":"santiago.ferreira@activeprospect.com","name":"santiago.ferreira"},{"email":"fellipe.fingoli@activeprospect.com","name":"fellipe.fingoli"},{"email":"ludwig.olaru@activeprospect.com","name":"lolaru-ap"},{"email":"matias.delgado@activeprospect.com","name":"matiasdelgado"},{"email":"benjamin.hanisch@activeprospect.com","name":"benjaminhanischactiveprospect"}],"readme":"# node-marketo\n\nA wrapper around Marketo's REST API.\n\n## Usage\n\n### Installation\n\n```\nnpm install --save node-marketo-rest\n```\n\n### Creating a connection\n\nYou will first need to obtain your OAuth information from Marketo, they have a [guide out](http://developers.marketo.com/documentation/rest/authentication/) to get you started. In short, you will need to get the endpoint url, identity url, client id and client secret.\n\n```js\nvar Marketo = require('node-marketo-rest');\n\nvar marketo = new Marketo({\n  endpoint: 'https://123-ABC-456.mktorest.com/rest',\n  identity: 'https://123-ABC-456.mktorest.com/identity',\n  clientId: 'client id',\n  clientSecret: 'client secret'\n});\n\nmarketo.lead.find('id', [2, 3])\n  .then(function(data, resp) {\n    // data is:\n    // {\n    //   requestId: '17787#149c01d54b8',\n    //   result: [{\n    //     id: 2,\n    //     updatedAt: '2014-11-13 15:25:36',\n    //     createdAt: '2014-11-13 15:25:36',\n    //     ...\n    //   }, {\n    //     id: 3,\n    //     updatedAt: '2014-11-13 16:22:03',\n    //     createdAt: '2014-11-13 16:22:03',\n    //     ...\n    //   }],\n    //   success: true\n    // }\n  });\n```\n\n### Pagination\n\nWhen a specific call results in a lot of elements, you will have to paginate to get all of the data. For example, getting all the leads in a large list will likely exceed the maximum batch size of 300. When this happens, you can check for the existence of the `nextPageToken` and use it in the next call:\n\n```js\nmarketo.list.getLeads(1)\n  .then(function(data) {\n    if (data.nextPageToken) {\n      // preserve the nextPageToken for use in the next call\n    }\n  });\n```\n\nIf you want a less manual process, the result comes with a convenient `nextPage` function that you can use. This function only exists if there's additional data:\n\n```js\nmarketo.list.getLeads(1)\n  .then(function(page1) {\n    // do something with page1\n\n    if (page1.nextPageToken) {\n      return page1.nextPage();\n    }\n  })\n  .then(function(page2) {\n    // do something with page2\n  });\n```\n\n### Stream\n\nInstead of getting data back inside of the promise, you can also turn the response into a stream by using the `Marketo.streamify` function. This will emit the results one element at a time. If the result is paginated, it will lazily load all of the pages until it's done:\n\n```js\nreturn marketo.streamify('lead', 'getLeads', [ 1 ])\n\nresultStream\n  .on('data', function(lead) {\n    // do something with lead\n  })\n  .on('error', function(err) {\n    // log the list error. Note, the stream closes if it encounters an error\n  })\n  .on('end', function() {\n    // end of the stream\n  });\n```\n\n```js\nvar count = 0;\n\nresultStream\n  .on('data', function(data) {\n    if (++count > 20) {\n      // Closing stream, this CAN be called multiple times because the\n      // buffer of the queue may already contain additional data\n      resultStream.endMarketoStream();\n    }\n  })\n  .on('end', function() {\n    // count here CAN be more than 20\n    console.log('done, count is', count);\n  });\n```\n\n### Extract\n\nBulk Extract provides a programmatic interface for retrieving large amounts of activity data out of Marketo.  For cases which do not require low latency, and need to transfer significant volumes of activity data out of Marketo, such as CRM-integration, ETL, data warehousing, and data archiving.\n\nThe process requires you to `bulkLeadExtract.create` a request, then `bulkLeadExtract.enqueue` the request, then poll the `bulkLeadExtract.status`, `bulkLeadExtract.statusTilCompleted` will poll till completed, also while calling `bulkLeadExtract.cancel` for any errors.\n\nThe `bulkLeadExtract.get` method will preform these all these actions for you.\n\nThen `bulkLeadExtract.file` or `bulkLeadExtract.fileStream` can be used to access the extracted file.\n\nBulk Extract Leads\n```js\nmarketo.bulkLeadExtract.get(\n  ['firstName', 'lastName', 'id', 'email'],\n  { staticListName: 'some list name' })\n  .then(function(data) {\n    // export is ready\n    let exportId = data.result[0].exportId;\n    return marketo.bulkLeadExtract.file(exportId);\n  })\n  .then(function(file) {\n    // do something with file\n  });\n```\n\n####Bulk Activity Extract\nFollow the same convention as bulk extracting leads, but provide different filter information for the start/end date, activity type ids and any other supported filters or parameters. [Marketo Docs] (http://developers.marketo.com/rest-api/bulk-extract/bulk-activity-extract/)\n\n\n```\nmarketo.bulkActivityExtract.get(\n        {createdAt: {\n                startAt: '2018-07-01T23:59:59-00:00',\n                endAt:  '2018-07-03T23:59:59-00:00'\n            },\n            activityTypeIds: [\n                1, //example types\n                12,\n                13\n            ]})\n        .then(function(data) {\n            // export is ready\n            let exportId = data.result[0].exportId;\n            return marketo.bulkActivityExtract.file(exportId);\n        })\n        .then(function(file) {\n            //Do something with file\n        });\n});\n```\n\n\n# Test\n\n### Generating a replay for a test\n\nThe initial run of the test has to be run against an actual API, the run (when\nin recording mode) should capture the API request/response data, which will then\nbe used for future calls. What makes this a little tricky is Marketo API\nendpoints are unique per account, so we have to convert the captured data to\nsomething else for future purposes. We also need to remove credentials from\nthese captures as well. Anyway, here's the annoying process of generating data:\n\n##### Running against the actual API\n\nThe test looks at 4 environment variables when running, they are:\n\n- `MARKETO_ENDPOINT`\n- `MARKETO_IDENTITY`\n- `MARKETO_CLIENT_ID`\n- `MARKETO_CLIENT_SECRET`\n\nAfter setting these variables, run `npm run testRecord`.\n\n##### Stripping sensitive information\n\nRun the script `./scripts/strip-fixtures.sh`, which will convert the unique\nMarketo host over to `123-abc-456.mktorest.com` in addition to removing the\ncapture that contains sensitive client id/secret file.\n\n##### Copy the data\n\nThe data should now be moved over to `fixtures/123-abc-456.mktorest.com-443`,\npreferably with a useful name so it's easier to keep track of in the future.\n\n##### Tip\n\nWe are using mocha to run the test, you can run a single test so that you\ngenerate only the needed data. To do so, you append `only` to a test:\n\n```js\n    // on a single unit test\n    it.only('test description', function() {})\n\n    // or an entire describe\n    describe.only('test description', function() {})\n```\n\nOne more thing to note is that once we've processed the raw data, `node-replay`\nwill not be able to map it back to the original raw request. This means that if\nyou run `npm run testRecord`, you will be generating requests against Marketo's\nAPI directly. I highly recommend using `only`.\n","readmeFilename":"README.md"}