DailyCred

Introduction

This is the detailed documentation for the DailyCred API. Customers using Connect.js will not need this level of detail and should look here for deployment details.

Sign up

Use this call to sign up new users using an email, password and optionally a username. Never transmit a password over an unencrypted connection. Instead use SSL or use Connect.js. This call returns an access_token. Your app may store access tokens for future api calls. Access tokens do not expire.

Endpoint

POST https://www.dailycred.com/user/api/signup.json

Arguments

client_id:
required Your client_id available here.
email:
required The new user's email. Note that emails are validated.
pass:
required The new user's password. (To create a user without a password use the email-only call.)
username:
optional A new user's username. This is required if your app has usernames turned on.
referrer:
optional This optional parameter provides a way to keep track of what page the user was on when they signed in. This will be passed back as a 'referrer' parameter after the user signs in.

Example Request


curl https://www.dailycred.com/user/api/signup.json \
  -d 'client_id=dailycred' \
  -d 'email=email@example.com' \
  -d 'pass=password' \
  -X POST

Example Response


{
  "worked": true,
  "access_token": "...",
  "user": {
    [user object]
  },
  "redirect": "https://www.dailycred.com/signup/callback/dc?code=..."
}

Error Response


{
  "worked": false,
  "errors": [
    {
      "message": "Please enter your email.",
      "attribute": "email"
    }
  ]
}

Sign in

Use this call to sign in existing users using a login and password. Login can be an email or a username (if enabled in your app's settings). Never transmit a password over an unencrypted connection. Instead use SSL or use Connect.js. This call returns an access_token. Your app may store access tokens for future api calls. Access tokens do not expire.

Endpoint

POST https://www.dailycred.com/user/api/signin.json

Arguments

client_id:
required Your client_id available here.
login:
required The user's login (email or username).
pass:
required The user's password.
referrer:
optional This optional parameter provides a way to keep track of what page the user was on when they signed in. This will be passed back as a 'referrer' parameter after the user signs in.

Example Request


curl https://www.dailycred.com/user/api/signin.json \
  -d 'client_id=dailycred' \
  -d 'login=email@example.com' \
  -d 'pass=password' \
  -X POST

Example Response


{
  "worked": true,
  "access_token": "...",
  "user": {
    [user object]
  },
  "redirect": "https://www.dailycred.com/signup/callback/dc?code=..."
}

Error Response


{
  "worked": false,
  "errors": [
    {
      "message": "Please check your username and password and try again.",
      "attribute": "form"
    }
  ]
}

Sign up (email only)

Use this call to create a user with only an email. This is useful when creating newsletter lists or simple sign-up flows. A user can add full authentication later using either 1) the password reset flow 2) by connecting with an OAuth provider with the same email or 3) using the Add Email & Password call. This call returns an access_token. Your app may store access tokens for future api calls. Access tokens do not expire.

Endpoint

POST https://www.dailycred.com/admin/api/email

Arguments

client_id:
required Your client_id available here.
email:
required The new user's email. Note that emails are validated.

Example Request


curl https://www.dailycred.com/admin/api/email \
  -d 'client_id=dailycred' \
  -d 'email=email@example.com' \
  -X POST

Example Response


{
  "worked": true,
  "access_token": "...",
  "user": {
    [user object]
  },
  "redirect": "https://www.dailycred.com/signup/callback/dc?code=..."
}

Error Response


{
  "worked": false,
  "error": "Please check that your email was entered correctly and try again."
}

Add Email & Password

Use this call to add an email and password to a user that previously signed up using an OAuth identity provider. (For example, a user that signed up using Facebook and now needs to add an email and password to the same user record.)

Endpoint

POST https://www.dailycred.com/user/api/signup.json

Arguments

client_id:
required Your client_id available here.
access_token:
required The user's access token.
email:
required The user's email. Note that emails are validated.
pass:
required The user's password.
username:
optional A user's username. This is required if your app has usernames turned on.

Example Request


curl https://www.dailycred.com/user/api/signup.json \
  -d 'client_id=dailycred' \
  -d 'access_token=...' \
  -d 'email=email@example.com' \
  -d 'pass=password' \
  -X POST

Example Response


{
  "worked": true,
  "access_token": "...",
  "user": {
    [user object]
  },
  "redirect": "https://www.dailycred.com/signup/callback/dc?code=..."
}

Error Response


{
  "worked": false,
  "error": "Please check that your email was entered correctly and try again."
}

OAuth Authenticate

Send the user to /connect. The user will be forwarded to the appropriate OAuth dialog to authenticate. Then the user will be returned to your website or app with an access_token or access_token that can be exchanged for user information using the Retrieve a User call. Your app may store access tokens for future api calls. Access tokens do not expire.

Endpoint

LINK https://www.dailycred.com/connect

Arguments

client_id:
required Your client_id available here.
identity_provider:
required The desired social network your user to authenticate with. If no identity_provider parameter is provided, it will default to email and password authentication. You can also set identity_provider to gateway to use our UI to let the user choose who to sign in with.
redirect_uri:
optional After authentication, the user will be redirected to this url. The url must be within one of your approved domains in your account settings. If omitted we will use your account default callback.
referrer:
optional This optional parameter provides a way to keep track of what page the user was on when they signed in. This will be passed back as a 'referrer' parameter after the user signs in.
state:
optional You can include a state parameter to help prevent cross-site request forgery. When your user is redirected back to your site after authenticating, the state parameter will be included.

Example


link to https://www.dailycred.com/connect
?client_id=dailycred
&identity_provider=facebook

Example Response


the user will be sent to your callback with a code:
https://example.com/callback
?code=...
&expires_in=2592000

Error Response


the user will be sent to your callback with an error message:
https://example.com/callback
?error=access_denied
&error_description=The%2Buser%2Bdenied%2Byour%2Brequest.

Exchange Code for Access Token

If you are using the client-side OAuth flow, your app will receive a code rather than an access_token for security reasons. Use this call to exchange a code for an access_token. Your app may store access tokens for future api calls. Access tokens do not expire.

Endpoint

POST https://www.dailycred.com/oauth/access_token

Arguments

code:
required The code you recieved in step 3 of the authentication flow.
client_secret:
required Your client_secret available here. Never pass your client_secret over an unencrypted connection.

Example


curl https://www.dailycred.com/oauth/access_token \
  -d 'code=...' \
  -d 'client_secret=...' \
  -X POST

Example Response


{
  "worked": true,
  "access_token": "..."
}

Error Response


{
  "worked": false,
  "error": {
    "message": "The authorization code is invalid.",
    "code": 400,
    "type": "invalid_grant"
  }
}

Add OAuth Identity

Use this call to add a new OAuth identity to an existing user. An existing user can be email only, email and password, or another identity provider. For example: this call can be used to add a Twitter identity to a Facebook user account, or to add a Facebook identity to an existing email and password user account.

Endpoint

LINK https://www.dailycred.com/connect

Arguments

client_id:
required Your client_id available here.
access_token:
required The user's access token.
identity_provider:
required The desired social network your user to authenticate with. If no identity_provider parameter is provided, it will default to email and password authentication. You can also set identity_provider to gateway to use our UI to let the user choose who to sign in with.
redirect_uri:
optional After authentication, the user will be redirected to this url. The url must be within one of your approved domains in your account settings. If omitted we will use your account default callback.
state:
optional You can include a state parameter to help prevent cross-site request forgery. When your user is redirected back to your site after authenticating, the state parameter will be included.

Example


link to https://www.dailycred.com/connect
?client_id=dailycred
&identity_provider=facebook
&access_token=...

Example Response


the user will be sent to your callback with a code:
https://example.com/callback
?code=...
&expires_in=2592000

Error Response


the user will be sent to your callback with an error message:
https://example.com/callback
?error=access_denied
&error_description=The%2Buser%2Bdenied%2Byour%2Brequest.

Reset Password

Use this call to send a password reset email to a user. This call is the easiest way to reset a password. If you would like to create your own customized flow instead you can use reset token to create a reset token and password change to update a password with the provided token.

Endpoint

POST https://www.dailycred.com/password/api/reset

Arguments

client_id:
required Your client_id available here.
user:
required (unless user_id provided) The user's email (or username).
user_id:
required (unless user provided) The user's user_id.
valid_for:
optional (defaults to 24 hours) The number of hours before a password reset token will expire. Defaults to 24 hours from reset request. Integers between 1 (1 hour) and 720 (30 days) are accepted. Other values will be ignored and the default 24 hours will be used. Note that shorter lengths are more secure but may inconvenience users.
reset_uri:
optional Use this parameter if you wish to provide your own user interface for a user to reset their password. If provided, the email we send to your user will include the specified url with two parameters attached (reset_id and user_id). You can use these parameters to then change the user's password via the change password api.

Example


curl https://www.dailycred.com/password/api/reset \
  -d 'client_id=dailycred' \
  -d 'user=email@example.com' \
  -X POST

Example Response


{
  "worked": true,
  "message": "An email has been sent.  Please check your email for further instructions."
}

Error Response


{
  "worked": false,
  "errors": [
    {
      "message": "Please enter your email.",
      "attribute": "form"
    }
  ]
}

Change Password with Reset Token

Use this call to use a reset token to set a user's password. A token is consumed when a password is successfully set. Reset tokens can only be used once and must be used before their expiration date.

Endpoint

POST https://www.dailycred.com/password/api/change

Arguments

reset_id:
required The reset_id provided from a password reset call.
pass_new:
required The user's new password.

Example


curl https://www.dailycred.com/password/api/change \
  -d 'reset_id=...' \
  -d 'pass_new=password' \
  -X POST

Example Response


{
  "worked": true,
  "user_id": "..."
}

Error Response


{
  "worked": false,
  "errors": [
    {
      "message": "Please enter your password.",
      "attribute": "pass_new"
    }
  ]
}

Change Password with Current Password

Use this call to provide the user with the ability to change their password. This call requires the user to know their current password. If the user does not know their password, they should use the password reset flow instead.

Endpoint

POST https://www.dailycred.com/password/api/change

Arguments

user_id:
required The user's user_id.
pass_curr:
required The user's current password.
pass_new:
required The user's new password.

Example


curl https://www.dailycred.com/password/api/change \
  -d 'user_id=...' \
  --data-urlencode 'pass_curr=Current Password 123' \
  --data-urlencode 'pass_new=New Password 456' \
  -X POST

Example Response


{
  "worked": true,
  "user_id": "..."
}

Error Response


{
  "worked": false,
  "errors": [
    {
      "message": "Please enter your password.",
      "attribute": "pass_new"
    }
  ]
}

Reset Token

Use this call to generate a password reset token. The password reset token is returned via this call and is not emailed to the user. To email a password reset email to the user, use reset password

Endpoint

POST https://www.dailycred.com/admin/api/user/passwordreset.json

Arguments

client_id:
required Your client_id available here.
client_secret:
required Your client_secret available here. Never pass your client_secret over an unencrypted connection.
user_id:
required The user's user_id.

Example


curl https://www.dailycred.com/admin/api/user/passwordreset.json \
  -d 'client_id=dailycred' \
  -d 'client_secret=...' \
  -d 'user_id=...' \
  -X POST

Example Response


{
  "worked": true,
  "reset_token": "..."
}

Error Response


{
  "worked": false,
  "error": {
    "message": "No user exists for id 1234.",
    "code": 5
  }
}

Reset Token by Email

Use this call to generate a password reset token. The password reset token is returned via this call and is not emailed to the user. To email a password reset email to the user, use reset password

Endpoint

POST https://www.dailycred.com/admin/api/user/passwordreset.json

Arguments

client_id:
required Your client_id available here.
client_secret:
required Your client_secret available here. Never pass your client_secret over an unencrypted connection.
email:
required The user's email.

Example


curl https://www.dailycred.com/admin/api/user/passwordreset.json \
  -d 'client_id=dailycred' \
  -d 'client_secret=...' \
  -d 'email=email@example.com' \
  -X POST

Example Response


{
  "worked": true,
  "reset_token": "..."
}

Error Response


{
  "worked": false,
  "error": {
    "message": "No user exists for email@example.com.",
    "code": 5
  }
}

Retrieve a User by Access Token

Use this call to exchange an access token for user information. Access tokens can be retreived from any sign in or sign up flow. Your app may store access tokens for future api calls. Access tokens do not expire.

Endpoint

POST https://www.dailycred.com/graph/me.json

Arguments

access_token:
required The user's access token.

Example Request


curl https://www.dailycred.com/graph/me.json \
  -d 'access_token=...' \
  -X POST

Example Response


{
  "email": "email@example.com",
  "id": "...",
  "birthday": "1980-09-28",
  "facebook_username": "fbusername",
  "location": "Seattle, Washington",
  "active_apps": [
    ...
  ],
  "ips": [
    "192.168.0.1"
  ],
  "locale": "en_US",
  "subscribed": true,
  "created": 1350090365743,
  "last_logged_in": 1427171784719,
  "verified": true,
  "name": "John Q. Public",
  "gender": "male",
  "identities": {
    "google": {
      ...
    },
    "facebook": {
      ...
    },
    "github": {
      ...
    }
  },
  "display": "John Q. Public",
  "emails": {
    "facebook": "email@example.com",
    "github": "email@example.com",
    "google": "email@example.com"
  },
  "picture": "https://www.dailycred.com/user/pic?user_id=c9c7bc63-cb87-42a4-b0a3-737f1ee0552c&size=50",
  "attributes": {
    "[app_id]": {
      "key": "value"
    }
  }
  ...
}

Error Response


{
  "worked": false,
  "error": {
    "message": "An active access token must be used to query information about the current user.",
    "code": 2500,
    "type": "OAuthException"
  }
}

Retrieve a User by Email

Use this call to retrieve a user by email.

Endpoint

POST https://www.dailycred.com/admin/api/user.json

Arguments

client_id:
required Your client_id available here.
client_secret:
required Your client_secret available here. Never pass your client_secret over an unencrypted connection.
email:
required The user's email.

Example Request


curl https://www.dailycred.com/admin/api/user.json \
  -d 'client_id=dailycred' \
  -d 'client_secret=...' \
  -d 'email=email@example.com' \
  -X POST

Example Response


{
  "email": "email@example.com",
  "id": "...",
  "birthday": "1980-09-28",
  "facebook_username": "fbusername",
  "location": "Seattle, Washington",
  "active_apps": [
    ...
  ],
  "ips": [
    "192.168.0.1"
  ],
  "locale": "en_US",
  "subscribed": true,
  "created": 1350090365743,
  "last_logged_in": 1427171784719,
  "verified": true,
  "name": "John Q. Public",
  "gender": "male",
  "identities": {
    "google": {
      ...
    },
    "facebook": {
      ...
    },
    "github": {
      ...
    }
  },
  "display": "John Q. Public",
  "emails": {
    "facebook": "email@example.com",
    "github": "email@example.com",
    "google": "email@example.com"
  },
  "picture": "https://www.dailycred.com/user/pic?user_id=c9c7bc63-cb87-42a4-b0a3-737f1ee0552c&size=50",
  "attributes": {
    "[app_id]": {
      "key": "value"
    }
  }
  ...
}

Error Response


{
  "error": {
    "message": "User not found",
    "code": 0
  },
  "worked": false
}

Retrieve a User by Username

Use this call to retrieve a user by email.

Endpoint

POST https://www.dailycred.com/admin/api/user.json

Arguments

client_id:
required Your client_id available here.
client_secret:
required Your client_secret available here. Never pass your client_secret over an unencrypted connection.
username:
required The user's username.

Example Request


curl https://www.dailycred.com/admin/api/user.json \
  -d 'client_id=dailycred' \
  -d 'client_secret=...' \
  -d 'username=user123' \
  -X POST

Example Response


{
  "email": "email@example.com",
  "id": "...",
  "birthday": "1980-09-28",
  "facebook_username": "fbusername",
  "location": "Seattle, Washington",
  "active_apps": [
    ...
  ],
  "ips": [
    "192.168.0.1"
  ],
  "locale": "en_US",
  "subscribed": true,
  "created": 1350090365743,
  "last_logged_in": 1427171784719,
  "verified": true,
  "name": "John Q. Public",
  "gender": "male",
  "identities": {
    "google": {
      ...
    },
    "facebook": {
      ...
    },
    "github": {
      ...
    }
  },
  "display": "John Q. Public",
  "emails": {
    "facebook": "email@example.com",
    "github": "email@example.com",
    "google": "email@example.com"
  },
  "picture": "https://www.dailycred.com/user/pic?user_id=c9c7bc63-cb87-42a4-b0a3-737f1ee0552c&size=50",
  "attributes": {
    "[app_id]": {
      "key": "value"
    }
  }
  ...
}

Error Response


{
  "error": {
    "message": "User not found",
    "code": 0
  },
  "worked": false
}

Retrieve a User by ID

Use this call to retrieve a user by email.

Endpoint

POST https://www.dailycred.com/admin/api/user.json

Arguments

client_id:
required Your client_id available here.
client_secret:
required Your client_secret available here. Never pass your client_secret over an unencrypted connection.
user_id:
required The user's user id.

Example Request


curl https://www.dailycred.com/admin/api/user.json \
  -d 'client_id=dailycred' \
  -d 'client_secret=...' \
  -d 'user_id=...' \
  -X POST

Example Response


{
  "email": "email@example.com",
  "id": "...",
  "birthday": "1980-09-28",
  "facebook_username": "fbusername",
  "location": "Seattle, Washington",
  "active_apps": [
    ...
  ],
  "ips": [
    "192.168.0.1"
  ],
  "locale": "en_US",
  "subscribed": true,
  "created": 1350090365743,
  "last_logged_in": 1427171784719,
  "verified": true,
  "name": "John Q. Public",
  "gender": "male",
  "identities": {
    "google": {
      ...
    },
    "facebook": {
      ...
    },
    "github": {
      ...
    }
  },
  "display": "John Q. Public",
  "emails": {
    "facebook": "email@example.com",
    "github": "email@example.com",
    "google": "email@example.com"
  },
  "picture": "https://www.dailycred.com/user/pic?user_id=c9c7bc63-cb87-42a4-b0a3-737f1ee0552c&size=50",
  "attributes": {
    "[app_id]": {
      "key": "value"
    }
  }
  ...
}

Error Response


{
  "error": {
    "message": "User not found",
    "code": 0
  },
  "worked": false
}

Set an Attribute

Use this call to add or update a user attribute. User attributes are available when retreiving the user record via an authentication flow or the Retrieve a User call. Attributes are associated with a single user and a single app. This means a user could have an attribute of color:blue for App #1 and color:red for App #2. In contrast, a tag is associated with a user accross all apps. The app associated with the attribute is determined by which app is associated with the access_token used.

Endpoint

POST https://www.dailycred.com/attribute/set

Arguments

access_token:
required The user's access token.
key:
required The key of the attribute to set or add (ex: favorite_color).
value:
required The value of the attribute to set or add (ex: blue).

Example Request


curl https://www.dailycred.com/attribute/set \
  -d 'access_token=...' \
  -d 'key=color' \
  -d 'value=blue' \
  -X POST

Example Response


{
  "worked": true
}

Error Response


{
  "worked": false,
  "message": "No key provided.  Please include a parameter key"
}

Remove an Attribute

Use this call to remove a user attribute. If the specified attribute is not found, the call will still be successful.

Endpoint

POST https://www.dailycred.com/attribute/remove

Arguments

access_token:
required The user's access token.
key:
required The key of the attribute to remove (ex: favorite_color).

Example Request


curl https://www.dailycred.com/attribute/remove \
  -d 'access_token=...' \
  -d 'key=color' \
  -X POST

Example Response


{
  "worked": true
}

Error Response


{
  "worked": false,
  "message": "No key provided.  Please include a parameter key"
}

Set a Tag

Use this call to add a tag to a user record. User tags are available when retreiving the user record via an authentication flow or the Retrieve a User call. Tags are associated with a single user accross all active apps.

Endpoint

POST https://www.dailycred.com/admin/api/user/tag.json

Arguments

client_id:
required Your client_id available here.
client_secret:
required Your client_secret available here. Never pass your client_secret over an unencrypted connection.
user_id:
required The user's user_id.
tag:
required The tag to add to this user.

Example Request


curl https://www.dailycred.com/admin/api/user/tag.json \
  -d 'client_id=dailycred' \
  -d 'client_secret=...' \
  -d 'user_id=...' \
  -d 'tag=vip' \
  -X POST

Example Response


{
  "worked": true
}

Error Response


{
  "error": {
    "message": "Please provide a user_id or access_token.",
    "code": 0
  },
  "worked": false
}

Remove a Tag

Use this call to remove a tag from a user record.

Endpoint

POST https://www.dailycred.com/admin/api/user/untag.json

Arguments

client_id:
required Your client_id available here.
client_secret:
required Your client_secret available here. Never pass your client_secret over an unencrypted connection.
user_id:
required The user's user_id.
tag:
required The tag to remove from this user.

Example Request


curl https://www.dailycred.com/admin/api/user/tag.json \
  -d 'client_id=dailycred' \
  -d 'client_secret=...' \
  -d 'user_id=...' \
  -d 'tag=vip' \
  -X POST

Example Response


{
  "worked": true,
  "message": "tag removed",
  "user": {
    ...
  }
}

Error Response


{
  "error": {
    "message": "Please provide a tag.",
    "code": 0
  },
  "worked": false
}

Find Users by Tag

Use this call to find users with a given tag.

Endpoint

POST https://www.dailycred.com/admin/api/users/tag

Arguments

client_id:
required Your client_id available here.
client_secret:
required Your client_secret available here. Never pass your client_secret over an unencrypted connection.
tag:
required The tag to remove from this user.
page:
optional An integer used to paginate through results. The first page is 0. Defaults to 0.
size:
optional An integer used to the size of a page of results. Defaults to 30. Must be greater than 0 and less than or equal to 100.

Example Request


curl https://www.dailycred.com/admin/api/users/tag \
  -d 'client_id=dailycred' \
  -d 'client_secret=...' \
  -d 'tag=vip' \
  -X POST

Example Response


[
  {
    "email": "example1@example.com",
    "user_id": "..."
  },
  {
    "email": "example2@example.com",
    "user_id": "..."
  }
]

Error Response


{
  "worked": false,
  "error": {
    "message": "Tag not found",
    "code": 0
  }
}

Change Email with Password

Use this call to allow your users to update their email address by providing their existing authentication details. This call is intended for customer initiated requests via your website or app. To update a user's email programmatically, use the Change Email with Access Token call.

Endpoint

POST https://www.dailycred.com/auth/email/change

Arguments

client_id:
required Your client_id available here.
username_or_email:
required The user's login (email or username).
password:
required The user's password.
email_new:
required The new email address for this user.

Example Request


curl https://www.dailycred.com/auth/email/change \
  -d 'client_id=dailycred' \
  -d 'username_or_email=oldemail@example.com' \
  -d 'password=password' \
  -d 'email_new=newemail@example.com' \
  -X POST

Example Response


{
  "worked": true,
  "message": "Your email has been changed to newemail@example.com. Please look for the confirmation email and verify your new address."
}

Error Response


{
  "worked": false,
  "errors": [
    {
      "message": "Please check your password and try again.",
      "attribute": "form"
    }
  ]
}

Change Email with Access Token

Use this call to update a user's email address using an access_token.

Endpoint

POST https://www.dailycred.com/auth/email/change

Arguments

client_id:
required Your client_id available here.
access_token:
required The user's current access token.
email_new:
required The new email address for this user.

Example Request


curl https://www.dailycred.com/auth/email/change \
  -d 'client_id=dailycred' \
  -d 'access_token=...' \
  -d 'email_new=newemail@example.com' \
  -X POST

Example Response


{
  "worked": true,
  "message": "Your email has been changed to newemail@example.com. Please look for the confirmation email and verify your new address."
}

Error Response


{
  "worked": false,
  "errors": [
    {
      "message": "Please check your password and try again.",
      "attribute": "form"
    }
  ]
}

Trigger an Event (Pixel)

Use a pixel to easily track events of any type and associate them with the active user. You can use tracking pixels on users that have not converted. If the user is a guest user, the events will still be recorded and associated with a new user account. Should the user sign up later, the previous events will be associated with the appropriate account. Note: Connect.js tagging will automatically create events for you.

Endpoint

LINK https://www.dailycred.com/dc.gif

Arguments

client_id:
required Your client_id available here.
type:
required The type of event. Click here for a full list of event types.
url:
optional A url associated with this event. The url should be url encoded. This is usually populated with the output of encodeURI(document.URL) in JavaScript.
referrer:
optional A url of the user's referrer, usually the user's previous page. The url should be url encoded. This is usually populated with the output of encodeURI(document.referrer) in JavaScript.
title:
optional A title describing the current event. For pageviews this is usually the title of the page. App interactions and email views can use any descriptive title. This parameter should be url encoded.
email_address:
optional The email address for the current user. This is useful when tracking email views. If present this will cause the new event to ignore any user tracking cookies, and will instead create the event for the user associated with this email. This allows email campaigns to easily associate email views with the correct user. This parameter should be url encoded.

Example


<img src="https://www.dailycred.com/connect?client_id=dailycred&title=Home%20Page&type=user_page_view">

Example Response


A 1x1 transparent pixel image will be returned.

Trigger a Refferal

Use this link to track user referalls. For example, if you email Alice this link and suggest she invite her friends, if Bob and Charlie click the link, they will be recorded as referred from Alice. This can be very useful for marketing campaigns. Note that you can set up a CNAME record on your domain so that this link is served from a subdomain.

Endpoint

LINK https://www.dailycred.com/r

Arguments

client_id:
required Your client_id available here.
referrer_user_id:
required The referring user's user_id.
redirect_uri:
required Where you wish the user to be redirected to after being referred. For security purposes, this domain must be one of your approved domains.

Example


<a href="https://www.dailycred.com/r?client_id=dailycred&referrer_user_id=c9c7bc63-cb87-42a4-b0a3-737f1ee0552c&redirect_uri=https://www.dailycred.com">
Click here to join!
</a>

Example Response


The user will be cookied, marked as a refferal, and sent to the redirect: https://www.dailycred.com