Hi,
I updated the example PHP script.
here is the snippet I inserted that should give you the idea (the team
acts similarily to memory).
Derek
--------
//CREATE NEW MEME (JSON format)
$memeForm = "{\"meme\":{\"name\":\"JSON example 5\",\"description\":
\"sample meme as JSON\",\"longDescription\":\"this is a very simple
meme created with JSON\",\"categoryID\":\"test\",\"scope\":\"public
\"}}";
$createMemeURL = $url_base . 'meme/create'.'?sessionID='.$sessionID;
print "Create meme URL: " . $createMemeURL;
$session = curl_init($createMemeURL);
// Set the POST options.
curl_setopt ($session, CURLOPT_POST, true);
curl_setopt ($session, CURLOPT_POSTFIELDS, $memeForm);
curl_setopt($session, CURLOPT_HEADER, true);
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
$response = execute($session);
curl_close($session);
$responseBody = $response['body'];
print "Response code: " . $response['http_code'] ."\n";
print $responseBody ."\n";
// ADD the newly created into memory
$jsonResponse = json_decode($responseBody,true);
$createdMemeUMIS = $jsonResponse['status']['responseObject']['umis'];
$addToMemoryURL = $url_base . 'memory/'. $createdMemeUMIS . '?
sessionID='.$sessionID;
print "adding to memory : " . $addToMemoryURL;
// Get the curl session object
$session = curl_init($addToMemoryURL);
curl_setopt ($session, CURLOPT_PUT, true);
curl_setopt($session, CURLOPT_HEADER, true);
curl_setopt ($session, CURLOPT_POSTFIELDS, $createdMemeUMIS);
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
// USE CUSTOM EXEC
$response = execute($session);
curl_close($session);
$responseBody = $response['body'];
print "Response code: " . $response['http_code'] ."\n";
print $responseBody ."\n";
//SHOW MEMORY
$memoryURL = $url_base . "memory?sessionID=".$sessionID;
print "MEMORY request: " . $memoryURL;
// Get the curl session object
$session = curl_init($memoryURL);
curl_setopt ($session, CURLOPT_HTTPGET, true);
curl_setopt($session, CURLOPT_HEADER, true);
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
// USE CUSTOM EXEC
$response = execute($session);
curl_close($session);
$responseBody = $response['body'];
print "Response code: " . $response['http_code'] ."\n";
print $responseBody ."\n";