SaaSquatch Help Center

Include custom information about users in your SaaSquatch Program.

The SaaSquatch platform supports the ability to accept custom information about each of the users in your SaaSquatch program.

The information stored in these fields can power a wide range of additional functionality for your SaaSquatch program including:

  • Being able to leverage SaaSquatch to store more of your customer's information rather than having to extend your CRM integration.
  • Provide information needed for running SaaSquatch Growth Automation programs.

Supported Touchpoints

Custom User Fields are currently supported through our squatch.js V2 library, iOS and Android SDKs, and when using many of our Open Endpoint API methods.

Individual methods which support these custom fields will have details about how to include them in their respective reference documents.

Key Considerations

Please be aware that there are a number of functionality considerations to keep in mind when adding/updating custom fields for your SaaSquatch users.

Custom Field Names

Considerations for choosing what to name a custom field:

Characters Custom field names can only contain unaccented letters, numbers, and underscores
Name Length Custom field names are restricted to 64 characters in length
Case Sensitivity Custom fields names are case sensitive. Fields with names like lastPurchaseDate and lastpurchasedate are treated as different fields.

Custom Field Values

Considerations for configuring the values of custom fields you will be passing to SaaSquatch:

Field Types Supported custom field value types include: string, number, boolean, and null
String Value Length Custom field values, when passed as a string, can be a maximum of 1024 characters long
Dates When pushing custom fields values to the SaaSquatch system which are intended to be recognized as dates, please make sure these are formatted as a unix timestamp in milliseconds.
Number of Fields When adding/updating custom fields for a user, a maximum of 100 fields can be added/updated in one request
Delete Fields Setting a custom field for a user to null will remove the field for that user.

Signed Requests

When adding/updating custom fields for a user in the SaaSquatch system using a method (e.g. API or squatch.js V2) where the request needs to be signed with a JWT, and not an API key, the payload of the JWT being signed needs to match the full user object being passed in (including any custom fields).

Read more about signing JWTs in our JSON Web Tokens guide.

Examples

The following examples outline how to go about adding/updating custom fields using squatch.js or our Open Endpoint API methods.

squatch.js V2

window.squatch.ready(function(){

  //configure squatch.js for the tenant you are using
  squatch.init({
    tenantAlias: 'test_bpinhag9gag'
  });

  //object containing the init parameters for squatch.js
  var initObj = {

    //the object for the user you want to upsert
    user: {                               
      id: 'abc_123',                      
      accountId: 'abc_123',       
      email: 'john@example.com',                
      firstName: 'John',       
      lastName: 'Doe',
      customFields: {
        lastPurchaseDate: 1512152525513,
        plan: 'Pro+',
        phone: 19055551234,
        address: '123 Main st., City, Province, Country, H0H0H0',
        shoeSize: 12.5,
        currency: 'CAD'
      }
    },
        jwt: 'eyJhbGciOiJIUzI1Ni.eyJ1c2VyhbWUiOiJEb2UifX0.m0Rh17-wISTLyM_NRZsGFhmNu4'
  };

  squatch.api().upsertUser(initObj).then(function(response) {
    user = response.user;
  }).catch(function(error){
    console.log(error);
  })
});

Open Endpoint API method

curl -X PUT https://app.referralsaasquatch.com/api/v1/{tenant_alias}/open/account/{accountId}/user/{userId} \
        -u :API_KEY \
        -H "Content-Type: application/json" \
        -d '{
    "id": "219065",
    "accountId": "accc9065",
    "firstName": "Bob",
    "lastName": "Testerson",
    "email": "bob@example.com",
    "customFields": {
        "lastPurchaseDate": 1512152525513,
        "plan": "Pro+",
        "phone": 19055551234,
        "address": "123 Main st., City, Province, Country, H0H0H0",
        "shoeSize": 12.5,
        "currency": "CAD"
    }
}'