Hi, I am trying to send data to Salesforce destina...
# support
c
Hi, I am trying to send data to Salesforce destination. I am using javascript SDK, When i hit identify event then liver event debugger showing following error: "{ "error": "Request failed with status code 400" }". Network tab response showing 200. Please help to me resolve issue.
b
cc @glamorous-mouse-54282 to look at this
g
Hey @chilly-ambulance-75176 you’ll see a 200 to the server because the event is successfully sent to our server, the 400 is the call from our server to SalesForce, so that makes sense. Can you see the full message of that error in the Control Plane and share it? I’ll see if I can find it on our back end, but it’s most likely an auth issue.
c
Hi, As you can see live event debugger screen, It's showing "error": "Request failed with status code 400".
g
Right, I can’t see the full error message in the screenshot you send.
Let me take a look.
c
Sure
g
Are you seeing a lead in SalesForce with that email address?
c
No
g
This is typically an auth error, can you check your authentication credentials? If you’ve changed your password, you’ll need to change your access token as well
c
Which authentication credentials Rudderstack or Salesforce
g
Salesforce, within your rudderstack control plane
That 400 error is coming from SalesForce when we are sending events to their API
c
ok, let me check
Re generated initial access token and updated in app.rudderstack, but error is same.
What is use of Salesforce security token in rudderstack?
g
That’s used to authenticate your SF account for API calls
c
Ok. Where should i put this security token.
g
That should show you what’s needed for the SalesForce destination. You also need to be sure you’re setting
'Salesforce': true
in the integrations key for the event.
c
Yes I read documentation, did't find anything related to security token. Yes I already added 'Salesforce': true
g
Can you share the code for the call you’re sending to rudder
c
<script> rudderanalytics = window.rudderanalytics = []; var methods = [ "load", //"page", "track", "identify", "alias", "group", "ready", "reset", "getAnonymousId", "setAnonymousId" ]; for (var i = 0; i < methods.length; i++) { var method = methods[i]; rudderanalytics[method] = function (methodName) { return function () { rudderanalytics.push([methodName].concat(Array.prototype.slice.call(arguments))); }; }(method); } rudderanalytics.load('1jEsPHTzX4Zp5elbkEnr8CZg6Db','https://hosted.rudderlabs.com'); </script> <script src="https://cdn.rudderlabs.com/v1/rudder-analytics.min.js"></script> <script type="text/javascript"> rudderanalytics.identify( "123", { email: "123name@domain.com" }, () => { console.log("in identify call"); } ); </script>
g
I’m not seeing the
Salesforce: true
c
Sorry, I was testing code. That's why i changed. Now I have added and showing same error. rudderanalytics.identify('12345', { name: 'John Doe', title: 'CEO', email: 'name.surname@domain.com', company: 'Company123', phone: '123-456-7890', state: 'Texas', rating: 'Hot', city: 'Austin', postalCode: '12345', country: 'US', street: 'Sample Address', state: 'TX' }, { 'integrations': { 'Salesforce': true } });
g
Do you have all of those setup as custom fields in Salesforce?
c
I removed all fields except email. again it's showing same error.
g
Yep, so everything seems fine, it seems like an authentication error from Salesforce
c
How can i solve this issue.
g
You’ll need to make sure you’re authenticating Salesforce properly. What version of salesforce are you using?
If you notice in our docs you need Enterprise, Unlimited, Developer or Performance editions to use the API
c
I am using developer account. Should I need to enable any option in salesforce?
g
You may need to ask Salesforce why you’re getting an authentication error. Or if you can check your Salesforce API logs from their end.
c
Thank you.