diff --git a/src/snapchat.php b/src/snapchat.php index fe64534..92c58cc 100755 --- a/src/snapchat.php +++ b/src/snapchat.php @@ -939,8 +939,8 @@ public function send($media_id, $recipients, $time = 3) { * @param int $time * The time in seconds the story should be available (1-10). Defaults to 3. * - * @return bool - * TRUE if successful, FALSE otherwise. + * @return mixed + * The story data or FALSE on failure. */ public function setStory($media_id, $media_type, $time = 3) { // Make sure we're logged in and have a valid access token. @@ -965,7 +965,7 @@ public function setStory($media_id, $media_type, $time = 3) { ) ); - return is_null($result); + return $result; } /** diff --git a/src/snapchat_agent.php b/src/snapchat_agent.php index 1dc22a9..c8027e9 100644 --- a/src/snapchat_agent.php +++ b/src/snapchat_agent.php @@ -309,7 +309,7 @@ public function post($endpoint, $data, $params, $multipart = FALSE) { // If the cURL request fails, return FALSE. Also check the status code // since the API generally won't return friendly errors. - if ($result === FALSE || curl_getinfo($ch, CURLINFO_HTTP_CODE) != 200) { + if ($result === FALSE || (curl_getinfo($ch, CURLINFO_HTTP_CODE) != 200 && curl_getinfo($ch, CURLINFO_HTTP_CODE) != 202)) { curl_close($ch); return FALSE; }