Forums | Users |
Search | Signup | Login

Close and Delete ticket from API

Subscribe to Close and Delete ticket from API 4 post(s), 2 voice(s)

 
Avatar irfanbukhari 3 post(s)

Please can anyone tell me how i can delete a ticket from api?
the url of the ticket im trying to delete is

http://vanguard-intl.unfuddle.com/api/v1/projects/25040/tickets/318689
and my php code is

$config_address = UNFUDDLE_PROJECT_ID . ’/tickets/’.$id; $config_headers[] = ‘Accept: application/xml’;

$response = connectUnfuddle('DELETE', $config_headers, $config_address, "");

the function connectUnfuddle is working fine because its used every where

 
Avatar Joshua Frappier Administrator 241 post(s)

To delete a ticket, you would HTTP DELETE from http://vanguard-intl.unfuddle.com/api/v1/projects/25040/tickets/318689. You may want to confirm that this works for your own sanity by doing this via curl, or some standard library as per the API documentation. For instance, to delete the ticket using curl, you would:

curl -u ‘username:password’ -X DELETE -H ‘Accept: application/xml’ http://vanguard-intl.unfuddle.com/api/v1/projects/25040/tickets/318689

While your code is conceptually fine, the reality is that the source of your problem most probably lives in the connectUnfuddle function. Maybe it is only doing GET and POST correctly?

 
Avatar irfanbukhari 3 post(s)

it is doing get, post and put correctly the only problem is with delete

 
Avatar Joshua Frappier Administrator 241 post(s)

Well, the deletion of tickets is working via the RESTful API. It is, however, important to note that only project (or account) administrators can delete tickets. Have you confirmed this for your own benefit using curl?

Unfortunately, without more information, specifically without being able to see your code, there is not much more I can tell you. While none of us are PHP savvy, maybe if you posted up the connectUnfuddle function one of our PHP-capable Unfuddlers could lend some insight.