Buzz

Search Alt+S

Enable secure Zero Trust communication within Privacy Bee’s ecosystem.

(WIP) Save the user’s public key to our backend.

GET /apps/buzz/trust-lookup

In the event that an incoming call is ringing the secure number, Twilio will call the number. It is necessary to format the number as COUNTRYCODE + PHONE_NUMBER for both of the provided values.

The backend will attempt to match the provided phone number to an active Privacy Bee member.
If the number is invalid or doesn’t correspond to any member, the endpoint will return an “untrusted” status (without providing a descriptive error for security reasons).

If both numbers are matched to an entity, the backend will lookup if the inbound caller is a trusted entity (company or contact) by the user receiving the call. If the caller is trusted, the endpoint will return “trusted" Otherwise, it will return “untrusted”

Parameters:

VariableData TypeDefaultRequiredDescriptionExample
number_codestringYesCountry code of receiving number1
numberstringYesUnformatted phone number of receiving number2385551629
inbound_codestringYesCountry code of caller1
inboundstringYesUnformatted phone number of caller9876543210
caller_idstringNoCaller ID of inbound number12345

Example Request

curl -X POST "https://api.privacybee.com/api/core/company/" \
     -H "Content-Type: application/json" \ 
     -d '{ 
            "number_code": "1",
             "number": "2385551629",
             "inbound_code": "1",
             "inbound": "9876543210",
             "caller_id": "8765432109"
         }'

Returns a JSON object, with the following fields:

FieldData TypeDescriptionExample
trustedbooleanWhether the inbound call trusted and able to ring the user’s phone, or nottrue
user_idunsigned integerUser id of the buzz number being called 123

Example Response

{
  "trusted": true, // or false, depending on whether the inbound call is trusted
  "user_id": 12345 // replace with the actual user id of the buzz number being called 
}

Errors:

  • 400
  • 401
  • 404
  • 500
{
  "error": {
    "code": "400",
    "message": "Bad Request: The request cannot be fulfilled due to bad syntax."
  }
}
{
  "error": {
    "code": "401",
    "message": "Unauthorized: Access is denied due to invalid credentials."
  }
}
{
  "error": {
    "code": "404",
    "message": "Not Found: The requested resource was not found."
  }
}
{
  "error": {
    "code": "500",
    "message": "Internal Server Error: An unexpected condition was encountered."
  }
}

GET

/apps/buzz/call-lookup

This endpoint is used to provide comprehensive details about a phone number once Twilio verifies that it is trusted.

When you make a request to this endpoint with the same parameters as the Trust Lookup.

Parameters:

VariableData TypeRequiredDescriptionExample
number_code stringYesCountry code of receiving number1
numberstringYesUnformatted phone number of receiving number 2385551629
inbound_codestringYesCountry code of caller1
inboundstringYesUnformatted phone number of caller9876543210
caller_idstringNoCaller ID of inbound number109

Example Request

curl -G 'http://api.privacybee.com/apps/buzz/call-lookup' \
    -d number_code='123' \
    -d number='9876543210' \
    -d inbound_code='456' \
    -d inbound='9876543210' \
    -d caller_id='789'

Returns the additional information of the trusted caller. A JSON object, with the following fields:

FieldData TypeDescription
contacts arrayArray of contacts that phone number matched that are trusted by the receiver
peoplearrayArray of privacy bee users that the phone number matched to, includes first name, last name, and avatar
companiesarrayArray of companies the phone number matches that the receiver trusts

Example

{
  "contacts": [
    // ... array of contacts that phone number matched that are trusted by the receiver
  ],
  "people": [ 
    {
      "first_name": "John",
      "last_name": "Doe",
      "avatar": "url_to_avatar_image"
      // ... additional privacy bee user details
    }
    // ... more privacy bee users
  ],
  "companies": [
    // ... array of companies the phone number matches that the receiver trusts
  ]
}

Errors

  • 400
  • 401
  • 404
  • 500
{
  "error": {
    "code": "400",
    "message": "Bad Request: The request cannot be fulfilled due to bad syntax."
  }
}
{
  "error": {
    "code": "401",
    "message": "Unauthorized: Access is denied due to invalid credentials."
  }
}
{
  "error": {
    "code": "404",
    "message": "Not Found: The requested resource was not found."
  }
}
{
  "error": {
    "code": "500",
    "message": "Internal Server Error: An unexpected condition was encountered."
  }
}

GET

/apps/buzz/heartbeat

This endpoint should be called every time the Buzz app is opened or focused, or every five(5) minutes of active use. This action will assign a unique number to a user who has not yet been allocated one.

Parameters: None

Example Request

curl -X GET "http://api.privacybee.com/apps/buzz/heartbeat"

Return A JSON object, with the following fields:

FieldData TypeDescription
last_contact_updatetimestampTimestamp of the last time contacts were updated
last_trust_requesttimestampThe last timestamp of when this person received a trust request
last_company_updatedtimestampThe timestamp of the last time a trusted company was updated
last_coworker_updatetimestampThe timestamp of the last time a coworker was updated
last_user_updatetimestampLast time the auth user was updated
last_activity_idstringTimestamp of the last buzz activity that occurred

Example

{
  "last_contact_update": "2024-07-01T11:27:05Z", 
  "last_trust_request": "2024-07-01T10:00:00Z", 
  "last_company_update": "2024-06-30T15:45:00Z", 
  "last_coworker_update": "2024-06-30T09:30:00Z",  
  "last_user_update": "2024-06-29T20:15:00Z",
  "last_activity_id": "123456789" 
}

Errors:

  • 400
  • 401
  • 404
  • 500
{
  "error": {
    "code": "400",
    "message": "Bad Request: The request cannot be fulfilled due to bad syntax."
  }
}
{
  "error": {
    "code": "401",
    "message": "Unauthorized: Access is denied due to invalid credentials."
  }
}
{
  "error": {
    "code": "404",
    "message": "Not Found: The requested resource was not found."
  }
}
{
  "error": {
    "code": "500",
    "message": "Internal Server Error: An unexpected condition was encountered."
  }
}

GET

/apps/buzz/blocked

Use this endpoint to retrieve the latest 100 calls that have been blocked.

Parameters: None

Example Request

curl -X GET "http://api.privacybee.com/apps/buzz/blocked"
FieldData TypeDescription
idunsigned integerThe user ID of the currently authenticated person.
caller_idstringCaller ID of the blocked call
country_codestringCountry code of caller
phone_numberstringPhone number of caller
created_attimestampWhen the call occurred

Example

{
  "id": 123456, // The user ID of the currently authenticated person
  "caller_id": "Unknown Caller", // Caller ID of the blocked call
  "country_code": "+1", // Country code of caller
  "phone_number": "555-1234", // Phone number of caller
  "created_at": "2024-07-01T12:00:00Z" // When the call occurred
}

Errors:

  • 400
  • 401
  • 404
  • 500
{
  "error": {
    "code": "400",
    "message": "Bad Request: The request cannot be fulfilled due to bad syntax."
  }
}
{
  "error": {
    "code": "401",
    "message": "Unauthorized: Access is denied due to invalid credentials."
  }
}
{
  "error": {
    "code": "404",
    "message": "Not Found: The requested resource was not found."
  }
}
{
  "error": {
    "code": "500",
    "message": "Internal Server Error: An unexpected condition was encountered."
  }
}

POST

/apps/buzz/activity

Parameters

FieldData TypeDescription
typestringType of activity – chat_message, chat_read_indicator, chat_reaction_emoji, incoming_call_missed, incoming_call_connected_insecure, incoming_call_connected_secure, outgoing_call_missed, outgoing_call_connected_insecure, outgoing_call_connected_secure
receivable_typestringType of receiver personor company
receivable_idintegerID of the receiver
sendable_typestringType of sender person or company
sendable_idintegerID of the sender
call_timeintegerLength of call in seconds
messagestringEncrypted message
message_iduuidMessage UUID

Example Request

curl -X POST "http://api.privacybee.com/apps/buzz/activity" \
    -H "Content-Type: application/json" \
    -d '{
        "type": "chat_message",
        "receivable_type": "company",
        "receivable_id": 123,
        "sendable_type":"person",
        "sendable_id": 456,
        "call_time": 789,
        "message": "Your message here",
        "message_id": "uuid-goes-here"
    }'

Return: JSON object containing details about the created activity.

HTTP/1.1 200 OK
Content-Type: application/json

{
    "success": true,
    "data": {
        "id": 1,
        "type": "chat_message",
        "receivable_type": "company",
        "receivable_id": 123,
        "sendable_type": "person",
        "sendable_id": 456,
        "call_time": 789,
        "message": "Your message here",
        "message_id": "uuid-goes-here",
        "created_at": "2024-07-05T12:14:45Z"
    }
}

Errors

  • 400
  • 401
  • 404
  • 500
HTTP/1.1 400 Bad Request
Content-Type: application/json

{
    "error": true,
    "message": "Missing required parameter: 'type'"
}
{
  "error": {
    "code": "401",
    "message": "Unauthorized: Access is denied due to invalid credentials."
  }
}
{
  "error": {
    "code": "404",
    "message": "Not Found: The requested resource was not found."
  }
}
{
  "error": {
    "code": "500",
    "message": "Internal Server Error: An unexpected condition was encountered."
  }
}

GET

/apps/buzz/activity/<id>

Use this endpoint to get recent activity with an ID parameter, it will return all newer activity since the given ID. If the recipient ID matches the logged in user the message came to them, otherwise if it matches sendable id it was sent by them

Parameters:

VariableData TypeRequiredDescription
idunsigned integer YesThe unique identifier of the activity.

Request Example

curl -X GET "https://api.privacybee.com/apps/buzz/activity/{activity_id}" \ 
     -H "Authorization:  Bearer {access_token}"

Response Format

The endpoint returns all newer activities since this activity ID.

FieldData TypeDescription
typestringthe type of message
receivable_typestringType of receiver AppModelsPerson or AppModelsCompany
receivable_idintegerID of the receiver
sendable_typestringType of receiver AppModelsPerson or AppModelsCompany
sendable_idintegerID of the sender
call_timeintegerLength of call in seconds
messagestringEncrypted message
sendableobjectThis object contains the id, first_name, middle name, and last name of the person who sent the message
receivableobjectThis object contains the id, first_name, middle name, and last name of the person who received the message

Response Example

{
  "type": "message_type", // e.g., "text", "call", "voicemail"
  "receivable_type": "AppModelsPerson", // or "AppModelsCompany"
  "receivable_id": 123456, // ID of the receiver  
  "sendable_type": "AppModelsPerson", // or "AppModelsCompany"
  "sendable_id": 654321, // ID of the sender
  "call_time": 300, // Length of call in seconds
  "message": "encrypted_message_content", // Encrypted message content
  "sendable": {
    "id": 654321, // ID of the sender
    "first_name": "John",
    "middle_name": "H.",
    "last_name": "Doe"
  },
  "receivable": {
    "id": 123456, // ID of the receiver
    "first_name": "Jane",
    "middle_name": "A.",
    "last_name": "Smith"
  }
}

Errors

  • 400
  • 401
  • 404
  • 500
HTTP/1.1 400 Bad Request
Content-Type: application/json

{
    "error": true,
    "message": "Missing required parameter: 'type'"
}
{
  "error": {
    "code": "401",
    "message": "Unauthorized: Access is denied due to invalid credentials."
  }
}
{
  "error": {
    "code": "404",
    "message": "Not Found: The requested resource was not found."
  }
}
{
  "error": {
    "code": "500",
    "message": "Internal Server Error: An unexpected condition was encountered."
  }
}

PUT

/apps/buzz/encryption

Use this endpoint to update encryption data for a buzz user

FieldData TypeDescription
hashstringThe hash for this user across devices
e2e_idstringThe ID of the person with whatever E2E provider we are using (seald)

DEL

/apps/buzz/clear

This endpoint is used to clear a user’s session or data. It should be called when a user wishes to reset their app state or when cleaning up resources is necessary.

Note: This is a dev endpoint only to wipe history while testing

Example Request

curl -X DELETE "https://api.privacybee.com/apps/buzz/clear" \
     -H "Authorization: Bearer {access_token}"

Return:

204 No Content

A successful request to this endpoint will result in a 204 No Content response, indicating that the operation was successful and that there is no content to return.

{
  "status": 204,
  "statusText": "No Content"
}

Errors:

  • 400
  • 401
  • 404
  • 500
HTTP/1.1 400 Bad Request
Content-Type: application/json

{
    "error": true,
    "message": "Missing required parameter: 'type'"
}
{
  "error": {
    "code": "401",
    "message": "Unauthorized: Access is denied due to invalid credentials."
  }
}
{
  "error": {
    "code": "404",
    "message": "Not Found: The requested resource was not found."
  }
}
{
  "error": {
    "code": "500",
    "message": "Internal Server Error: An unexpected condition was encountered."
  }
}