{"id":18494029,"url":"https://github.com/matthewpoer/php-cvent-wrapper","last_synced_at":"2025-07-31T06:33:20.562Z","repository":{"id":33024469,"uuid":"150161952","full_name":"matthewpoer/php-cvent-wrapper","owner":"matthewpoer","description":"A PHP wrapper for some common Cvent SOAP API functions","archived":false,"fork":false,"pushed_at":"2022-01-30T13:43:06.000Z","size":27,"stargazers_count":3,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-13T02:08:01.339Z","etag":null,"topics":["api","cvent","php","php-wrapper","soap"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"wtfpl","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matthewpoer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-24T20:08:02.000Z","updated_at":"2024-04-23T07:07:47.000Z","dependencies_parsed_at":"2022-08-07T19:30:25.455Z","dependency_job_id":null,"html_url":"https://github.com/matthewpoer/php-cvent-wrapper","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/matthewpoer/php-cvent-wrapper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthewpoer%2Fphp-cvent-wrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthewpoer%2Fphp-cvent-wrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthewpoer%2Fphp-cvent-wrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthewpoer%2Fphp-cvent-wrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matthewpoer","download_url":"https://codeload.github.com/matthewpoer/php-cvent-wrapper/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthewpoer%2Fphp-cvent-wrapper/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267997967,"owners_count":24178422,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-31T02:00:08.723Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","cvent","php","php-wrapper","soap"],"created_at":"2024-11-06T13:17:33.893Z","updated_at":"2025-07-31T06:33:20.501Z","avatar_url":"https://github.com/matthewpoer.png","language":"PHP","readme":"# php-cvent-wrapper\nThe [Cvent SOAP API](https://developers.cvent.com/documentation/soap-api/) offers the ability to read Event data and perform CRUD operations against many Person-style objects. This wrapper should simplify the Login, Search and Retrieve operations for read-only access to the system.\n\n## Composer Install\n\n```\ncomposer require matthewpoer/php-cvent-wrapper:dev-master\n```\n\n## Sandbox or Production?\nBy default, this wrapper will access the Production Cvent API, but setting the `$sandbox` param. on invocation of the class will send your calls to the Sandbox API instead, e.g.\n\n```\n// Production\n$wrapper = new php_cvent_wrapper();\n\n// Sandbox\n$wrapper = new php_cvent_wrapper(TRUE);\n```\n\n## Authentication Notes\nAccessing the Cvent API, both for Sandbox and Production accounts, requires an Account Number, Username and Password for an API Account, which are treated differently by Cvent than typical user accounts. One must also configure Cvent to whitelist incoming API requests' IP addresses as an additional security measure. See Cvent's notes on [Login Basic Steps](https://developers.cvent.com/documentation/soap-api/call-definitions/authentication/login/).\n\n## Shoutouts\nPortions of this code were inspired by [php-cvent](https://github.com/gcanivet/php-cvent).\n\n## Sample Code\n\n### Authorization\n```\n\u003c?php\nrequire_once('config.php');\nrequire_once('vendor/autoload.php');\n\n// Authorization\n$php_cvent_wrapper = new php_cvent_wrapper(TRUE);\ntry {\n  $result = $php_cvent_wrapper-\u003elogin(\n    CVENT_ACCOUNT_NUMBER,\n    CVENT_USERNAME,\n    CVENT_PASSWORD\n  );\n  if(!$result) {\n    die('Cvent authentication failed for an unknown reason' . PHP_EOL);\n  }\n} catch (\\CventAuthorizationFailureException | \\CventAuthorizationLockoutException $e) {\n  echo 'Cvent Auth Error: ' . $e-\u003egetMessage();\n  die();\n} catch (\\Exception $e) {\n  echo 'Failed to authenticate with Cvent' . PHP_EOL;\n  echo $e-\u003egetMessage();\n  die();\n}\n\necho \"Authentication was successful.\" . PHP_EOL;\n```\n\n### Get a List of Fields for an Object\n```\ntry {\n  $fields = $php_cvent_wrapper-\u003edescribe_object_fields('Registration');\n} catch (\\Exception $e) {\n  echo 'Failed to get fields list' . PHP_EOL;\n  echo $e-\u003egetMessage();\n  die();\n}\n```\n\n### Filtered Search\n```\ntry {\n  $users = $php_cvent_wrapper-\u003esearch(\n    'User',\n    array(\n      (object)array(\n        'Field' =\u003e 'UserRole',\n        'Operator' =\u003e 'Equals',\n        'Value' =\u003e 'Administrators',\n      )\n    )\n  );\n  echo \"Here's a list of all of the User IDs for Administrators:\" . PHP_EOL;\n  foreach ($users as $user_id) {\n    echo 'User ID is ' . $user_id . PHP_EOL;\n  }\n} catch (\\Exception $e) {\n  echo 'Failed to search for a list of Administrators' . PHP_EOL;\n  echo $e-\u003egetMessage();\n  die();\n}\n```\n\n#### Search Without Filters\nThe same search method can be used with no filters as well, e.g. to get a list of all known Speakers:\n```\ntry {\n  $speakers = $php_cvent_wrapper-\u003esearch('Speaker');\n  echo \"Here's a list of all of the Speaker IDs:\" . PHP_EOL;\n  foreach ($speakers as $speaker_id) {\n    echo 'Speaker ID is ' . $speaker_id . PHP_EOL;\n  }\n} catch (\\Exception $e) {\n  echo 'Failed to search for a list of Speakers' . PHP_EOL;\n  echo $e-\u003egetMessage();\n  die();\n}\n```\n\n### Retrieve\n```\ntry {\n  $user_data = $php_cvent_wrapper-\u003eretrieve(\n    'User',\n    $users,\n    array(\n      'Email',\n      'Id',\n      'UserType',\n      'UserRole',\n    )\n  );\n  foreach($user_data as $user_info) {\n    echo 'The email address for user ' . $user_info['Id'] . ' is ' . $user_info['Email'] . PHP_EOL;\n  }\n} catch (\\Exception $e) {\n  echo 'Failed to retrieve user data for our list of Administrators' . PHP_EOL;\n  echo $e-\u003egetMessage();\n  die();\n}\n```\n\n### Search and Retrieve in a Single Call\n```\ntry {\n  $events = $php_cvent_wrapper-\u003esearch_and_retrieve(\n    'Event',\n    array(\n      (object)array(\n        'Field' =\u003e 'EventStartDate',\n        'Operator' =\u003e 'Greater than',\n        'Value' =\u003e date('Y-m-d\\TH:m:s'),\n      )\n    ),\n    array(\n      'EventCode',\n      'EventStartDate',\n      'EventTitle',\n      'Id',\n    )\n  );\n  foreach($events as $event) {\n    echo 'Event ' . $event['EventTitle'] . ' will begin on ' . $event['EventStartDate'] . PHP_EOL;\n  }\n} catch (\\Exception $e) {\n  echo 'Failed to search and retrieve info. for future events' . PHP_EOL;\n  echo $e-\u003egetMessage();\n  die();\n}\n```\n\n### Search using Includes (i.e. multiple values)\nThe following will find a list of Active and Completed events that have been\nmodified in the past week. Notice that the filter uses `ValueArray` instead of\njust `Value`.\n```\ntry {\n  $events = $php_cvent_wrapper-\u003esearch_and_retrieve(\n    'Event',\n    array(\n      (object)array(\n        'Field' =\u003e 'LastModifiedDate',\n        'Operator' =\u003e 'Greater than',\n        'Value' =\u003e date('Y-m-d\\TH:m:s', strtotime('-1 week')),\n      ),\n      (object)array(\n        'Field' =\u003e 'EventStatus',\n        'Operator' =\u003e 'Includes',\n        'ValueArray' =\u003e array(\n          'Active',\n          'Completed',\n        )\n      ),\n    ),\n    array(\n      'EventCode',\n      'EventStartDate',\n      'EventTitle',\n      'Id',\n    )\n  );\n  foreach($events as $event) {\n    echo 'Event ' . $event['EventTitle'] . ' will begin on ' . $event['EventStartDate'] . PHP_EOL;\n  }\n} catch (\\Exception $e) {\n  echo 'Failed to search and retrieve info. for recently modified active and completed events' . PHP_EOL;\n  echo $e-\u003egetMessage();\n  die();\n}\n```\n\n### Registration Questions\nRegistration Questions are stored as objects within the Registration object, and so these can be \"flattened\" out into a single field and/or converted to an array for more granular processing. Note that the 5th param. in `search_and_retrieve()` sets the 4th param. in `search()`, which is the `$always_flat` flag. It defaults to TRUE (assuming that most of the time one would not want an array in the otherwise-flat record data), but when set to FALSE registration data is returned as an array.\n```\n// `$always_flat` is the 4th param in retrieve\n$registrations = $php_cvent_wrapper-\u003eretrieve(\n  'Registration',\n  $Ids,\n  $Fields,\n  FALSE\n);\n\n// `$always_flat` is the 5th param in search_and_retrieve\n$registrations = $php_cvent_wrapper-\u003esearch_and_retrieve(\n  'Registration',\n  $Filters,\n  $Fields,\n  'AndSearch'\n  FALSE\n);\n```\n\nThe returned data will include the Answer as text regardless of whether `$always_flat` is true or false, so dumping the `$registration['Answer']` as below will give the following output:\n\n```\n$registration = current(registrations);\nvar_dump($registration['Answer']);\n/*\nstring(204) \"Question:\nHere is an example event question (001)\nResponse:\nHere is a response to the question (001)\n\nQuestion:\nHere is an another example event question (002)\nResponse:\nAnd here is another response (002)\"\n*/\n```\n\nBut if `$always_flat` is set to false, you can dump an additional array for potentially easier question separation:\n\n```\n$registration = current(registrations);\nvar_dump($registration['Answer Array']);\n/*\narray(2) {\n  [\"Here is an example event question (001)\"]=\u003e\n  string(40) \"Here is a response to the question (001)\"\n  [\"Here is an another example event question (002)\"]=\u003e\n  string(47) \"Here is an another example event question (002)\"\n}\n*/\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthewpoer%2Fphp-cvent-wrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatthewpoer%2Fphp-cvent-wrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthewpoer%2Fphp-cvent-wrapper/lists"}