Prismicio.getManyDocuments()

Get many documents by Array of ids

Usage

Hover over inputs/exits for more info.

var Prismicio = require('machinepack-prismicio');


// Get many documents by Array of ids

Prismicio.getManyDocuments({

apiEndpoint: 'https://mycompany.prismic.io/api',

accessToken: 'MC5WUWg4VFOHFh.77-9777-9Me-_73vv73vv70rUO-_vWPvv71O77-9ZUPvv73vv71pX--_vQdaNe-_vQ',

ids: [ '123', '456' ],

ref: 'VUYf7y0AAJkBHcVj',

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// Not authorized

notAuthorized: function () {

 

},

// OK.

success: function (result) {

 

},

});

Inputs

apiEndpoint required

Api endpoint for your prismic instance

'https://mycompany.prismic.io/api'
accessToken required

Token provided via settings/apps/.

'MC5WUWg4VFOHFh.77-9777-9Me-_73vv73vv70rUO-_vWPvv71O77-9ZUPvv73vv71pX--_vQdaNe-_vQ'
ids required

Array of document ids

[ '123', '456' ]
ref

Control which versions of documents we can access. Defaults to master which is all live documents.

'VUYf7y0AAJkBHcVj'

Exits

error

An unexpected error occurred.

notAuthorized

Not authorized

success

OK.

[]