Skip to content

MonkDev/sccrm-api-php

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 

Repository files navigation

SimpleChurchCRM PHP API Wrapper

Currently, this does not support all of the functions of the API. If you add to it, please submit a pull request.

Usage

Authenticate

<?php

require 'SimpleChurchAPI.php'

$sccrm = new SimpleChurchAPI([
   'sessionId' => 'Your session ID', //Optional. You can generate one from the API documentation page, 
   'subDomain' => 'mychurch', //Required. the subdomain of simplechurchcrm.com that points to your account.
]);

?>

If you don't have a sessionId, you can get one by the following:

$sccrm->login('Username', 'Password'); //This will return some info about the user, but it also sets the sessionId

Create a Person

$person = $sccrm->createPerson([
   'phoneWork' => '123-345-6789',
   'mail' => '[email protected]',
   'fname' => 'Frank', //Is only required field.
   'lname' => 'Jones',
   'date2' => date('Y-m-d'),
   'text4' => 'Visitor',
   'notifyAdmin' => 1,
]);

Any and all of the fields that are documented can be passed in here, including custom fields you have created (date2 and text4 in this example). You will get back a person object, which will have a uid - the unique person id. We'll use that below.

Put a Person In A Group

$sccrm->addPersonToGroup($person->uid, 2); //2 is the ID of the group we're adding the new person to.

Assign an Interaction

$sccrm->assignInteraction([
   'instructions' => 'Please follow up with the person. They just registed on the website.',
   'assignedUid' => 261, //Uid of Person to complete the interaction
   'uid' => $person->uid,
   'aid' => 4, //Type of interaction
   'dateCompleteBy' => date('Y-m-d', strtotime('+7 days')),
]);

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%