PactSafe

The PactSafe Developer Hub

Welcome to the PactSafe developer hub. You'll find comprehensive guides and documentation to help you start working with PactSafe as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    Guides

Integrating PactSafe without PS.js

In order to send acceptance of contracts completely server-side, you can simply set up 2 API calls with PactSafe to:

  1. Get the latest published Version IDs for the Group you're going to be loading on the page.
  2. Send acceptance of those Contract Versions after a user accepts them as part of a registration or login flow in your app.

What you need to get started

  • You should have familiarity with the Activity API (or read associated documents referenced in this how-to.
  • A working registration flow including a processing back-end in which to send acceptance of terms as part of a login or registration for your app.
  • A published Group in PactSafe's dashboard (which will require public, published Contracts)
Here's an example flow for how you'll interact with the PactSafe API to process acceptance. This flow includes use of PS.js to actually load the checkbox and links to the agreements being accepted via click-through.

Here's an example flow for how you'll interact with the PactSafe API to process acceptance. This flow includes use of PS.js to actually load the checkbox and links to the agreements being accepted via click-through.

Details & code samples on the Activity API

More details and code samples for interacting with the Activity API can be found in our Reference here.

1. Get the latest published Version IDs for your Group

After creating your Group in PactSafe, you'll have a group key that you can reference when making a call to PactSafe. This call will give you back the Contract IDs and Version IDs associated with the Contracts you need your users to accept when creating an account.

After making your HTTP GET to https://pactsafe.io/published?... (as specific here), you'll receive the following results:

{
    "282":  "592491db0a8eb8133e7a3c5b",
    "1241": "592494670a8eb8133e7a3c67"
}

You can then save those values in your form and pass them to the next page for processing acceptance after your user submits their form. We'd recommend saving contract IDs and version IDs as respective hidden <input> fields on your page:

...
<input type="hidden" name="_ps_contracts" value="282,1241" />
<input type="hidden" name="_ps_versions" value="592491db0a8eb8133e7a3c5b,592494670a8eb8133e7a3c67" />
...

2. Send acceptance of those Contract Versions after a user accepts them

Once your user submits the form, you can then send acceptance of those contracts & versions through the Activity API. By calling an HTTP GET (or POST) to https://pactsafe.io/send (as specified here). The response to this call will be a 1x1 web beacon, and is handled asynchronousely in PactSafe.

Additional values you can pass

There are some required parameters to pass, but you can also pass additional parameters to reinforce the acceptance record. Below are some additional URL parameters to the /send call that you can pass to track things like User Agent and IP Address:

  • IP Address: addr=192.0.0.1
  • Operating System: os=MacOS
  • Environment: env=desktop
  • Screen Color Depth: scd=24-bit
  • Screen Resolution: res=1280x800
  • Browser Locale: bl=en-us
  • Browser Time Zone: btz=5
  • Page Encoding: pae=UTF-8
  • Page Path: pap=/saas/app/register.html
  • Page Domain: pad=neighborino.co
  • Page URL: pau=https://neighborino.co/saas/app/register.html
  • Page Title: pat=Angle - Bootstrap Admin Template

What's Next

Learn more about the specifics behind our Activity API!

What is the Activity API?
Activity API Docs