Skip to content

Instantly share code, notes, and snippets.

@brianr
Created January 9, 2013 23:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brianr/4498144 to your computer and use it in GitHub Desktop.
Save brianr/4498144 to your computer and use it in GitHub Desktop.
Ratchet.io API example: resolving an item through the API
<?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