Developer Resources
Friend Invitations
CREATE a friend invitation POST /api/v2/betas/{beta_id}/friend_invitations
Invite a new person on behalf of an existing tester. The delivered email will use your Invite-a-Friend E-mail Template.
Friend Invitations differ from referrals (where a tester shares their unique referral link with a friend) in that recipients get an immediate invitation to your beta as if they had applied and been invited by you.
For example, to have an existing tester "leonard@bigbangtheory.com" send an invitation to their friend "sheldon@bigbangtheory.com":
Parameters
- sender_email required
- The email address of the existing tester sending this invitation (inviter).
- recipient_email required
- The email address of the person receiving the invitation (invitee).
- message optional
- A personal message from the sender to the recipient.
Request
{
"friend_invitation" : {
"sender_email": "leonard@bigbangtheory.com",
"recipient_email": "sheldon@bigbangtheory.com",
"message": "Hi Sheldon, I really think you will love this site."
}
}
Or, using curl:
curl -u api_key: https://api.prefinery.com/api/v2/betas/1/friend_invitations.json \
-d "friend_invitation[sender_email]"="leonard@bigbangtheory.com" \
-d "friend_invitation[recipient_email]"="sheldon@bigbangtheory.com" \
-d "friend_invitation[message]"="Hi Sheldon, I really think you will love this site."
Response
HTTP/1.1 201 Created
{
"id": 1,
"created_at":"2012-10-23T11:44:58Z",
"inviter": {
"id": 1,
"email": "leonard@bigbangtheory.com",
"status": "active",
"invitation_code": "a05f6a467c",
"imported_at": null,
"applied_at": "2012-10-21T10:44:21Z",
"invited_at": "2012-10-22T11:34:10Z",
"joined_at": "2012-10-23T09:54:35Z",
"unsubscribed_at": null,
"share_clicks_count": 0,
"share_signups_count": 0,
"friend_invitations_count": 0,
"friend_invitations_remaining": 5,
"referral_code": "FaKElInK",
"share_link": "http://l.aunch.us/FaKElInK",
"referred_by": null,
"created_at": "2012-10-21T10:44:21Z",
"updated_at": "2012-10-23T09:54:35Z",
"profile": {
"first_name": null,
"last_name": null,
"employer": null,
"jobtitle": null,
"address_line1": null,
"address_line2": null,
"city": null,
"state": "",
"postal_code": "",
"country": "",
"telephone": "",
"gender": null,
"age": null,
"facebook_username": null,
"twitter_username": null,
"linkedin_username": null,
"browser_name": null,
"browser_version": null,
"os_name": null,
"os_version": null,
"ip": null
}
},
"invitee": {
"id": 2,
"email": "sheldon@bigbangtheory.com",
"status": "invited",
"invitation_code": "00509fdc65",
"imported_at": null,
"applied_at": null,
"invited_at": "2012-10-23T11:44:58Z",
"joined_at": null,
"unsubscribed_at": null,
"share_clicks_count": 0,
"share_signups_count": 0,
"friend_invitations_count": 0,
"friend_invitations_remaining": 5,
"referral_code": "FaKElInK",
"share_link": "http://l.aunch.us/FaKElInK",
"referred_by": null,
"created_at": "2012-10-23T11:44:58Z",
"updated_at": "2012-10-23T11:44:58Z",
"profile": {
"first_name": null,
"last_name": null,
"employer": null,
"jobtitle": null,
"address_line1": null,
"address_line2": null,
"city": null,
"state": "",
"postal_code": "",
"country": "",
"telephone": "",
"gender": null,
"age": null,
"facebook_username": null,
"twitter_username": null,
"linkedin_username": null,
"browser_name": null,
"browser_version": null,
"os_name": null,
"os_version": null,
"ip": null
}
}
}
Errors
Code | Description |
---|---|
2501 | A general error has occurred. |
2502 | The Invite-a-Friend System is disabled. You can enable Invite-a-Friend System via the Prefinery UI on the Advanced Settings page. |
2503 | Sender email is required. |
2504 | Tester record not found for sender email. The sender's email address must correspond to an existing tester in your beta. |
2505 | Sender not allowed to send invitations. The sender's tester record must be set to a status of Invited, Active, or Idle. An Applied or Rejected tester cannot invite friends. |
2506 | Recipient email is required. |
2507 | You cannot invite yourself. |
2508 | You have no more invitations. The sender has used up all of their friend invitations. |
2509 | You have already invited this person. |
2510 | Recipient email is invalid. |