Public API Readme

Getting Started

If you are not part of an existing network or have not already created a network, please visit https://redeapp.com/pricing/ to view plans, including an option to start a risk-free 30-day trial. Creating a network is only available through the website and cannot currently be done using the API.

If you are already a member of an existing network, then you can get started using the API. Depending on your level of access within your network, some endpoints may not be available to you. If there is an endpoint or a group of endpoints that you do not have access to, reach out to your network administrator if you feel that you should have access to them.

If you are a network admin looking to set up access for a member to be able to use the API, you can use the Admin Console in Network → Admins and grant access to an existing member in your network to whichever areas of the network that member needs (Messages, People, Forms, Resources, Analytics). The user must already be a member of your network in order to grant admin access.

 

Rate Limits

One key point to keep in mind when using the public API is to be wary of calling any endpoints in a loop. Most endpoints are set up in a way to be able to send or receive large amounts of information in a single call. If you do attempt to call several endpoints in a loop back-to-back, such as sending a message to several different people one at a time, you will likely run up against rate limits set in our system to prevent spam calls.

 

Authentication

The first step to using the API is to get a Bearer token. You can get this token by using your username and password. Once a token is received, you should only use this token for authorization. This will reduce the risk of exposing your credentials.

Example Request:

curl --location --request POST '<https://secure.redeapp.com/api/auth/v1/bearer/login'> \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data-raw '{
	"username": "janesmith",
	"password": "password12345"
}'

Example Response:

{
    "token": "1234a1f157754380c5c989b37c28412db180abcd"
}

 

Network Information

Now that you have your Bearer token, you can use it for authentication on all other endpoints. As a network admin, the next pieces of information you will want are details on your network(s). Note that while a majority of our endpoints are paginated, a few are not, such as this one. This endpoint will tell you your network_id (since you are receiving a network object, the network_id is simply listed as id in the main response body) as well as the network key, and what features are enabled on the customer level. Keep in mind that just because a feature is enabled at the customer level, that does not necessarily mean that the feature has been enabled at the network level. It is possible for customers to have multiple networks under them, and some features may only be enabled on certain networks. The most important piece of information here is definitely the network_id as this id is used in many other requests.

curl --location --request GET '<https://secure.redeapp.com/api/networks/v1/networkadmins/networks'> \
--header 'Authorization: Bearer 1234a1f157754380c5c989b37c28412db180abcd' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json'

Example Response:

[
   {
        "id": "abcdef12-abcd-1234-9876-0123456789ab",
        "network_key": "example.network",
        "name": "Example Network",
        "avatar_url": "<https://s3.amazonaws.com/media.redeapp.com/00000000-0000-0000-0000-000000000000.jpg",>
        "customer": {
            "id": "abcd1234-1234-2345-3456-abcd98765432dcba",
            "created_at": "2020-01-01T12:00:00.000000Z",
            "updated_at": "2021-04-01T16:30:15.505807Z",
            "name": "Parent Customer",
            "avatar_object_key": "00000000-0000-0000-0000-000000000000",
            "avatar_url": "<https://s3.amazonaws.com/media.redeapp.com/00000000-0000-0000-0000-000000000000",>
            "background_object_key": "00000000-0000-0000-0000-000000000004",
            "background_url": "<https://s3.amazonaws.com/media.redeapp.com/00000000-0000-0000-0000-000000000004",>
            "is_trial": true,
            "tier": 3,
            "feature_settings": [
                {
                    "name": "forms",
                    "override": false,
                    "available": true
                },
                {
                    "name": "forms_premium",
                    "override": false,
                    "available": true
                },
                {
                    "name": "analytics",
                    "override": false,
                    "available": true
                },
                {
                    "name": "analytics_premium",
                    "override": false,
                    "available": true
                },
                {
                    "name": "conveyor",
                    "override": false,
                    "available": true
                },
                {
                    "name": "expiring_messages",
                    "override": false,
                    "available": true
                },
                {
                    "name": "sso",
                    "override": false,
                    "available": true
                },
                {
                    "name": "static_push_title",
                    "override": false,
                    "available": true
                },
                {
                    "name": "passcode_detection",
                    "override": false,
                    "available": true
                },
                {
                    "name": "scout_premium",
                    "override": false,
                    "available": true
                },
                {
                    "name": "passport",
                    "override": true,
                    "available": true
                }
            ],
            "industry": null,
            "trial_expired_at": null,
            "status": "customer",
            "can_edit_plan": false,
            "cancelled_at": null,
            "signup_id": null,
            "signup_account_id": null,
            "plan": {
                "id": "fedcba09-4321-5432-6543-0987abcd1234",
                "tier": 3,
                "name": "Gold",
                "description": "Partner with Red e App for premium features, integrations, and ongoing customer success management.",
                "pricing_model": "standard_pricing",
                "interval": "month",
                "cost": 600
            }
        },
        "subnetworks": []
    }
]

 

Group Recipients

Let's say you want to use the API to send a message to a group. In order to send to a group, you will need to know the group_id to set it as a recipient of a message. We can get a list of network groups with the following endpoint:

curl --location --request GET '<https://secure.redeapp.com/api/groups/v1/groups?network_id=abcdef12-abcd-1234-9876-0123456789ab&group_type=network_group'> \
--header 'Authorization: Bearer 1234a1f157754380c5c989b37c28412db180abcd' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json'

Example response:

{
    "count": 2,
    "next": null,
    "previous": null,
    "results": [
        {
            "id": "11111111-1111-1111-1111-111111111111",
            "created_at": "2019-05-22T18:56:37.534436Z",
            "updated_at": "2020-05-11T17:45:28.201421Z",
            "network_id": "abcdef12-abcd-1234-9876-0123456789ab",
            "name": "Managers Group",
            "initials": "M",
            "avatar_object_key": "00000000-0000-0000-0000-000000000000.jpg",
            "avatar_url": "<https://s3.amazonaws.com/media.redeapp.com/00000000-0000-0000-0000-000000000000.jpg",>
            "description": "",
            "reply_all": true,
            "shifts_enabled": false,
            "teams_enabled": false,
            "list_rule_id": null,
            "member_count": 9,
            "pending_member_count": 1,
            "active_member_count": 8,
            "notifier_count": 0,
            "pending_notifier_count": 0,
            "active_notifier_count": 0,
            "subgroup_count": 0,
            "group_type": "network_group",
            "account_is_notifier": null,
            "auto_notifier_member_enabled": false
        },
        {
            "id": "22222222-2222-2222-2222-222222222222",
            "created_at": "2019-05-22T18:52:25.368915Z",
            "updated_at": "2020-05-11T16:30:19.758166Z",
            "network_id": "abcdef12-abcd-1234-9876-0123456789ab",
            "name": "Frontline Workers",
            "initials": "F",
            "avatar_object_key": "00000000-0000-0000-0000-000000000000.jpg",
            "avatar_url": "<https://s3.amazonaws.com/media.redeapp.com/00000000-0000-0000-0000-000000000000.jpg",>
            "description": "",
            "reply_all": false,
            "shifts_enabled": true,
            "teams_enabled": false,
            "list_rule_id": null,
            "member_count": 125,
            "pending_member_count": 12,
            "active_member_count": 113,
            "notifier_count": 3,
            "pending_notifier_count": 1,
            "active_notifier_count": 2,
            "subgroup_count": 0,
            "group_type": "network_group",
            "account_is_notifier": null,
            "auto_notifier_member_enabled": false
        }
    ]
}

 

Sending Messages

Now that we have our list of groups, we can send a message to one or more of them. If you want to send the same message to everyone in multiple groups, you do not need to call the messaging endpoint multiple times. You can simply set the list of recipients to have everyone who needs to receive the message. If a user is in more than one group in the list of recipients, they will only receive the message once.

For messages that are sent as text/html content, they will automatically be wrapped with appropriate <html> and <body> tags along with other meta information that will make the messages render properly on mobile devices.

curl --location --request POST '<https://secure.redeapp.com/api/messaging/v1/messages'> \
--header 'Authorization: Bearer 1234a1f157754380c5c989b37c28412db180abcd' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data-raw '{
    "content_type": "text/html",
    "body": "<h1>Title</h1><p>This is important information!</p>",
    "subject": "Test Message",
    "network_id": "abcdef12-abcd-1234-9876-0123456789ab",
    "sender_type": "network",
    "recipients": [
        {
            "recipient_id": "11111111-1111-1111-1111-111111111111",
            "recipient_type": "group",
            "broadcast": true
        },
        {
        	"recipient_id": "22222222-2222-2222-2222-222222222222",
            "recipient_type": "group",
            "broadcast": true
        }
    ]
}'

We'll skip the example response here, because it is just echoing back the message that we sent. Note that the "broadcast" flag should be set on all groups that receive the message.

 

Message Attachments

If you wanted to send an attachment (up to 5) along with your message, then you would first need to upload the attachment with one of the Storage upload endpoints, depending on whether you want to use a multipart form or a direct binary upload. After uploading a file, you would get a response like the following:

{
    "id": "33333333-3333-3333-3333-333333333333",
    "created_at": "2021-09-01T16:03:12.758978Z",
    "updated_at": "2021-09-01T16:03:12.759025Z",
    "owner_id": "11111111-2222-3333-4444-111111111111",
    "object_key": "44444444-4444-4444-4444-44444444.jpg",
    "content_type": "image/jpeg",
    "size": 110397,
    "public_read": true,
    "public_url": "<https://s3.amazonaws.com/media.redeapp.com/44444444-4444-4444-4444-44444444.jpg",>
    "transcodable": false,
    "transcode_completed": false,
    "transcode_failed": false,
    "transcode_status": null,
    "max_width": null
}

In general, only publicly facing images (such as avatar images) need to be set to public_read=true when uploading. If you set public_read=false then the public_url will be null. If you upload video, it will take the server a short amount of time to transcode the video to ensure that it is viewable on mobile devices, and the status of that transcode is available in the response. Messages sent with video attachments that have not finished transcoding might have poor user experience until the transcode has finished.

With the upload finished, you can now set the file upload as an attachment on a sent message.

curl --location --request POST '<https://secure.redeapp.com/api/messaging/v1/messages'> \
--header 'Authorization: Bearer 1234a1f157754380c5c989b37c28412db180abcd' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data-raw '{
    "content_type": "text/html",
    "body": "<p>Check out this picture from the company meeting</p>",
    "subject": "Test Message",
    "network_id": "abcdef12-abcd-1234-9876-0123456789ab",
    "sender_type": "network",
    "recipients": [
        {
        	"recipient_id": "22222222-2222-2222-2222-222222222222",
            "recipient_type": "group",
            "broadcast": true
        }
    ],
    "attachments: [
    	{
			"content_type": "image/png",
			"object_key": "44444444-4444-4444-4444-44444444.jpg",
			"filename": "company_pic.png"
		}
    ]
}'
Have more questions? Submit a request