# How to talk with external nosql with service custom script

**URL:** <https://community.dreamfactory.com/t/how-to-talk-with-external-nosql-with-service-custom-script/2325>\
**Category:** Server-Side Scripting\
**Created:** [March 7, 2016, 11:31am UTC](https://community.dreamfactory.com/t/how-to-talk-with-external-nosql-with-service-custom-script/2325 "2016-03-07T11:31:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rusher](https://avatars.discourse-cdn.com/v4/letter/r/ac8455/32.png) [@Rusher](https://community.dreamfactory.com/u/Rusher)\
**Post date:** [March 7, 2016, 11:31am UTC](https://community.dreamfactory.com/t/how-to-talk-with-external-nosql-with-service-custom-script/2325/1 "2016-03-07T11:31:39Z")

</div>

I tried to use node custom script tutorial as a guide to test external nosql api that I setup in the service, but I gotten the following error

error": {  
“context”: null,  
“message”: “Bad request. No token or api key provided.”,  
“code”: 400,  
“trace”: [

The code is as follows…  
taken from and modify from -\> [https://wiki.dreamfactory.com/DreamFactory/Tutorials/Node\_platform\_api\_crud](https://wiki.dreamfactory.com/DreamFactory/Tutorials/Node_platform_api_crud)

var request = require(‘request’);

var options = {  
// Get all records from todo table.  
// This table can be easily created in admin console from Schema–\>Upload JSON.  
url: ‘[http://xyz008.com/api/v2/db/\_table/ext\_nosql](http://xyz008.com/api/v2/db/_table/ext_nosql)’,  
// Use same auth as user calling this script.  
headers: {  
‘x-dreamfactory-api-key’: ‘2190dsfa0vf23r9203vjwerwer23r’  
}  
};

request(options, function (error, response, body) {  
if (!error && response.statusCode == 200) {  
event.response.content = body;  
} else {  
event.response.status\_code = response.statusCode;  
event.response.content = body;  
}  
});
