You test a Community integration in your production account, using your own mobile numbers and a Subcommunity set aside for testing. This article covers getting API access, preparing test devices so you can repeat opt-in tests, testing each way Members join, and cleaning up afterwards.
Who this applies to: Leaders and developers building an integration with the Community API or webhooks. Your account must be on a plan that includes API access, and your seat needs API permission. Partner platforms without a Community account, please reach out to yourfriends@community.com.
What is API integration testing
API integration testing is checking, before you go live, that your systems and Community pass data to each other the way you expect. That means Members are created, opted in and tagged correctly, messages send, and events reach your systems.
Community does not offer a sandbox. A sandbox would need its own phone number, and every number needs TCR registration. So you test in your production account. Test traffic is real: messages go through the carriers to real phones.
What you test depends on what your integration does:
| What you want to do | API reference |
|---|---|
| Add or update a Member | Invite/Update Member API |
| Add a Member to, or remove one from, a Subcommunity | Change Subcommunity Membership API |
| Create, update or delete a Subcommunity | Tag create, Tag update, Tag delete |
| Opt a Member out | Opt-out Member API |
| Store Custom Member Data | Custom Member Data API |
| Send a message from an external system | Send Message API |
| Export data | Data Export API |
| Listen for events and messages | Community Webhooks |
Why should I use API integration testing?
Because there is no sandbox, your first real Member is also your first real test unless you test deliberately. Members only become active after they opt in, and the steps they go through differ by how they join (text-in, API, webhook, bulk upload). An integration that returns a success code can still leave Members inactive or missing data. Testing each path with your own phones shows you what a Member actually receives and what lands in Community, before anyone outside your team is affected.
How do I use it?
Getting API access
- Confirm your plan includes API access. If you are not sure, ask your account team or yourfriends@community.com.
- Confirm your seat has API permission. API access, webhooks, data download and Zapier are advanced permissions that a Community administrator sets per seat.
- Make sure everyone on your testing team has a seat and has accepted the invite. See Managing Team Seats.
- In Community, go to Settings > API Tokens and generate a token. If you do not see the API Token option, see I don't see API Tokens menu options in my Community settings.
- Send the token as a bearer token in the Authorization header of every request, and put your Customer ID (client_id) in the URL path. See Getting started with your API.
| Token limit | Detail |
|---|---|
| Scope | One token per seat. A token is visible only to the seat that created it. |
| Refresh | Each use extends the token for 12 months. It can be refreshed indefinitely. |
| Expiry | A token expires if it is not used for more than a year. |
Preparing your test setup
- Choose your test numbers. Use your own U.S. or Canadian mobile numbers. VoIP numbers such as Google Voice work, which can help team members outside the U.S., but messages to them may go to spam and attachments such as .vcf contact cards may be stripped.
-
Create a Subcommunity used only for testing, and name it so it is obviously a test. Send all test Campaigns to it. Accounts can have up to 200 Subcommunities by default.
- Create any Custom Member Data fields you plan to send through the API in the Community UI first. The API does not create them. See Custom Member Data.
- Create any Subcommunities you plan to assign through the Invite/Update Member API in the Community UI first. See Subcommunities in Community.
Test messages are live and go through the carriers, so their content must follow the Acceptable Use Policy.
Preparing test devices for repeat opt-in testing
There is a cooldown on re-adding a number through the API, webhooks or bulk import. Do this once per test device before you start, so you can run the same opt-in test more than once.
- Subscribe the test device to your Community number, by texting in or by importing it. Go all the way through to the welcome message and contact card. If you texted in, submit the registration form. If you imported it, reply Y when asked to confirm.
- From the test device, text ENABLE COMMUNITY IMPORT TESTING ON THIS DEVICE. This exempts the device from the import cooldown.
- If the test device was deleted before you enabled import testing, text START from it to reactivate it, then repeat step 2.
The cooldown does not apply to Members who join by texting in.
Testing Member creation flows
Test every way Members will join through your integration. Each path takes the Member through a different signup series.
| How the Member joins | What has to happen before they are active |
|---|---|
| Texting in to join, including from a QR code | The Member submits the registration form. |
| Added through the API or a webhook | The Member replies Y, unless your account is set up for pre-opt. |
| Bulk upload | Done through Community Support at yourfriends@community.com. |
| Zapier | If you are a Zapier user, you can use Zapier to pass us new Members! For more information, see Zapier Integration Overview. |
| Pre-opt (consent captured at signup in your system) | Configured with your account team, subject to compliance review. |
- For each path you plan to use, add a test device that way.
- Complete the opt-in step for that path as the Member.
- Check that the Member appears in Community with the data and Subcommunities you expect.
A 202 response from the Invite/Update Member API means Community received the request. It does not mean the Member is active. If you add a Member through the API or a webhook and pre-opt is not set up for your account, they stay inactive until they reply Y.
Testing sending messages
- Send a test Campaign to your test Subcommunity, or send a direct message with the Send Message API.
- If you are testing outside Quiet Hours, check how Quiet Hours treats the message type you are sending:
| Message type | Do Quiet Hours apply? |
|---|---|
| Direct messages sent through the API | Yes, unless you override Quiet Hours in the POST request. |
| Automated messages, including Setup Series | Yes, when Do not send message(s) during quiet hours is checked. |
| Campaigns | No. Community asks you to confirm the timing if you schedule during Quiet Hours. |
| Initial onboarding messages | No. |
| System messages such as HELP and STOP replies | No. |
MMS can only be sent from the Community UI, not through the API.
Testing opt-outs
- From a subscribed test device, text STOP. The Member is deactivated for that subscription only. Their profile and opt-out history stay in Community.
- Check that your integration handles the opt-out the way you expect.
After a number texts STOP, it cannot be added again through the API or an import. The Member can still re-subscribe at any time by texting in. To reuse the number for import testing, delete its data (see Cleaning up test data) and then prepare the device again as described in Preparing test devices for repeat opt-in testing.
Cleaning up test data
- To delete a test Member on a 10-digit long code, text HELP from the test device, tap Manage Preferences, scroll to the bottom and select Delete my Data. You can repeat this as often as you need.
- To delete test Members on a short code, email yourfriends@community.com.
- To delete your test Subcommunity, go to Subcommunities, select it, click the ellipsis in the upper right and select Delete Subcommunity.
TK: can this be undone, and what happens to Members in it
Texting STOP does not delete a Member. It only makes them inactive. Use Delete my Data to remove a test Member completely.
How do I use it well?
- Test failures as well as successes. Send requests with missing fields and the wrong client_id, and opt a test device out, so you know how your integration handles each error before a real Member hits it.
- Validate both ends. For data flowing into Community, check the Member record in Community. For events flowing out, check what your system received. A success response on one side does not confirm the other.
- Test every join path you will use, not just the API. Members who text in and Members added by API go through different signup series, so one passing test does not cover the other.
- Keep testing on real mobile numbers. VoIP numbers can hide problems (spam filtering, stripped contact cards) that real Members would not have, or show problems they would not.
Common questions
I don’t see the “API Token” menu option in my Community Settings.
API access is granted at two levels: your account's plan, and your seat. If either is missing, the option does not appear. Contact your account team or yourfriends@community.com. See Getting API access.
My API call is not working.
Check the response code first.
| Cause | How to tell | Fix |
|---|---|---|
| Token missing from the request | 401, "Missing Authorization header" | Send your token as a bearer token in the Authorization header. See Getting API access. |
| Account or seat does not have API access | 401, "Not permitted", or 403, capability_missing | Contact your account team or yourfriends@community.com. |
| Customer ID does not match the token | 403, "Client ID doesn't match in path and JWT" | Use the Customer ID (client_id) for the account the token belongs to. |
| A required field is empty | 422, "[field name] can’t be blank" | Fill in the named field. |
| Endpoint is wrong | 404, Not Found | Check the endpoint against the API documentation. |
| Wrong content type | 415, Unsupported Media Type | Check the request against the API documentation. |
| Request is malformed | 400, Bad Request | Check the request against the API documentation. |
A 202 means the request was accepted.
I sent a New Member request via API and the response back was “202” (accepted), but I’m not seeing the member in my Community.
The Member has not opted in yet. Community received them, but they do not appear as a Member until they reply Y, unless your account is set up for pre-opt. See Testing Member creation flows.
I’m creating a new member via QR code or direct-text in, but they are not showing as a member in my Community.
The Member has not submitted the registration form yet. They appear once they do.
I have connected Formstack, and I have set up “pre-opt,” but I’m still not seeing the member come through to Community (or I see it and there is data missing).
The Formstack integration only reads Formstack's standard fields with their standard names. If you added custom fields or renamed or relabeled standard ones, Community cannot read the form, so the Member is not created or arrives with data missing. Switch back to the standard fields. See Community Formstack Integration.
There is a delay in my campaign being delivered.
| Cause | How to tell | Fix |
|---|---|---|
| Quiet Hours | The message was sent during your Quiet Hours | Messages wait until Quiet Hours end. For automated messages, uncheck Do not send message(s) during quiet hours if you need them to send immediately. See Testing sending messages. |
| A delay in the automation | The delayed message is automated | Check the automation for a delay step you did not intend. |
We use a short-code phone number rather than a 10 digit long code, are there any differences from a testing perspective?
No. Testing works the same way. The one difference is cleanup: to delete test Members on a short code, email yourfriends@community.com. See Cleaning up test data.
How can I delete a Subcommunity after one is created?
Go to Subcommunities, select it, click the ellipsis in the upper right and select Delete Subcommunity. You can delete any Subcommunity you created. The five default Subcommunities (All Members, Favorites, Shopify, Web Visitors and Joined After Calling) cannot be deleted.
I am a partner platform looking for access to an account to test our integration with Community.
If you do not have a Community customer account, email yourfriends@community.com. The team will discuss access for testing and documentation with you.