epicformbuilder / wixhive-php-api
WixHive API PHP Library
0.0.9
2023-08-24 13:24 UTC
Requires
- php: >=8.1.0
- guzzlehttp/guzzle: 7.7.0
Requires (Dev)
- phake/phake: 2.0.*@dev
- phpcompatibility/php-compatibility: ^9.3
- phpunit/phpunit: 4.2.6
This package is not auto-updated.
Last update: 2024-10-31 19:50:52 UTC
README
This library is a PHP wrapper WixHive API.
Usage
// create WixHive object $wixHive = new WixHive("{app_id}", "{app_secret_key}"); // generate data for activity $field = new \stdClass(); $field->name = "Name"; $field->value = "Value"; $activityInfo = new \stdClass(); $activityInfo->fields = [$field]; // create the model $createActivity = new CreateActivity( new DateTime(), ActivityType::CONTACT_CONTACT_FORM, null, null, $activityInfo, ); // create the command to execute $command = new CreateContactActivity($createActivity); try{ /** @var ActivityResult $data */ $data = $wixHive->execute($command, "{instance_id}" $userSessionToken); // <-- $userSessionToken comes from Wix JS SDK }catch (WixHiveException $e){ // catch an error here print_r($e->getMessage()); } // check what we got print_r($data); exit;
WixHive documentation live here