Querying the API
We need some test data in order to test our service, so let's create the contacts.json
file in the data
directory of our project:
{ "result": [{ "firstname": "Joe", "lastname": "Smith", "title": "Mr.", "company": "Dev Inc.", "jobtitle": "Developer", "primarycontactnumber": "+359777123456", "othercontactnumbers": [ "+359777456789", "+359777112233" ], "primaryemailaddress": "joe.smith@xyz.com", "emailaddresses": [ "j.smith@xyz.com" ], "groups": [ "Dev", "Family" ] }, { "firstname": "John", "lastname": "Douglas", "title": "Mr.", "company": "Dev Inc.", "jobtitle": "Developer", "primarycontactnumber": "+359777223344", "othercontactnumbers": [], "primaryemailaddress": "john.douglas@xyz.com", "emailaddresses": [ "j.douglas@xyz.com" ], ...
Get RESTful Web API Design with Node.js - Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.