Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Salesforce Mobile Pack Connector Username/Password Authentication

$
0
0

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


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>