benyoungenterprises Posted December 30, 2012 Share Posted December 30, 2012 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 0 Quote Link to comment Share on other sites More sharing options...
WHMCS JamesX Posted December 30, 2012 Share Posted December 30, 2012 Assuming that you're using the addticketreply API action, than clientid is the attribute to be sending when replying to a ticket as a client. With that said, are you by chance sending the adminusername attribute at the same time? If so, don't; use one or the other. 0 Quote Link to comment Share on other sites More sharing options...
benyoungenterprises Posted December 30, 2012 Author Share Posted December 30, 2012 (edited) 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 December 30, 2012 by benyoungenterprises forgot to change variable 0 Quote Link to comment Share on other sites More sharing options...
benyoungenterprises Posted December 30, 2012 Author Share Posted December 30, 2012 Ok, well I've just tried it with a client username and password and I got "Authentication Failed"....so i'm guessing that client accounts wont work. Any other ideas? 0 Quote Link to comment Share on other sites More sharing options...
WHMCS JamesX Posted December 30, 2012 Share Posted December 30, 2012 You're not understanding what I meant; have a look here. I'm referring to the adminusername attribute postfield/value specifically. In your example code, use one or the other of the following, but not both at any given time: $postfields['clientid'] $postfields["adminusername"] 0 Quote Link to comment Share on other sites More sharing options...
benyoungenterprises Posted December 30, 2012 Author Share Posted December 30, 2012 Thank you so much!!! That did it Thanks once again 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.