API Reference - User Invite Logs

Link: https://support.brilliantdirectories.com/support/solutions/articles/12000108072

← Back to API Reference | Getting Started

User Invite Logs

User Invite Logs tracks outbound email invitations sent to prospective members. Each record captures the invitation email address, template used, send status, and a token for tracking when the recipient accepts the invite.

Model name in URL: user_invite_log — DB table: user_invite_log

The User Invite Logs Object

FieldTypeDescription
invite_idintegerUnique invite log record ID (primary key, read-only)
sentintegerWhether the invitation email was sent (0 = not sent, 1 = sent)
user_idintegerID of the member who sent this invitation
templatestringEmail template identifier used for this invitation
subjectstringSubject line of the invitation email
messagetextFull body content of the invitation email
date_sentstringDate the invitation was sent, formatted as YYYYMMDDHHmmss
emailstringEmail address the invitation was sent to
affiliation_idintegerID of the affiliation or group context for this invitation
statusstringCurrent status of the invitation (EG Pending, Accepted; default Pending)
invite_tokenstringUnique token embedded in the invitation link to identify the recipient when they sign up

List User Invite Log Records

GET /api/v2/user_invite_log/get

Returns a paginated list of user invite log records.

Example Request

Copy
curl -X GET "https://www.yourdomain.com/api/v2/user_invite_log/get?limit=25" \
  -H "X-Api-Key: your-api-key-here"

Example Response

Copy
{
  "status": "success",
  "message": [
    {
      "invite_id": "1",
      "sent": "1",
      "user_id": "42",
      "template": "invite_default",
      "subject": "You are invited to join our directory",
      "message": "",
      "date_sent": "20240315140000",
      "email": "sarah@example.com",
      "affiliation_id": "0",
      "status": "Pending",
      "invite_token": "a1b2c3d4e5f6"
    },
    {
      "invite_id": "2",
      "sent": "1",
      "user_id": "42",
      "template": "invite_default",
      "subject": "Join our professional network",
      "message": "",
      "date_sent": "20240316090000",
      "email": "mike@example.com",
      "affiliation_id": "0",
      "status": "Accepted",
      "invite_token": "x9y8z7w6v5u4"
    }
  ],
  "total": "87",
  "current_page": 1,
  "total_pages": 4,
  "next_page": "MipfKjI1"
}

Retrieve a User Invite Log Record

GET /api/v2/user_invite_log/get/{invite_id}

Example Request

Copy
curl -X GET "https://www.yourdomain.com/api/v2/user_invite_log/get/1" \
  -H "X-Api-Key: your-api-key-here"

Example Response

Copy
{
  "status": "success",
  "message": [
    {
      "invite_id": "1",
      "sent": "1",
      "user_id": "42",
      "template": "invite_default",
      "subject": "You are invited to join our directory",
      "message": "",
      "date_sent": "20240315140000",
      "email": "sarah@example.com",
      "affiliation_id": "0",
      "status": "Pending",
      "invite_token": "a1b2c3d4e5f6"
    }
  ],
  "total": "87",
  "current_page": 1,
  "total_pages": 87
}

Create a User Invite Log Record

POST /api/v2/user_invite_log/create

Example Request

Copy
curl -X POST "https://www.yourdomain.com/api/v2/user_invite_log/create" \
  -H "X-Api-Key: your-api-key-here" \
  -d "user_id=1" \
  -d "email=newmember@example.com" \
  -d "subject=You are invited to join our directory" \
  -d "template=invite_default" \
  -d "status=Pending" \
  -d "invite_token=abc123xyz"

Example Response

Copy
{
  "status": "success",
  "message": {
    "invite_id": "88",
    "sent": null,
    "user_id": "1",
    "template": "invite_default",
    "subject": "You are invited to join our directory",
    "message": null,
    "date_sent": null,
    "email": "newmember@example.com",
    "affiliation_id": null,
    "status": "Pending",
    "invite_token": "abc123xyz"
  }
}

Update a User Invite Log Record

PUT /api/v2/user_invite_log/update

Example Request

Copy
curl -X PUT "https://www.yourdomain.com/api/v2/user_invite_log/update" \
  -H "X-Api-Key: your-api-key-here" \
  -d "invite_id=1" \
  -d "status=Accepted"

Example Response

Copy
{
  "status": "success",
  "message": {
    "invite_id": "1",
    "sent": "1",
    "user_id": "42",
    "template": "invite_default",
    "subject": "You are invited to join our directory",
    "message": "",
    "date_sent": "20240315140000",
    "email": "sarah@example.com",
    "affiliation_id": "0",
    "status": "Accepted",
    "invite_token": "a1b2c3d4e5f6"
  }
}

Delete a User Invite Log Record

DELETE /api/v2/user_invite_log/delete

Example Request

Copy
curl -X DELETE "https://www.yourdomain.com/api/v2/user_invite_log/delete" \
  -H "X-Api-Key: your-api-key-here" \
  -d "invite_id=1"

Example Response

Copy
{
  "status": "success",
  "message": "user_invite_log record was deleted"
}