Skip to content

Instantly share code, notes, and snippets.

@pawelsawicz
Created January 24, 2015 23:28
Show Gist options
  • Save pawelsawicz/bfdc42314d1e98cef2b8 to your computer and use it in GitHub Desktop.
Save pawelsawicz/bfdc42314d1e98cef2b8 to your computer and use it in GitHub Desktop.
RegisterFundraisingPage in PHP
<?php
include_once 'JustGivingClient.php';
include_once 'ApiClients/Model/RegisterPageRequest.php';
$client = new JustGivingClient("https://api-sandbox.justgiving.com/", "appId", 1,
"user", "password");
$registerPageRequest = new RegisterPageRequest();
$registerPageRequest->pageShortName = "page-short-name-02";
$registerPageRequest->pageTitle = "page title";
$registerPageRequest->charityId = 2357;
$registerPageRequest->eventId = 742990;
$registerPageRequest->targetAmount = 20;
$registerPageRequest->justGivingOptIn = true;
$registerPageRequest->charityOptIn = true;
$registerPageRequest->charityFunded = true;
$registerPageRequest->pageStory = "SomeStory";
$registerPageRequest->images[0]->url = "http://stormandshelter.com/uploads/soph.jpg";
$registerPageRequest->images[0]->caption = "SomeCapition";
$registerPageRequest->images[0]->isDefault = true;
/*$registerPageRequest->images[1]->url = "http://assets.head-fi.org/e/e4/e42e1df0_DSC02261.JPG";
$registerPageRequest->images[1]->caption = "SomeCapition";
$registerPageRequest->images[1]->isDefault = false;*/
$response = $client->Page->Create($registerPageRequest);
echo $response->pageId;
echo "\n";
echo $response->next->uri;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment