• ila pambhar
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 3
    Replies
Hello everyone,

I need help it's urgent so please reply as soon as possible.
I am using below code to add lead from .net website to Salesforce.
Code Structure :

            var uri = this.Instant_url + "/services/data/v33.0/sobjects/Lead/";
            var acct = new sObjectLead();
            acct.FirstName = shruti;
            acct.LastName =Patel;
            acct.Company = IBM;
            acct.LeadSource = "Scout";
            acct.Email = shruti121@gmail.com;
            acct.Phone = 9256362563;
            acct.Title = "Test"

            var ser = new JavaScriptSerializer();
            var body = ser.Serialize(acct);
            var req = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(uri);

            req.Headers.Add("Authorization: OAuth " + this.access_token);
            req.ContentType = "application/json";
            req.Method = "POST";

            byte[] data = System.Text.Encoding.ASCII.GetBytes(body);
            req.ContentLength = body.Length;
            var os = req.GetRequestStream();
            os.Write(data, 0, data.Length);
            os.Close();

I am able to add lead in Development account & Enterprise account. Is it possible to add lead in nonenterprise account?If yes, then please tell me how can i add ?
 Can you please suggest me what is the issue in this code ? 

 
Hello everyone,

I need help it's urgent so please reply as soon as possible.
I am using below code to add lead from .net website to Salesforce.
Code Structure :

            var uri = this.Instant_url + "/services/data/v33.0/sobjects/Lead/";
            var acct = new sObjectLead();
            acct.FirstName = shruti;
            acct.LastName =Patel;
            acct.Company = IBM;
            acct.LeadSource = "Scout";
            acct.Email = shruti121@gmail.com;
            acct.Phone = 9256362563;
            acct.Title = "Test"

            var ser = new JavaScriptSerializer();
            var body = ser.Serialize(acct);
            var req = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(uri);

            req.Headers.Add("Authorization: OAuth " + this.access_token);
            req.ContentType = "application/json";
            req.Method = "POST";

            byte[] data = System.Text.Encoding.ASCII.GetBytes(body);
            req.ContentLength = body.Length;
            var os = req.GetRequestStream();
            os.Write(data, 0, data.Length);
            os.Close();

I am able to add lead in Development account & Enterprise account. Is it possible to add lead in nonenterprise account?If yes, then please tell me how can i add ?
 Can you please suggest me what is the issue in this code ? 

 

Hi,

 

I am new to OAuth and cloud development. I am trying to access my salesforce data using a web application. I am following the instruction from this link.

 

http://wiki.developerforce.com/page/Getting_Started_with_the_Force.com_REST_API

 

I am receiving an access token from salesforce, once i authorize the application to access my account. But when i use the access token to query data from my slesforce account, i get a HTTP 403 - forbiddden response. Am i missing something ? What are the alternate ways that can be used if not REST API ?

 

this is the URL i use to access my account via REST API.

 

https://ap1.salesforce.com/services/data/v20.0/query

My query parameter is this

params[0] = new NameValuePair("q",
                "SELECT Name, Id from Account LIMIT 100");
        get.setQueryString(params);

 

Thanks in advance.

Sanjay