salesforce-marketingcloud / FuelSDK-Node

BSD 3-Clause "New" or "Revised" License
49 stars 24 forks source link

Not able to perform dataExtension.get(cb); #34

Open Chubnapathorn opened 4 years ago

Chubnapathorn commented 4 years ago

Hello there, Before I inform anything I want to show how I instantiate the SDK in my code

const ET_Client = require('sfmc-fuelsdk-node'); const IET_Client = new ET_Client(clientId, clientSecret, stack, { origin: originURL, //String soapOrigin: soapURL, //String authOrigin: authURL, //String authOptions: { authVersion: authVersion, //String accountId: MID, //String applicatioType: 'server' } });

I tried to use this function to get the data extension from my MC Before this 2 3 months Its work fine nothing to worries but, now I tried to connect my custom app with the new MC Business Unit, I got an error of 'unsupported_grant_type'

var dataExtension = IET_Client.dataExtension(options); dataExtension.get(function(err, response) { console.log(err); }

err : { "res": { "error":"unsupported_grant_type", "error_description":"Use \"authorization_code\" or \"refresh_token\" or \"client_credentials\" or \"urn:ietf:params:oauth:grant-type:jwt-bearer\" as the grant_type.", "error_uri":"https://developer.salesforce.com/docs" } }

I got this data when I try to use dataExtension.get(cb); I'm not so sure what am I do wrong in this process

Expected behavior I want this function to return the data of the data extension I mean the list of data extension from my business Unit

Environment

The bug has the severity

CCBet commented 4 years ago

@Chubnapathorn, I see that you are passing in a String for the authVersion. Can you please pass in a number for it and see if this was the issue?

Chubnapathorn commented 4 years ago

@CCBet yes sure but i still got the sane error

CCBet commented 4 years ago

In the code that you pasted I see a typo: "applicatioType" instead of "applicationType". Is this just a copy - paste mistake?

Chubnapathorn commented 4 years ago

@CCBet Confirm its typo, but I fixed to applicationType and still show the same error