8000 Tickets cURL code is illegal · Issue #51 · Wallvon/MOFH-API-Docs · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Tickets cURL code is illegal #51

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
greenreader9 opened this issue Mar 15, 2025 · 1 comment
Open

Tickets cURL code is illegal #51

greenreader9 opened this issue Mar 15, 2025 · 1 comment
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed P1 Priority one, highest priority fix

Comments

@greenreader9
Copy link
Contributor

Affected pages:

Issue:
These pages include a sample cURL call such as (formatted):

curl -X POST 
    -u username:password 
    -d "api_user=username&api_key=password&domain_name=subdomain.example.com&ticket_id=000000" 
    -F ticket_id=000000 
    -F clientusername=hname_12345678 
    -F comments=Test 
    -F ipaddress=1.1.1.1
    "https://panel.myownfreehost.net/xml-api/supportreplyticket.php"

Per documentation, -d and -F are mutually excusive, only one can be used (docs, docs)

To resolve:
Untested, but I think moving all them to -d is the correct way to go, that would also help these pages remain consistent with the rest.

The following PHP code works if you want to model off it:

$post_data = array(
	'comments' => $comm6,
	'ticket_id' => $comm7,
        'clientusername' => $comm5,
	'domain_name' => $comm4,
	'ipaddress' => $comm3,
	'api_user' => $comm2,
	'api_key' => $comm1
);

$curl = curl_init();
curl_setopt_array($curl, array(
	 CURLOPT_URL => 'https://panel.myownfreehost.net/xml-api/supportreplyticket',
	 CURLOPT_RETURNTRANSFER => true,
	 CURLOPT_MAXREDIRS => 10,
	 CURLOPT_TIMEOUT => 0,
	 CURLOPT_POST => 1,
	 CURLOPT_FOLLOWLOCATION => true,
	 CURLOPT_CUSTOMREQUEST => 'POST',
	 CURLINFO_HEADER_OUT => true,
	 CURLOPT_IPRESOLVE => CURL_IPRESOLVE_V4,
	 CURLOPT_POSTFIELDS => $post_data,
));

$response = curl_exec($curl);
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
curl_close($curl);
@Wallvon
Copy link
Owner
Wallvon commented Apr 27, 2025

Missed this but I'll look into it! If you have time, please test if your changes actually work. If you don't, I'll have a look in a few days seeing as I'm currently quite busy :)

@Wallvon Wallvon added documentation Improvements or additions to documentation P1 Priority one, highest priority fix help wanted Extra attention is needed labels Apr 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed P1 Priority one, highest priority fix
Projects
None yet
Development

No branches or pull requests

2 participants
0