Trying to create leads using the api.

3 댓글

  • James Rodewig
    Zendesk Documentation Team

    Hi Agave,

    I'm sorry to hear you ran into this issue.

    The Leads endpoints are part of the Sales CRM API. The Sales CRM API use the following base URL for their endpoints: https://api.getbase.com

    We call that out in the Sales CRM API intro docs, but it's easy to miss.

    I hope that helps!

    0
  • Agave

    Thank you so much for your help!  That explains a lot.  I was wondering if you could help me one more time.

    So now I'm get Status Code: 500   Internal Server Error.  What might be causing this?  Do I need to use a different API token than what I was using for creating tickets?

    var payload = new
                {
                    lead = new
                    {
                        first_name = firstName,
                        last_name = "LastName",
                        email = email,
                        organization_name = "",
                        tags = tags
                    }
                };
    // Convert the payload to JSON
             var jsonPayload = JsonConvert.SerializeObject(payload);


    This is the JSON objetct:
    {"lead":{"first_name":"Joe","last_name":"LastName","email":"test+zendesk28@gmail.com","organization_name":"","tags":["MyTag"]}}

    Everything is the same as above, but the URL

    var response = client.PostAsync("https://api.getbase.com/v2/leads",
                        new StringContent(jsonPayload, Encoding.UTF8, "application/json")).Result;
    0
  • Christopher Kennedy
    Zendesk Developer Advocacy
    Hi Agave,
     
    Yes that's correct.  For the Sales CRM API you'll need to get a bearer token from the Sell OAuth endpoint to authenticate your requests.
    0

댓글을 남기려면 로그인하세요.

Zendesk 제공