### GET /v2/fonenumbers Example
Source: https://developer.fonestorm.com/docs/authentication
This example demonstrates how to make a GET request to the /v2/fonenumbers endpoint, including the required authentication token in the headers.
```APIDOC
## GET /v2/fonenumbers
### Description
Retrieves a list of phone numbers associated with the account. Requires a valid authentication token.
### Method
GET
### Endpoint
`/v2/fonenumbers`
### Parameters
#### Request Headers
- **token** (string) - Required - The authentication token.
- **accept** (string) - Required - Should be `application/json`.
### Request Example
#### cURL
```bash
curl --request GET \
--url https://api.fonestorm.com/v2/fonenumbers \
--header 'accept: application/json' \
--header 'token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50Ij...'
```
#### JavaScript (XMLHttpRequest)
```javascript
var data = null;
var xhr = new XMLHttpRequest();
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.fonestorm.com/v2/fonenumbers");
xhr.setRequestHeader("accept", "application/json");
xhr.setRequestHeader("token", "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50Ij...");
xhr.send(data);
```
### Response
#### Success Response (200)
- **example** (object) - An example of a successful response body, containing phone number details.
#### Response Example
```json
{
"example": "[Example response body for /v2/fonenumbers]"
}
```
```
--------------------------------
### Fonestorm Callback Data Example: GET Request
Source: https://developer.fonestorm.com/docs/callbacks
Example of a GET request URL after Fonestorm token substitution for a 'messages/receive_notify' callback. The '((msg))' token is replaced with the actual message content.
```http
GET https://my.example.com/notify.php?message=hello%20world HTTP/1.1
```
--------------------------------
### HTML CTA Example for Website
Source: https://developer.fonestorm.com/docs/10dlc-call-to-action-cta
An example of how to implement a Call to Action (CTA) on a website or landing page using HTML. It includes essential disclosures for SMS messaging, such as message frequency, opt-out instructions, and links to terms and privacy policies. This snippet demonstrates the required consent mechanism and disclosures for user opt-in.
```html
By entering your phone number and clicking “Subscribe,” you agree to receive recurring SMS updates and offers from FracTEL.
Msg & data rates may apply. Text HELP for help, STOP to cancel.
View our Terms and Privacy Policy.
```
--------------------------------
### SMS Opt-in CTA Example
Source: https://developer.fonestorm.com/docs/10dlc-call-to-action-cta
This example illustrates a clear and compliant Call to Action (CTA) for SMS opt-ins. It specifies the keyword to text, the short code, the purpose of the messages, and includes the mandatory disclosures for message and data rates, as well as STOP and HELP instructions. This format is crucial for direct SMS interactions.
```text
Text JOIN to 73737 to receive account alerts and updates from FracTEL. Msg & data rates may apply. Text HELP for help, STOP to cancel.
```
--------------------------------
### Configure Cursor MCP Client
Source: https://developer.fonestorm.com/docs/mcp
This JSON configuration snippet is for setting up the FoneStorm MCP server within the Cursor AI code editor. It specifies the URL for the MCP server to enable direct API access and documentation search.
```json
{
"mcpServers": {
"fonestorm": {
"url": "https://developer.fonestorm.com/mcp"
}
}
}
```
--------------------------------
### Fonestorm Callback Method: GET
Source: https://developer.fonestorm.com/docs/callbacks
Configures Fonestorm callbacks to send data via GET requests. Data is appended as query string parameters to the specified URL after token substitution. Supports HTTP Basic authentication if username and password are provided.
```text
url_method: GET
url: https://my.example.com/notify.php?message=((msg))
url_username:
url_password:
```
--------------------------------
### Making Authenticated GET Request with JavaScript
Source: https://developer.fonestorm.com/docs/authentication
This JavaScript code sample shows how to perform an authenticated GET request to the FracTEL API using the XMLHttpRequest object. It sets the 'accept' and 'token' headers before sending the request to the '/v2/fonenumbers' endpoint. The response is logged to the console. Replace the placeholder token with your valid API token.
```javascript
var data = null;
var xhr = new XMLHttpRequest();
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.fonestorm.com/v2/fonenumbers");
xhr.setRequestHeader("accept", "application/json");
xhr.setRequestHeader("token", "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50Ij...");
xhr.send(data);
```
--------------------------------
### Fonestorm Callback Data Example: POST Request Body
Source: https://developer.fonestorm.com/docs/callbacks
Example of the JSON-encoded body for a POST request in a Fonestorm callback for 'messages/receive_notify'. Includes details like 'to', 'from', 'message', and 'id'.
```json
{"to":"3215551212","from":"3215551111","message":"hello world","id":"0c4055acc5cc2736d818c96f4421b2f5"}
```
--------------------------------
### Making Authenticated GET Request with cURL
Source: https://developer.fonestorm.com/docs/authentication
This snippet demonstrates how to make a GET request to the FracTEL API, specifically to the '/v2/fonenumbers' endpoint, including the required authentication token in the request headers. It utilizes the cURL command-line tool. Ensure you replace the placeholder token with your actual API token.
```curl
curl --request GET \
--url https://api.fonestorm.com/v2/fonenumbers \
--header 'accept: application/json' \
--header 'token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50Ij...'
```
--------------------------------
### Terms of Service Clause for SMS Consent
Source: https://developer.fonestorm.com/docs/10dlc-call-to-action-cta
An example clause for a Terms of Service document that specifically addresses SMS program consent. It ensures that users understand and agree to receive recurring messages, acknowledges message and data rates, provides STOP/HELP instructions, and mentions message frequency and data usage policies. This is vital for legal compliance and documenting user consent.
```text
By providing your mobile number and opting in, you consent to receive recurring marketing and informational text messages from FracTEL. Msg & data rates may apply. Text STOP to unsubscribe, HELP for help. Message frequency may vary. Your information will not be sold or shared.
```
--------------------------------
### Fonestorm Callback Data Example: JSON Request Body
Source: https://developer.fonestorm.com/docs/callbacks
Example of a JSON object payload for a JSON method callback in Fonestorm for 'messages/receive_notify'. It mirrors the structure of the POST request body.
```json
{
"to":"3215551212",
"from":"3215551111",
"message":"hello world",
"id":"0c4055acc5cc2736d818c96f4421b2f5"
}
```
--------------------------------
### Fonestorm Callback Configuration Options
Source: https://developer.fonestorm.com/docs/callbacks
Configuration options for Fonestorm callbacks, specifying the type of notification and associated settings. 'type' can be 'None', 'Callback', or 'Email'. For 'Email', a destination address is required. For 'Callback', a URL is needed.
```text
type: None | Callback | Email
email:
url:
```
--------------------------------
### Callback Configuration API
Source: https://developer.fonestorm.com/docs/callbacks
This section details the configuration of callbacks for receiving event notifications from FoneStorm. It covers general settings, email notifications, and webhook configurations including URL, method, and authentication.
```APIDOC
## General Callback Configuration
### Description
Configure the type of notification FoneStorm will send. Options include 'None' to disable callbacks, 'Callback' for webhooks, or 'Email' for email notifications.
### Method
PUT (Assumed, as it involves configuration)
### Endpoint
/websites/developer_fonestorm/settings/callback
### Parameters
#### Request Body
- **type** (string) - Required - Specifies the notification type. Can be 'None', 'Callback', or 'Email'.
### Request Example
```json
{
"type": "Callback"
}
```
### Response
#### Success Response (200)
- **message** (string) - Confirmation message of the updated setting.
#### Response Example
```json
{
"message": "Callback type updated successfully."
}
```
## Email Notification Configuration
### Description
Configure the destination email address for 'Email' type callbacks.
### Method
PUT (Assumed, as it involves configuration)
### Endpoint
/websites/developer_fonestorm/settings/callback/email
### Parameters
#### Request Body
- **email** (string) - Required - The email address to receive event notifications.
### Request Example
```json
{
"email": "user@example.com"
}
```
### Response
#### Success Response (200)
- **message** (string) - Confirmation message of the updated email setting.
#### Response Example
```json
{
"message": "Email notification address updated successfully."
}
```
## Webhook Callback Configuration
### Description
Configure the URL and method for receiving webhook notifications. Supports optional basic authentication.
### Method
PUT (Assumed, as it involves configuration)
### Endpoint
/websites/developer_fonestorm/settings/callback/webhook
### Parameters
#### Request Body
- **url** (string) - Required - The URL to receive webhook requests. Can include tokens for data substitution.
- **method** (string) - Optional - The HTTP method for the callback. Accepts 'GET', 'POST', or 'JSON'. Defaults to 'POST' if not specified.
- **url_username** (string) - Optional - Username for HTTP Basic authentication.
- **url_password** (string) - Optional - Password for HTTP Basic authentication.
### Request Example
```json
{
"url": "https://my.example.com/notify.php",
"method": "JSON",
"url_username": "myuser",
"url_password": "mypassword"
}
```
### Response
#### Success Response (200)
- **message** (string) - Confirmation message of the updated webhook settings.
#### Response Example
```json
{
"message": "Webhook configuration updated successfully."
}
```
## Data Handling in Callbacks
### Description
Explains how data is transmitted for different callback methods ('GET', 'POST', 'JSON').
### Method
N/A (Informational)
### Endpoint
N/A
### Parameters
(No direct parameters, describes data transmission methods)
### Data Transmission Methods:
#### GET Method
- Data is sent as query string parameters. Token substitution is applied to the `url`.
#### POST Method
- Data is sent as query string parameters and in the request body as a JSON-encoded structure.
- The request header is `application/x-www-form-urlencoded`.
- Token substitution is applied to the `url`.
#### JSON Method
- Data is sent as query string parameters and in the request body as a JSON Object.
- The request header is `application/json`.
- Token substitution is applied to the `url`.
### Examples:
#### GET Example (Token Substitution)
- **URL**: `https://my.example.com/notify.php?message=((msg))`
- **Callback Execution**: `https://my.example.com/notify.php?message=hello%20world`
#### POST Example (JSON Body)
- **URL**: `https://my.example.com/notify.php`
- **Request Body**: `{"to":"3215551212","from":"3215551111","message":"hello world","id":"0c4055acc5cc2736d818c96f4421b2f5"}`
#### JSON Example (JSON Object Body)
- **URL**: `https://my.example.com/notify.php`
- **Request Body**:
```json
{
"to":"3215551212",
"from":"3215551111",
"message":"hello world",
"id":"0c4055acc5cc2736d818c96f4421b2f5"
}
```
```
--------------------------------
### Authentication Token Header
Source: https://developer.fonestorm.com/docs/authentication
All FoneStorm API endpoints, except for creating an authentication token, require a valid token in the request headers. This token is obtained using your username and password via the 'Create Auth Token' endpoint.
```APIDOC
## Request Headers
### Description
Include a valid authentication token in the `token` header for API requests.
### Method
All HTTP methods (GET, POST, PUT, DELETE, etc.)
### Endpoint
All API endpoints (except "Create Auth Token")
### Parameters
#### Request Headers
- **token** (string) - Required - The authentication token generated from your FracTEL account.
### Request Example
```json
{
"headers": {
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50Ij..."
}
}
```
### Response
#### Error Response (401 Unauthorized)
- **message** (string) - Indicates that the token is invalid or missing.
```
--------------------------------
### Fonestorm Callback Method: POST
Source: https://developer.fonestorm.com/docs/callbacks
Configures Fonestorm callbacks to send data via POST requests. Data includes query string parameters and a JSON-encoded structure in the request body. The Content-Type header is 'application/x-www-form-urlencoded'. Supports HTTP Basic authentication.
```text
url_method: POST
url: https://my.example.com/notify.php
url_username:
url_password:
```
--------------------------------
### Fonestorm Callback Method: JSON
Source: https://developer.fonestorm.com/docs/callbacks
Configures Fonestorm callbacks to send data via POST requests with a JSON payload. Data is appended as query string parameters to the URL and also provided as a JSON object in the request body. Supports HTTP Basic authentication.
```text
url_method: JSON
url: https://my.example.com/notify.php
url_username:
url_password:
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.