Example #1
0
 public static function deleteAll($headers = null)
 {
     if (!$headers) {
         $headers = Rapid::getAuthHeader();
     }
     $response = Request::delete(Rapid::getUrl(self::$route), $headers);
     return Response::make($response);
 }
Example #2
0
 public static function post($body = null, $headers = null)
 {
     if (!$headers) {
         $headers = Rapid::getAuthHeader();
     }
     $response = Request::post(Rapid::getUrl(self::$route), $headers, http_build_query($body));
     return Response::make($response);
 }
Example #3
0
<?php

require_once '../vendor/autoload.php';
require_once '../src/Rapid/Photos.php';
require_once '../src/Rapid/Rapid.php';
require_once '../src/Rapid/Response.php';
use Rapid\Rapid;
use Rapid\Photos;
Rapid::init("5b107695161b40780be8e1d3e4c17da4c8820244");
////GET ALL ALBUMS
//echo "<h3>GET ALL ALBUMS</h3>";
//$response = Photos::getAlbums();
//print_r($response->headers());
//
//echo "<br/>";
//
//echo $response->paginate();
//
//foreach ($response->data() as $response) {
//    echo "<hr/>";
//    echo $response->_id . "<br/>";
//    echo $response->title . "<br/>";
//    echo "<hr/>";
//}
////GET ALL BY ALBUM
//echo "<h3>GET ALL By Album Example</h3>";
//$response = Photos::getAllByAlbum("first-album");
//print_r($response->headers());
//
//echo "<br/>";
//
Example #4
0
<?php

require_once '../vendor/autoload.php';
require_once '../src/Rapid/News.php';
require_once '../src/Rapid/Rapid.php';
require_once '../src/Rapid/Response.php';
use Rapid\Rapid;
use Rapid\News;
Rapid::init("c09488fe9421b97eff3cbfeaa553db8f034777bb");
////GET ALL CATEGORIES
//echo "<h3>GET ALL CATEGORIES</h3>";
//$response = News::getCategories();
//print_r($response->headers());
//
//echo "<br/>";
//
//echo $response->paginate();
//
//foreach ($response->data() as $response) {
//    echo "<hr/>";
//    echo $response->_id . "<br/>";
//    echo $response->title . "<br/>";
//    echo "<hr/>";
//}
//GET ALL BY CATEGORY
echo "<h3>GET ALL By Category Example</h3>";
$response = News::getAllByCategory("test-1", ['test' => 'in:xxxtt,dede', 'title' => 'my fourth poST']);
print_r($response->headers());
echo "<br/>";
echo $response->paginate();
foreach ($response->data() as $response) {
Example #5
0
<?php

require_once '../vendor/autoload.php';
require_once '../src/Rapid/Rapid.php';
require_once '../src/Rapid/Response.php';
use Rapid\Rapid;
Rapid::init("c09488fe9421b97eff3cbfeaa553db8f034777bb");
//LOGIN
echo "<h3>LOGIN Example</h3>";
$response = Rapid::login('radiegtya-ciptaraya', 'admin', 'admin');
print_r($response);
Example #6
0
//
//foreach ($response->data() as $response) {
//    echo "<hr/>";
//    echo $response->_id . "<br/>";
//    echo $response->title . "<br/>";
//    echo $response->text . "<br/>";
//    echo "<hr/>";
//}
////GET
//echo "<h3>GET Example with id te</h3>";
//$id = "te";
//$response = Texts::get($id);
//echo $response->data()->title;
//POST
echo "<h3>POST Example </h3>";
$body = ['title' => 'My Fourth Post', 'text' => 'My Fourth Post', 'slug' => 'my-fourth-post', 'createdUserId' => Rapid::getUserId()];
$response = Texts::post($body);
print_r($response->status());
////PUT
//echo "<h3>PUT Example</h3>";
//$id = "eE5HShXGG6cCGc3hT";
//$body = [
//    'title' => 'My Fifth Post',
//    'slug' => 'my-fifth-post'
//];
//$response = Texts::put($id, $body);
//print_r($response);
////DELETE
//echo "<h3>DELETE Example</h3>";
//$id = "eE5HShXGG6cCGc3hT";
//$response = Texts::delete($id);
Example #7
0
<?php

require_once '../vendor/autoload.php';
require_once '../src/Rapid/Rapid.php';
require_once '../src/Rapid/Response.php';
use Rapid\Rapid;
Rapid::init("c09488fe9421b97eff3cbfeaa553db8f034777bb");
//LOGOUT
echo "<h3>LOGOUT Example</h3>";
$response = Rapid::logout();
print_r($response);
 public static function getAllByCatalog($catalogIdOrSlug, $params = null, $headers = null)
 {
     $response = Request::get(Rapid::getUrl(self::$belongsToRouteCatalogs . '/' . $catalogIdOrSlug . '/' . self::$route), $headers, $params);
     return Response::make($response);
 }
Example #9
0
 public static function postByOther($otherIdOrSlug, $body = null, $headers = null)
 {
     $response = Request::post(Rapid::getUrl(self::$belongsToRouteOthers . '/' . $otherIdOrSlug . '/' . self::$route), $headers, http_build_query($body));
     return Response::make($response);
 }
Example #10
0
 public static function getAll($params = null, $headers = null)
 {
     $response = Request::get(Rapid::getUrl(self::$route), $headers, $params);
     return Response::make($response);
 }