Hi,
I am not able to make the API SDK for node work. And the Apigee documentation isn't helping either. :(
I have installed the node.js BaaS SDK, which is essentially the latest version of the usergrid npm package.
My questions:
1. Can Apigee BaaS support the latest usergrid npm module, or do I have to switch to an older one?
2. Here is how I am trying to initialize the usergrid connection:
const Usergrid = require('usergrid'); var config = { orgId: process.env.BaaS_ORG_NAME, appId: process.env.BaaS_APP_NAME, baseUrl:process.env.BaaS_URL, authMode:Usergrid.AUTH_CLIENT_ID, clientId:process.env.BaaS_CLIENT_ID, clientSecret:process.env.BaaS_CLIENT_SECRET }; Usergrid.init(config); Usergrid.GET('customer', function (error, usergridResponse, entities) { if (error) { console.error(error); } else { //my code } })
I am simply getting the following error:
UsergridResponseError { name: 'unauthorized', description: 'Subject does not have permission to access this resource', exception: 'org.apache.usergrid.rest.exceptions.SecurityException' }
I have double checked the config details, especially the client id/secret and the fact that these ids do have access to the org/app & resource.
Update
I am able to connect to the Sandbox app
I guess I am not able to use the right configuration for the production sandbox. Can someone help?
Unable to send BaaS access token to UserGrid Client createEntity 1 Answer
Bulk insert in APIGEE BAAS from (CSV file in AWS S3) using node 1 Answer
How do you pass in an access token for usergrid.client.createEntity 1 Answer
Usergrid node.js usergrid.init() error 1 Answer
How do I query BaaS/Usergrid using Paw for MacOS X? 1 Answer