function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Mahesh MahawarMahesh Mahawar 

Problem to get login form .Net Application

Hi Team,
I am .Net Developer and try to integrate with salesforce with my .net Application .
I have Created a Connected App  and got the Consumer key and secreat key .
When i try to login from application ,received the code in first call with redirect url and in second call pass the code which i got in callback .
getting bad request from the salesforce server.
Please help me to complete the developement?
The information is given below :
Connected App :Yepme_SaleForce_Int
NagendraNagendra (Salesforce Developers) 
Hi Mahesh,

A 400 means that the request was malformed. In other words, the data stream sent by the client to the server didn't follow the rules.

In the case of a REST API with a JSON payload, 400's are typically, and correctly I would say, used to indicate that the JSON is invalid in some way according to the API specification for the service.


I resolved this by changing in API end by sending the error message as JSON response. By default Salesforce shows only default message for respective Status Code.

In my case, I'm getting a response with status code as 400 and Salesforce set the status message as"Bad Request". So I changed in my API end to send a JSON response with error message, from that I can show a proper error message in Salesforce.


Please refer to the below link and follow the process as its given to integrate between salesforce and .net.
https://developer.salesforce.com/page/Integrating_Force.com_with_Microsoft_.NET

For more information download the sample codes from:
http://wiki.developerforce.com/index.php/Web_Services_API#.Net_and_Visual_Basic
 

Also, go through the documentation given below :
 
http://wiki.developerforce.com/index.php/Login.vb
 
http://wiki.developerforce.com/index.php/Query_query_more.vb
 
http://wiki.developerforce.com/index.php/Batch_records.vb



Please mark this as solved if it helps you.

Best Regards,
Nagendra,P

 
Mahesh MahawarMahesh Mahawar
Hi Team, Now i am able to login successfully in Salesforce with Oauth 2.0. Now i am facing to Create New Case and getting 403 Error (API is Not enabled for this Company,"API_DISABLED_FOR_ORG"). Using this REST API: *https://ap2.salesforce.com/services/data/v20.0/sObject/Case/ * *Authorization:* "Bearer 00D28000001bk9Z!AQoAQIsJHUCBdDjNXl0v11Unjl4EjHijNqgbi5Jdb_0c6y2Bbw3ttLkNVHZv6yfENn0gSy5cUc.xurFjZ32_fVFwnmRCi43P" Posting Data :"*{\Subject\:\Test\,\Status\:\New,\Type\:\Problem\,\Description\:test description}*" Please Let me know,how can i do this to create New Case via REST API. Thanks & Regards Mahesh Chandra Mahawar Sr. Manager-IT VAS Data Services Pvt. Ltd. 2nd Floor, Right Wing Orchid Center, Golf Course Road, Sector 53 Gurgaon – 122001 Contact:-8130467923