MODX and the API

Oct 25, 2013

Use Case

You have a just cause, a petition on, and you need a website. Enter MODX, the award-winning open source CMS. MODX integrates with seamlessly with the changeDotOrg Snippet, which will retrieve your petition data and display it in your MODX site.

How to Use

First and foremost, you need an API key from Don't worry, it's really easy. Just login to your account and go to this page:

Follow the on-screen instructions and you'll have an API key in no time. Then, in your MODX site, after installing the changeDotOrg Extra via the Package Manager, go to your System Settings and enter the API key in the changedotorg_api_key field.

system settings

You also need to enter the URL of your petition, in order to get your petition's data! Once those system settings are defined, call the Snippet into your content or template, like this:


By default, this will return the signature count and cache it for 2 hours. You can also get the "reasons" that signers posted, and the output is templatable. Actually almost any field from the API response data will be available as a placeholder in the &tpl Chunk. (Currently the "Signatures", "Reasons", "Updates" and "Targets" API resources are supported.) You can find out more about the API in the GitHub documentation here.

Install from the MODX Package Manager, or download from the MODX Extras repo.

Building a website to help drive support for your cause is easier, faster and better with MODX!