Script URL: localhost
Mods for HESK version: 3.2.1
HESK version: 2.7.3
Hosting company: Self Hosted/IIS 10
URL of phpinfo.php: n/a
URL of session_test.php: n/a
What terms did you try when SEARCHING for a solution: auth
Write your message below:
To completely eliminate the possibility of someone using the API to generate a ticket that is not supposed to, is there a way to restrict the ticket POST to only those with an auth token?
I saw in the latest notes (3.2.0) that the functionality was taken away?
Thanks,
Tom
Tickets POST requiring Auth Token
Moderator: mkoch227
Re: Tickets POST requiring Auth Token
In /api/index.php, find:
Change "SecurityHandler::OPEN" to "SecurityHandler::AUTH_TOKEN"
Regarding whether that endpoint should be open or require a token in the future, I'm still debating that personally (hence why the API is still considered to be in beta
). Once I get around to adding "generic" auth tokens (that are not tied to a specific user), I may end up requiring an auth token for all requests again.
Code: Select all
'/v1/tickets' => action(\Controllers\Tickets\CustomerTicketController::clazz(), RequestMethod::all(), SecurityHandler::OPEN),
Regarding whether that endpoint should be open or require a token in the future, I'm still debating that personally (hence why the API is still considered to be in beta

Mike, Lead Developer of
HESK: A surprisingly simple, user-friendly and FREE help desk software with integrated knowledgebase.
-
- Posts: 17
- Joined: Mon Oct 30, 2017 8:35 pm
Re: Tickets POST requiring Auth Token
mkoch227 wrote: Tue Nov 07, 2017 6:45 pm In /api/index.php, find:
Change "SecurityHandler::OPEN" to "SecurityHandler::AUTH_TOKEN"Code: Select all
'/v1/tickets' => action(\Controllers\Tickets\CustomerTicketController::clazz(), RequestMethod::all(), SecurityHandler::OPEN),
Regarding whether that endpoint should be open or require a token in the future, I'm still debating that personally (hence why the API is still considered to be in beta). Once I get around to adding "generic" auth tokens (that are not tied to a specific user), I may end up requiring an auth token for all requests again.
Thank you very much Mike,
I'm guessing I can send the token with "auth_token" => "tokenID", from within the JSON Array?
Thanks,
Tom
Re: Tickets POST requiring Auth Token
The token should be passed in as a request header (X-Auth-Token: <token here>).
Mike, Lead Developer of
HESK: A surprisingly simple, user-friendly and FREE help desk software with integrated knowledgebase.