Question

Javascript Query Profiles API "Sorry, this API currently requires multiple forms of authentication which we don't yet support."

  • 16 December 2021
  • 1 reply
  • 38 views

I must be missing something. Using the tool at https://developer.mixpanel.com/reference/engage-query I’m able to make a Node request and receive back results as expected. If I copy and paste the sample code into my local machine and execute it (tried both node 12 and 14)

const sdk = require('api')('@mixpaneldevdocs/v2.82#gazup2bkv0dev1l');

sdk.auth(service account info)

 

I consistently receive the error on the engage-query call:

Error: Sorry, this API currently requires multiple forms of authentication which we don't yet support.

 

The api library prepareAuth.js is getting two schemes: Service Account, Project Secret.

The data is returned, and I can consume it by editing the prepareAuth.js file. prepareAuth.js is specifically checking for a length >1 on the schemes, which mixpanel is returning.

 

I’m using api@4.1.1 (latest at time of typing this). Any feedback is greatly appreciated.


1 reply

I have the exact same problem on my side while using the code visible on the live tester here https://developer.mixpanel.com/.

After installing the api node package, any API calls is resulting the same error.

Here the code:

const sdk = require('api')('@mixpaneldevdocs/v2.82#gazup2bkv0dev1l');

sdk.auth('xxxxxxx', 'xxxxxxx')
sdk['engage-query']({

}, {
project_id: 'yyyyyy',
Accept: 'application/json'
})
.then(res => console.log(res))
.catch(err => console.error(err));

 

I get the following error:

Error: Sorry, this API currently requires multiple forms of authentication which we don't yet support.

    at authKeys.forEach (/xxxxxx/node_modules/api/src/lib/prepareAuth.js:27:13)

    at Array.forEach (<anonymous>)

    at module.exports (/xxxxxx/node_modules/api/src/lib/prepareAuth.js:24:12)

    at Promise.then.params (/xxxxxx/node_modules/api/src/index.js:57:53)

    at process._tickCallback (internal/process/next_tick.js:68:7)

    at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)

    at startup (internal/bootstrap/node.js:283:19)

    at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)

 

Can you help us in order to find a way to do just simple API calls on NodeJS ? 

Reply