CHAPTER 5

Step 5: Getting Data with the ADP Core Library

The getData() method of the Consumer Application Instance is used to read data from ADP.

The getData() method takes a method name and an optional parameter object as arguments. The list of available method names and parameters can be found in the readme file that accompanies the configuration file.

The data will be returned as a JSON formatted object. The structure of the JSON object is the same as that returned by a normal REST API call.

The code example below shows how to retrieve user info data for a particular associate after the Consumer Application Instance has been created.

app.getData(
    ‘core.v1.associates.associateoid.user.info’, 
    { associateoid: ‘FFEEDDAABBCC0011’}, 
    (err, response) => {
        console.log(‘Received: ', err, response);
    }
);