Jump to content

Reply to ticket api


Recommended Posts

Hi,

 

I've been building a custom system that allows clients to view and reply to their tickets. Viewing their tickets is no worry and replying to the ticket is no worry either however when I submit a ticket reply through the "External API" it shows as a staff member has submitted a reply, not the client. I've tried adding the $postfields["clientid"] = "1"; attribute which does add the client id to the tblticketreplies row "userid" but again...the system recognizes it as a staff reply rather than a client reply. How can I fix this?

 

 

Any help/suggestions would be greatly appreciated.

 

Thanks

Link to comment
Share on other sites

Hi JS-James,

 

Firstly, thanks for your reply.

 

Secondly, I am using the following:

 

$url = "url to the api"; # URL to WHMCS API file goes here
$username = "an admin username with api access"; # Admin username goes here
$password = "the password for that user"; # Admin password goes here

$postfields = array();
$postfields["action"] = "addticketreply"; 
$postfields['clientid'] = "$_GET[userid]";
$postfields["ticketid"] = "145";
$postfields["adminusername"] = "Auto-Response";
$postfields["message"] = "$_GET[message]";

 

I'm using an admin username which only has API access...If I remove the $username and $password variables then it throws the error "authentication failed" and doesn't submit the reply

 

Do client username(s) and their passwords have API access? - I never tried it...

 

 

Thanks

Ben

Edited by benyoungenterprises
forgot to change variable
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