Created
January 9, 2013 23:57
-
-
Save brianr/4498144 to your computer and use it in GitHub Desktop.
Ratchet.io API example: resolving an item through the API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// needs to have the 'write' scope. see the Security tab on the project settings page. | |
$access_token = 'access-token-here'; | |
$item_id = 12345; | |
// acceptable values: 'resolved', 'active', 'muted' | |
$new_status = 'resolved'; | |
$url = 'https://submit.ratchet.io/api/1/item/' . $item_id . '?access_token=' . $access_token; | |
$ch = curl_init($url); | |
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PATCH'); | |
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"status": "' . $new_status . '"}'); | |
$response = curl_exec($ch); | |
echo $response; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment