Hi All, I am trying to use appcelerator.saleforce module for my application. I am using the username-password authentication flow.My request looks like below.
var connectedApp = new salesforce.ConnectedApp({ consumerKey : Ti.App.Properties.getString('force.consumer.key'), consumerSecret : Ti.App.Properties.getString('force.consumer.secret'), loginUrl:'https://XXX.salesforce.com/services/oauth2/authorize', redirectUri:'https://XXX.salesforce.com/services/oauth2/callback', instanceUrl:'https://XX.salesforce.com' }); connectedApp.loginApi({ username:'xxxxxxx', password:'xxxxx', securityToken: 'xxxx',
success : function(e, meta) {
connectedApp.create({
name: 'Account',
data: {
Name:'BSRJSM Limited'
},
success : function(results) {
Ti.API.info('Record id: ' + results.id);
},
error: function(error) {
Ti.API.error('ERROR:' + error.message);
}
});
But I am getting a response as below: {"errorCode":400,"details":"The request could not be understood, usually because the JSON or XML body has an error.","message":"HTTP error"} Can you please point me where Am I doing wrong with this. Regards, Abhilash