Jump to content

Get client id via API


ravex

Recommended Posts

Hi everyone

 

I have a contact form on my website that is using the API to open tickets when people contact me via the site.

 

However, if a client that already has an account contacts me new tickets do not get assigned to them, they show up as a guest ticket. How would I go about finding the client ID, to then assign the new ticket to that client without any intervention from my staff or myself?

 

The code I am using at the moment is:

$url = "https://apipath";
$postfields["username"] = "apiuser";
$postfields["password"] = md5("apipass");

$postfields["action"] = "OpenTicket";
$postfields["deptid"] = "1";
$postfields["name"]  = $this->input->post('name');
$postfields["email"] = $this->input->post('email');
$postfields["subject"] = "New message via the contact form";
$postfields["message"] = $this->input->post('message');

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
$data = curl_exec($ch);
curl_close($ch);

 

Many Thanks

Paul

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated