> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.pinnacle.sh/v-2/api-reference/messages/simulate-user/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.pinnacle.sh/_mcp/server. # Simulate Inbound User Event POST https://api.pinnacle.sh/messages/simulate/user Content-Type: application/json Simulate inbound messages and button presses from a user. Reference: https://docs.pinnacle.sh/api-reference/messages/simulate-user ## Authentication - `PINNACLE-API-KEY` header (required) — API Key authentication via header ## Request ### Body (application/json) This endpoint expects a SimulateUserRequest. - `SimulateUserRequest` ## Response ### 200 Returns simulation result. - `success` (boolean, required) ## Errors ### 400 Bad Request Error The request was unacceptable, often due to providing an invalid update. Errors may originate from invalid payload or from Pinnacle's additional validation checks. For example, providing an URL that cannot be accessed, updating a campaign that is currently being reviewed, updating data that you cannot access, sending a malformed message, and so on. For `Pinnacle Validation Error` inspect the `error` payload to determine the source of the failure. These errors are likely due to additional validation and business logic checks. For `Request Validation Error` inspect the `description` and `errors` payload to determine the source of failure. These errors are likely due to invalid payload inside the request. - `SimulateInboundUserEventRequestBadRequestError` ### 401 Unauthorized Error The request lacks valid authentication credentials or the provided credentials are invalid. Ensure you're including a valid API key in the request headers and that your account has the necessary permissions to access this endpoint. - `error` (string, required) — Human-readable description of the error that occurred, corresponding to the HTTP status code. ### 403 Forbidden Error Your subscription does not include access to this feature. This occurs when attempting to use functionality that requires a higher subscription tier. Please upgrade your subscription to access this feature. - `error` (string, required) — Human-readable description of the error that occurred, corresponding to the HTTP status code. ### 500 Internal Server Error An unexpected error occurred on Pinnacle's servers while processing your request. If this error persists, please contact support with the request details. - `error` (string, required) — Human-readable description of the error that occurred, corresponding to the HTTP status code. ## Types ### SimulateUserMessageRequest Simulate an inbound message from a user. - `from` (string, required) — User phone number in E.164 format. - `to` (string, required) — Receiver phone number in E.164 format or RCS agent ID (prefixed with `agent_`). - `message` (SimulateMessageInput, required) — User message payload. At least one of `text` or `mediaUrls` must be non-empty. Send only `text` to simulate an inbound SMS; include `mediaUrls` to simulate an inbound MMS. ### SimulateUserButtonRequest Simulate a button press from a user. - `from` (string, required) — User phone number in E.164 format. - `to` (string, required) — RCS agent ID (prefixed with `agent_`). - `button` (UserButtonPress, required) — Discriminated union of button presses that can be simulated for a user. ### ZodError - `description` (string, required) — Human-readable summary of validation failures. - `errors` (ZodErrorErrors, required) — Structured dictionary of issues containing two main sections: - `errors`: Array of global validation errors not tied to specific fields - `properties`: Object mapping field names to their specific validation errors, where each field contains an `errors` array ### Error Standard error response returned when a request cannot be processed successfully. - `error` (string, required) — Human-readable description of the error that occurred, corresponding to the HTTP status code. ### SimulateMessageInput User message payload. At least one of `text` or `mediaUrls` must be non-empty. Send only `text` to simulate an inbound SMS; include `mediaUrls` to simulate an inbound MMS. - `text` (string, optional) — Text message sent by the user. - `mediaUrls` (list of string, optional) — URLs of media files sent by the user. ### UserButtonPress Discriminated union of button presses that can be simulated for a user. - `type`: `trigger` (trigger) - `title` (string, required) — Name of the button that you want to press. - `metadata` (string, optional, default: metadata) — Metadata attached to the button. - `payload` (string, optional, default: trigger-payload) — Button's postback payload. - `type`: `openUrl` (openUrl) - `title` (string, required) — Name of the button that you want to press. - `metadata` (string, optional, default: metadata) — Metadata attached to the button. - `payload` (string, optional, default: https://www.pinnacle.sh/) — Destination URL of the tapped button. - `type`: `call` (call) - `title` (string, required) — Name of the button that you want to press. - `metadata` (string, optional, default: metadata) — Metadata attached to the button. - `payload` (string, optional, default: +15555555555) — Destination phone number in E.164 format. - `type`: `scheduleEvent` (scheduleEvent) - `title` (string, required) — Name of the button that you want to press. - `eventDescription` (string, optional, default: Event Description) - `eventEndTime` (string, optional) — ISO 8601 end time. Defaults to one hour after `eventStartTime`. - `eventStartTime` (string, optional) — ISO 8601 start time. Defaults to the current time. - `eventTitle` (string, optional, default: Scheduled Event) - `metadata` (string, optional, default: metadata) — Metadata attached to the button. - `type`: `sendLocation` (sendLocation) - `title` (string, required) — Name of the button that you want to press. - `latLong` (UserButtonPressDiscriminatorMappingSendLocationLatLong, optional) — Shared coordinates. - `metadata` (string, optional, default: metadata) — Metadata attached to the button. - `name` (string, optional, default: Shared Location) — Name of the location shared. - `type`: `requestUserLocation` (requestUserLocation) - `title` (string, required) — Name of the button that you want to press. - `location` (UserButtonPressDiscriminatorMappingRequestUserLocationLocation, optional) — Location the simulated user responded with. - `metadata` (string, optional, default: metadata) — Metadata attached to the button. ### ZodErrorErrors Structured dictionary of issues containing two main sections: - `errors`: Array of global validation errors not tied to specific fields - `properties`: Object mapping field names to their specific validation errors, where each field contains an `errors` array ### UserButtonPressDiscriminatorMappingSendLocationLatLong Shared coordinates. - `lat` (double, optional, default: 37.7899) — Latitude of the shared location. - `lng` (double, optional, default: -122.3969) — Longitude of the shared location. ### UserButtonPressDiscriminatorMappingRequestUserLocationLocation Location the simulated user responded with. - `text` (string, optional, default: Location Provided) - `latitude` (double, optional, default: 37.7899) - `longitude` (double, optional, default: -122.3969) - `address` (string, optional, default: 415 Mission St, San Francisco, CA 94105) ## Examples ### Send text message **Request** ```json { "from": "+14155551234", "to": "+14155555678", "message": { "text": "Hello from the test user!" } } ``` **Response** ```json { "success": true } ``` **SDK Code** ```python Send text message import requests url = "https://api.pinnacle.sh/messages/simulate/user" payload = { "from": "+14155551234", "to": "+14155555678", "message": { "text": "Hello from the test user!" } } headers = { "PINNACLE-API-KEY": "", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript Send text message const url = 'https://api.pinnacle.sh/messages/simulate/user'; const options = { method: 'POST', headers: {'PINNACLE-API-KEY': '', 'Content-Type': 'application/json'}, body: '{"from":"+14155551234","to":"+14155555678","message":{"text":"Hello from the test user!"}}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Send text message package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.pinnacle.sh/messages/simulate/user" payload := strings.NewReader("{\n \"from\": \"+14155551234\",\n \"to\": \"+14155555678\",\n \"message\": {\n \"text\": \"Hello from the test user!\"\n }\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("PINNACLE-API-KEY", "") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Send text message require 'uri' require 'net/http' url = URI("https://api.pinnacle.sh/messages/simulate/user") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["PINNACLE-API-KEY"] = '' request["Content-Type"] = 'application/json' request.body = "{\n \"from\": \"+14155551234\",\n \"to\": \"+14155555678\",\n \"message\": {\n \"text\": \"Hello from the test user!\"\n }\n}" response = http.request(request) puts response.read_body ``` ```java Send text message import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.pinnacle.sh/messages/simulate/user") .header("PINNACLE-API-KEY", "") .header("Content-Type", "application/json") .body("{\n \"from\": \"+14155551234\",\n \"to\": \"+14155555678\",\n \"message\": {\n \"text\": \"Hello from the test user!\"\n }\n}") .asString(); ``` ```php Send text message request('POST', 'https://api.pinnacle.sh/messages/simulate/user', [ 'body' => '{ "from": "+14155551234", "to": "+14155555678", "message": { "text": "Hello from the test user!" } }', 'headers' => [ 'Content-Type' => 'application/json', 'PINNACLE-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp Send text message using RestSharp; var client = new RestClient("https://api.pinnacle.sh/messages/simulate/user"); var request = new RestRequest(Method.POST); request.AddHeader("PINNACLE-API-KEY", ""); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"from\": \"+14155551234\",\n \"to\": \"+14155555678\",\n \"message\": {\n \"text\": \"Hello from the test user!\"\n }\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Send text message import Foundation let headers = [ "PINNACLE-API-KEY": "", "Content-Type": "application/json" ] let parameters = [ "from": "+14155551234", "to": "+14155555678", "message": ["text": "Hello from the test user!"] ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.pinnacle.sh/messages/simulate/user")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` ### Send media **Request** ```json { "from": "+14155551234", "to": "+14155555678", "message": { "mediaUrls": [ "https://example.com/image.jpg" ] } } ``` **Response** ```json { "success": true } ``` **SDK Code** ```python Send media import requests url = "https://api.pinnacle.sh/messages/simulate/user" payload = { "from": "+14155551234", "to": "+14155555678", "message": { "mediaUrls": ["https://example.com/image.jpg"] } } headers = { "PINNACLE-API-KEY": "", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript Send media const url = 'https://api.pinnacle.sh/messages/simulate/user'; const options = { method: 'POST', headers: {'PINNACLE-API-KEY': '', 'Content-Type': 'application/json'}, body: '{"from":"+14155551234","to":"+14155555678","message":{"mediaUrls":["https://example.com/image.jpg"]}}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Send media package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.pinnacle.sh/messages/simulate/user" payload := strings.NewReader("{\n \"from\": \"+14155551234\",\n \"to\": \"+14155555678\",\n \"message\": {\n \"mediaUrls\": [\n \"https://example.com/image.jpg\"\n ]\n }\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("PINNACLE-API-KEY", "") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Send media require 'uri' require 'net/http' url = URI("https://api.pinnacle.sh/messages/simulate/user") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["PINNACLE-API-KEY"] = '' request["Content-Type"] = 'application/json' request.body = "{\n \"from\": \"+14155551234\",\n \"to\": \"+14155555678\",\n \"message\": {\n \"mediaUrls\": [\n \"https://example.com/image.jpg\"\n ]\n }\n}" response = http.request(request) puts response.read_body ``` ```java Send media import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.pinnacle.sh/messages/simulate/user") .header("PINNACLE-API-KEY", "") .header("Content-Type", "application/json") .body("{\n \"from\": \"+14155551234\",\n \"to\": \"+14155555678\",\n \"message\": {\n \"mediaUrls\": [\n \"https://example.com/image.jpg\"\n ]\n }\n}") .asString(); ``` ```php Send media request('POST', 'https://api.pinnacle.sh/messages/simulate/user', [ 'body' => '{ "from": "+14155551234", "to": "+14155555678", "message": { "mediaUrls": [ "https://example.com/image.jpg" ] } }', 'headers' => [ 'Content-Type' => 'application/json', 'PINNACLE-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp Send media using RestSharp; var client = new RestClient("https://api.pinnacle.sh/messages/simulate/user"); var request = new RestRequest(Method.POST); request.AddHeader("PINNACLE-API-KEY", ""); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"from\": \"+14155551234\",\n \"to\": \"+14155555678\",\n \"message\": {\n \"mediaUrls\": [\n \"https://example.com/image.jpg\"\n ]\n }\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Send media import Foundation let headers = [ "PINNACLE-API-KEY": "", "Content-Type": "application/json" ] let parameters = [ "from": "+14155551234", "to": "+14155555678", "message": ["mediaUrls": ["https://example.com/image.jpg"]] ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.pinnacle.sh/messages/simulate/user")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` ### Send text and media **Request** ```json { "from": "+14155551234", "to": "+14155555678", "message": { "text": "Check this out", "mediaUrls": [ "https://example.com/image.jpg" ] } } ``` **Response** ```json { "success": true } ``` **SDK Code** ```python Send text and media import requests url = "https://api.pinnacle.sh/messages/simulate/user" payload = { "from": "+14155551234", "to": "+14155555678", "message": { "text": "Check this out", "mediaUrls": ["https://example.com/image.jpg"] } } headers = { "PINNACLE-API-KEY": "", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript Send text and media const url = 'https://api.pinnacle.sh/messages/simulate/user'; const options = { method: 'POST', headers: {'PINNACLE-API-KEY': '', 'Content-Type': 'application/json'}, body: '{"from":"+14155551234","to":"+14155555678","message":{"text":"Check this out","mediaUrls":["https://example.com/image.jpg"]}}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Send text and media package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.pinnacle.sh/messages/simulate/user" payload := strings.NewReader("{\n \"from\": \"+14155551234\",\n \"to\": \"+14155555678\",\n \"message\": {\n \"text\": \"Check this out\",\n \"mediaUrls\": [\n \"https://example.com/image.jpg\"\n ]\n }\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("PINNACLE-API-KEY", "") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Send text and media require 'uri' require 'net/http' url = URI("https://api.pinnacle.sh/messages/simulate/user") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["PINNACLE-API-KEY"] = '' request["Content-Type"] = 'application/json' request.body = "{\n \"from\": \"+14155551234\",\n \"to\": \"+14155555678\",\n \"message\": {\n \"text\": \"Check this out\",\n \"mediaUrls\": [\n \"https://example.com/image.jpg\"\n ]\n }\n}" response = http.request(request) puts response.read_body ``` ```java Send text and media import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.pinnacle.sh/messages/simulate/user") .header("PINNACLE-API-KEY", "") .header("Content-Type", "application/json") .body("{\n \"from\": \"+14155551234\",\n \"to\": \"+14155555678\",\n \"message\": {\n \"text\": \"Check this out\",\n \"mediaUrls\": [\n \"https://example.com/image.jpg\"\n ]\n }\n}") .asString(); ``` ```php Send text and media request('POST', 'https://api.pinnacle.sh/messages/simulate/user', [ 'body' => '{ "from": "+14155551234", "to": "+14155555678", "message": { "text": "Check this out", "mediaUrls": [ "https://example.com/image.jpg" ] } }', 'headers' => [ 'Content-Type' => 'application/json', 'PINNACLE-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp Send text and media using RestSharp; var client = new RestClient("https://api.pinnacle.sh/messages/simulate/user"); var request = new RestRequest(Method.POST); request.AddHeader("PINNACLE-API-KEY", ""); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"from\": \"+14155551234\",\n \"to\": \"+14155555678\",\n \"message\": {\n \"text\": \"Check this out\",\n \"mediaUrls\": [\n \"https://example.com/image.jpg\"\n ]\n }\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Send text and media import Foundation let headers = [ "PINNACLE-API-KEY": "", "Content-Type": "application/json" ] let parameters = [ "from": "+14155551234", "to": "+14155555678", "message": [ "text": "Check this out", "mediaUrls": ["https://example.com/image.jpg"] ] ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.pinnacle.sh/messages/simulate/user")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` ### Press trigger button **Request** ```json { "from": "+14155551234", "to": "agent_abc123", "button": { "type": "trigger", "title": "Sign Up", "payload": "user_clicked_signup" } } ``` **Response** ```json { "success": true } ``` **SDK Code** ```python Press trigger button import requests url = "https://api.pinnacle.sh/messages/simulate/user" payload = { "from": "+14155551234", "to": "agent_abc123", "button": { "type": "trigger", "title": "Sign Up", "payload": "user_clicked_signup" } } headers = { "PINNACLE-API-KEY": "", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript Press trigger button const url = 'https://api.pinnacle.sh/messages/simulate/user'; const options = { method: 'POST', headers: {'PINNACLE-API-KEY': '', 'Content-Type': 'application/json'}, body: '{"from":"+14155551234","to":"agent_abc123","button":{"type":"trigger","title":"Sign Up","payload":"user_clicked_signup"}}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Press trigger button package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.pinnacle.sh/messages/simulate/user" payload := strings.NewReader("{\n \"from\": \"+14155551234\",\n \"to\": \"agent_abc123\",\n \"button\": {\n \"type\": \"trigger\",\n \"title\": \"Sign Up\",\n \"payload\": \"user_clicked_signup\"\n }\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("PINNACLE-API-KEY", "") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Press trigger button require 'uri' require 'net/http' url = URI("https://api.pinnacle.sh/messages/simulate/user") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["PINNACLE-API-KEY"] = '' request["Content-Type"] = 'application/json' request.body = "{\n \"from\": \"+14155551234\",\n \"to\": \"agent_abc123\",\n \"button\": {\n \"type\": \"trigger\",\n \"title\": \"Sign Up\",\n \"payload\": \"user_clicked_signup\"\n }\n}" response = http.request(request) puts response.read_body ``` ```java Press trigger button import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.pinnacle.sh/messages/simulate/user") .header("PINNACLE-API-KEY", "") .header("Content-Type", "application/json") .body("{\n \"from\": \"+14155551234\",\n \"to\": \"agent_abc123\",\n \"button\": {\n \"type\": \"trigger\",\n \"title\": \"Sign Up\",\n \"payload\": \"user_clicked_signup\"\n }\n}") .asString(); ``` ```php Press trigger button request('POST', 'https://api.pinnacle.sh/messages/simulate/user', [ 'body' => '{ "from": "+14155551234", "to": "agent_abc123", "button": { "type": "trigger", "title": "Sign Up", "payload": "user_clicked_signup" } }', 'headers' => [ 'Content-Type' => 'application/json', 'PINNACLE-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp Press trigger button using RestSharp; var client = new RestClient("https://api.pinnacle.sh/messages/simulate/user"); var request = new RestRequest(Method.POST); request.AddHeader("PINNACLE-API-KEY", ""); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"from\": \"+14155551234\",\n \"to\": \"agent_abc123\",\n \"button\": {\n \"type\": \"trigger\",\n \"title\": \"Sign Up\",\n \"payload\": \"user_clicked_signup\"\n }\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Press trigger button import Foundation let headers = [ "PINNACLE-API-KEY": "", "Content-Type": "application/json" ] let parameters = [ "from": "+14155551234", "to": "agent_abc123", "button": [ "type": "trigger", "title": "Sign Up", "payload": "user_clicked_signup" ] ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.pinnacle.sh/messages/simulate/user")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` ### Press open URL button **Request** ```json { "from": "+14155551234", "to": "agent_abc123", "button": { "type": "openUrl", "title": "Visit Website" } } ``` **Response** ```json { "success": true } ``` **SDK Code** ```python Press open URL button import requests url = "https://api.pinnacle.sh/messages/simulate/user" payload = { "from": "+14155551234", "to": "agent_abc123", "button": { "type": "openUrl", "title": "Visit Website" } } headers = { "PINNACLE-API-KEY": "", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript Press open URL button const url = 'https://api.pinnacle.sh/messages/simulate/user'; const options = { method: 'POST', headers: {'PINNACLE-API-KEY': '', 'Content-Type': 'application/json'}, body: '{"from":"+14155551234","to":"agent_abc123","button":{"type":"openUrl","title":"Visit Website"}}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Press open URL button package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.pinnacle.sh/messages/simulate/user" payload := strings.NewReader("{\n \"from\": \"+14155551234\",\n \"to\": \"agent_abc123\",\n \"button\": {\n \"type\": \"openUrl\",\n \"title\": \"Visit Website\"\n }\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("PINNACLE-API-KEY", "") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Press open URL button require 'uri' require 'net/http' url = URI("https://api.pinnacle.sh/messages/simulate/user") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["PINNACLE-API-KEY"] = '' request["Content-Type"] = 'application/json' request.body = "{\n \"from\": \"+14155551234\",\n \"to\": \"agent_abc123\",\n \"button\": {\n \"type\": \"openUrl\",\n \"title\": \"Visit Website\"\n }\n}" response = http.request(request) puts response.read_body ``` ```java Press open URL button import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.pinnacle.sh/messages/simulate/user") .header("PINNACLE-API-KEY", "") .header("Content-Type", "application/json") .body("{\n \"from\": \"+14155551234\",\n \"to\": \"agent_abc123\",\n \"button\": {\n \"type\": \"openUrl\",\n \"title\": \"Visit Website\"\n }\n}") .asString(); ``` ```php Press open URL button request('POST', 'https://api.pinnacle.sh/messages/simulate/user', [ 'body' => '{ "from": "+14155551234", "to": "agent_abc123", "button": { "type": "openUrl", "title": "Visit Website" } }', 'headers' => [ 'Content-Type' => 'application/json', 'PINNACLE-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp Press open URL button using RestSharp; var client = new RestClient("https://api.pinnacle.sh/messages/simulate/user"); var request = new RestRequest(Method.POST); request.AddHeader("PINNACLE-API-KEY", ""); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"from\": \"+14155551234\",\n \"to\": \"agent_abc123\",\n \"button\": {\n \"type\": \"openUrl\",\n \"title\": \"Visit Website\"\n }\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Press open URL button import Foundation let headers = [ "PINNACLE-API-KEY": "", "Content-Type": "application/json" ] let parameters = [ "from": "+14155551234", "to": "agent_abc123", "button": [ "type": "openUrl", "title": "Visit Website" ] ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.pinnacle.sh/messages/simulate/user")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` ### Press call button **Request** ```json { "from": "+14155551234", "to": "agent_abc123", "button": { "type": "call", "title": "Call Us", "payload": "+15555555555" } } ``` **Response** ```json { "success": true } ``` **SDK Code** ```python Press call button import requests url = "https://api.pinnacle.sh/messages/simulate/user" payload = { "from": "+14155551234", "to": "agent_abc123", "button": { "type": "call", "title": "Call Us", "payload": "+15555555555" } } headers = { "PINNACLE-API-KEY": "", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript Press call button const url = 'https://api.pinnacle.sh/messages/simulate/user'; const options = { method: 'POST', headers: {'PINNACLE-API-KEY': '', 'Content-Type': 'application/json'}, body: '{"from":"+14155551234","to":"agent_abc123","button":{"type":"call","title":"Call Us","payload":"+15555555555"}}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Press call button package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.pinnacle.sh/messages/simulate/user" payload := strings.NewReader("{\n \"from\": \"+14155551234\",\n \"to\": \"agent_abc123\",\n \"button\": {\n \"type\": \"call\",\n \"title\": \"Call Us\",\n \"payload\": \"+15555555555\"\n }\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("PINNACLE-API-KEY", "") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Press call button require 'uri' require 'net/http' url = URI("https://api.pinnacle.sh/messages/simulate/user") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["PINNACLE-API-KEY"] = '' request["Content-Type"] = 'application/json' request.body = "{\n \"from\": \"+14155551234\",\n \"to\": \"agent_abc123\",\n \"button\": {\n \"type\": \"call\",\n \"title\": \"Call Us\",\n \"payload\": \"+15555555555\"\n }\n}" response = http.request(request) puts response.read_body ``` ```java Press call button import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.pinnacle.sh/messages/simulate/user") .header("PINNACLE-API-KEY", "") .header("Content-Type", "application/json") .body("{\n \"from\": \"+14155551234\",\n \"to\": \"agent_abc123\",\n \"button\": {\n \"type\": \"call\",\n \"title\": \"Call Us\",\n \"payload\": \"+15555555555\"\n }\n}") .asString(); ``` ```php Press call button request('POST', 'https://api.pinnacle.sh/messages/simulate/user', [ 'body' => '{ "from": "+14155551234", "to": "agent_abc123", "button": { "type": "call", "title": "Call Us", "payload": "+15555555555" } }', 'headers' => [ 'Content-Type' => 'application/json', 'PINNACLE-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp Press call button using RestSharp; var client = new RestClient("https://api.pinnacle.sh/messages/simulate/user"); var request = new RestRequest(Method.POST); request.AddHeader("PINNACLE-API-KEY", ""); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"from\": \"+14155551234\",\n \"to\": \"agent_abc123\",\n \"button\": {\n \"type\": \"call\",\n \"title\": \"Call Us\",\n \"payload\": \"+15555555555\"\n }\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Press call button import Foundation let headers = [ "PINNACLE-API-KEY": "", "Content-Type": "application/json" ] let parameters = [ "from": "+14155551234", "to": "agent_abc123", "button": [ "type": "call", "title": "Call Us", "payload": "+15555555555" ] ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.pinnacle.sh/messages/simulate/user")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` ### Press scheduled event button **Request** ```json { "from": "+14155551234", "to": "agent_abc123", "button": { "type": "scheduleEvent", "title": "Add to Calendar", "eventTitle": "Pinnacle Workshop", "eventStartTime": "2025-12-12T10:00:00Z", "eventEndTime": "2025-12-12T11:00:00Z" } } ``` **Response** ```json { "success": true } ``` **SDK Code** ```python Press scheduled event button import requests url = "https://api.pinnacle.sh/messages/simulate/user" payload = { "from": "+14155551234", "to": "agent_abc123", "button": { "type": "scheduleEvent", "title": "Add to Calendar", "eventTitle": "Pinnacle Workshop", "eventStartTime": "2025-12-12T10:00:00Z", "eventEndTime": "2025-12-12T11:00:00Z" } } headers = { "PINNACLE-API-KEY": "", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript Press scheduled event button const url = 'https://api.pinnacle.sh/messages/simulate/user'; const options = { method: 'POST', headers: {'PINNACLE-API-KEY': '', 'Content-Type': 'application/json'}, body: '{"from":"+14155551234","to":"agent_abc123","button":{"type":"scheduleEvent","title":"Add to Calendar","eventTitle":"Pinnacle Workshop","eventStartTime":"2025-12-12T10:00:00Z","eventEndTime":"2025-12-12T11:00:00Z"}}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Press scheduled event button package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.pinnacle.sh/messages/simulate/user" payload := strings.NewReader("{\n \"from\": \"+14155551234\",\n \"to\": \"agent_abc123\",\n \"button\": {\n \"type\": \"scheduleEvent\",\n \"title\": \"Add to Calendar\",\n \"eventTitle\": \"Pinnacle Workshop\",\n \"eventStartTime\": \"2025-12-12T10:00:00Z\",\n \"eventEndTime\": \"2025-12-12T11:00:00Z\"\n }\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("PINNACLE-API-KEY", "") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Press scheduled event button require 'uri' require 'net/http' url = URI("https://api.pinnacle.sh/messages/simulate/user") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["PINNACLE-API-KEY"] = '' request["Content-Type"] = 'application/json' request.body = "{\n \"from\": \"+14155551234\",\n \"to\": \"agent_abc123\",\n \"button\": {\n \"type\": \"scheduleEvent\",\n \"title\": \"Add to Calendar\",\n \"eventTitle\": \"Pinnacle Workshop\",\n \"eventStartTime\": \"2025-12-12T10:00:00Z\",\n \"eventEndTime\": \"2025-12-12T11:00:00Z\"\n }\n}" response = http.request(request) puts response.read_body ``` ```java Press scheduled event button import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.pinnacle.sh/messages/simulate/user") .header("PINNACLE-API-KEY", "") .header("Content-Type", "application/json") .body("{\n \"from\": \"+14155551234\",\n \"to\": \"agent_abc123\",\n \"button\": {\n \"type\": \"scheduleEvent\",\n \"title\": \"Add to Calendar\",\n \"eventTitle\": \"Pinnacle Workshop\",\n \"eventStartTime\": \"2025-12-12T10:00:00Z\",\n \"eventEndTime\": \"2025-12-12T11:00:00Z\"\n }\n}") .asString(); ``` ```php Press scheduled event button request('POST', 'https://api.pinnacle.sh/messages/simulate/user', [ 'body' => '{ "from": "+14155551234", "to": "agent_abc123", "button": { "type": "scheduleEvent", "title": "Add to Calendar", "eventTitle": "Pinnacle Workshop", "eventStartTime": "2025-12-12T10:00:00Z", "eventEndTime": "2025-12-12T11:00:00Z" } }', 'headers' => [ 'Content-Type' => 'application/json', 'PINNACLE-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp Press scheduled event button using RestSharp; var client = new RestClient("https://api.pinnacle.sh/messages/simulate/user"); var request = new RestRequest(Method.POST); request.AddHeader("PINNACLE-API-KEY", ""); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"from\": \"+14155551234\",\n \"to\": \"agent_abc123\",\n \"button\": {\n \"type\": \"scheduleEvent\",\n \"title\": \"Add to Calendar\",\n \"eventTitle\": \"Pinnacle Workshop\",\n \"eventStartTime\": \"2025-12-12T10:00:00Z\",\n \"eventEndTime\": \"2025-12-12T11:00:00Z\"\n }\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Press scheduled event button import Foundation let headers = [ "PINNACLE-API-KEY": "", "Content-Type": "application/json" ] let parameters = [ "from": "+14155551234", "to": "agent_abc123", "button": [ "type": "scheduleEvent", "title": "Add to Calendar", "eventTitle": "Pinnacle Workshop", "eventStartTime": "2025-12-12T10:00:00Z", "eventEndTime": "2025-12-12T11:00:00Z" ] ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.pinnacle.sh/messages/simulate/user")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` ### Press send location button **Request** ```json { "from": "+14155551234", "to": "agent_abc123", "button": { "type": "sendLocation", "title": "View Location", "name": "Pinnacle HQ", "latLong": { "lat": 37.7899, "lng": -122.3969 } } } ``` **Response** ```json { "success": true } ``` **SDK Code** ```python Press send location button import requests url = "https://api.pinnacle.sh/messages/simulate/user" payload = { "from": "+14155551234", "to": "agent_abc123", "button": { "type": "sendLocation", "title": "View Location", "name": "Pinnacle HQ", "latLong": { "lat": 37.7899, "lng": -122.3969 } } } headers = { "PINNACLE-API-KEY": "", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript Press send location button const url = 'https://api.pinnacle.sh/messages/simulate/user'; const options = { method: 'POST', headers: {'PINNACLE-API-KEY': '', 'Content-Type': 'application/json'}, body: '{"from":"+14155551234","to":"agent_abc123","button":{"type":"sendLocation","title":"View Location","name":"Pinnacle HQ","latLong":{"lat":37.7899,"lng":-122.3969}}}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Press send location button package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.pinnacle.sh/messages/simulate/user" payload := strings.NewReader("{\n \"from\": \"+14155551234\",\n \"to\": \"agent_abc123\",\n \"button\": {\n \"type\": \"sendLocation\",\n \"title\": \"View Location\",\n \"name\": \"Pinnacle HQ\",\n \"latLong\": {\n \"lat\": 37.7899,\n \"lng\": -122.3969\n }\n }\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("PINNACLE-API-KEY", "") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Press send location button require 'uri' require 'net/http' url = URI("https://api.pinnacle.sh/messages/simulate/user") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["PINNACLE-API-KEY"] = '' request["Content-Type"] = 'application/json' request.body = "{\n \"from\": \"+14155551234\",\n \"to\": \"agent_abc123\",\n \"button\": {\n \"type\": \"sendLocation\",\n \"title\": \"View Location\",\n \"name\": \"Pinnacle HQ\",\n \"latLong\": {\n \"lat\": 37.7899,\n \"lng\": -122.3969\n }\n }\n}" response = http.request(request) puts response.read_body ``` ```java Press send location button import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.pinnacle.sh/messages/simulate/user") .header("PINNACLE-API-KEY", "") .header("Content-Type", "application/json") .body("{\n \"from\": \"+14155551234\",\n \"to\": \"agent_abc123\",\n \"button\": {\n \"type\": \"sendLocation\",\n \"title\": \"View Location\",\n \"name\": \"Pinnacle HQ\",\n \"latLong\": {\n \"lat\": 37.7899,\n \"lng\": -122.3969\n }\n }\n}") .asString(); ``` ```php Press send location button request('POST', 'https://api.pinnacle.sh/messages/simulate/user', [ 'body' => '{ "from": "+14155551234", "to": "agent_abc123", "button": { "type": "sendLocation", "title": "View Location", "name": "Pinnacle HQ", "latLong": { "lat": 37.7899, "lng": -122.3969 } } }', 'headers' => [ 'Content-Type' => 'application/json', 'PINNACLE-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp Press send location button using RestSharp; var client = new RestClient("https://api.pinnacle.sh/messages/simulate/user"); var request = new RestRequest(Method.POST); request.AddHeader("PINNACLE-API-KEY", ""); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"from\": \"+14155551234\",\n \"to\": \"agent_abc123\",\n \"button\": {\n \"type\": \"sendLocation\",\n \"title\": \"View Location\",\n \"name\": \"Pinnacle HQ\",\n \"latLong\": {\n \"lat\": 37.7899,\n \"lng\": -122.3969\n }\n }\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Press send location button import Foundation let headers = [ "PINNACLE-API-KEY": "", "Content-Type": "application/json" ] let parameters = [ "from": "+14155551234", "to": "agent_abc123", "button": [ "type": "sendLocation", "title": "View Location", "name": "Pinnacle HQ", "latLong": [ "lat": 37.7899, "lng": -122.3969 ] ] ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.pinnacle.sh/messages/simulate/user")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` ### Press request location button **Request** ```json { "from": "+14155551234", "to": "agent_abc123", "button": { "type": "requestUserLocation", "title": "Share Location" } } ``` **Response** ```json { "success": true } ``` **SDK Code** ```python Press request location button import requests url = "https://api.pinnacle.sh/messages/simulate/user" payload = { "from": "+14155551234", "to": "agent_abc123", "button": { "type": "requestUserLocation", "title": "Share Location" } } headers = { "PINNACLE-API-KEY": "", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript Press request location button const url = 'https://api.pinnacle.sh/messages/simulate/user'; const options = { method: 'POST', headers: {'PINNACLE-API-KEY': '', 'Content-Type': 'application/json'}, body: '{"from":"+14155551234","to":"agent_abc123","button":{"type":"requestUserLocation","title":"Share Location"}}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Press request location button package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.pinnacle.sh/messages/simulate/user" payload := strings.NewReader("{\n \"from\": \"+14155551234\",\n \"to\": \"agent_abc123\",\n \"button\": {\n \"type\": \"requestUserLocation\",\n \"title\": \"Share Location\"\n }\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("PINNACLE-API-KEY", "") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Press request location button require 'uri' require 'net/http' url = URI("https://api.pinnacle.sh/messages/simulate/user") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["PINNACLE-API-KEY"] = '' request["Content-Type"] = 'application/json' request.body = "{\n \"from\": \"+14155551234\",\n \"to\": \"agent_abc123\",\n \"button\": {\n \"type\": \"requestUserLocation\",\n \"title\": \"Share Location\"\n }\n}" response = http.request(request) puts response.read_body ``` ```java Press request location button import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.pinnacle.sh/messages/simulate/user") .header("PINNACLE-API-KEY", "") .header("Content-Type", "application/json") .body("{\n \"from\": \"+14155551234\",\n \"to\": \"agent_abc123\",\n \"button\": {\n \"type\": \"requestUserLocation\",\n \"title\": \"Share Location\"\n }\n}") .asString(); ``` ```php Press request location button request('POST', 'https://api.pinnacle.sh/messages/simulate/user', [ 'body' => '{ "from": "+14155551234", "to": "agent_abc123", "button": { "type": "requestUserLocation", "title": "Share Location" } }', 'headers' => [ 'Content-Type' => 'application/json', 'PINNACLE-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp Press request location button using RestSharp; var client = new RestClient("https://api.pinnacle.sh/messages/simulate/user"); var request = new RestRequest(Method.POST); request.AddHeader("PINNACLE-API-KEY", ""); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"from\": \"+14155551234\",\n \"to\": \"agent_abc123\",\n \"button\": {\n \"type\": \"requestUserLocation\",\n \"title\": \"Share Location\"\n }\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Press request location button import Foundation let headers = [ "PINNACLE-API-KEY": "", "Content-Type": "application/json" ] let parameters = [ "from": "+14155551234", "to": "agent_abc123", "button": [ "type": "requestUserLocation", "title": "Share Location" ] ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.pinnacle.sh/messages/simulate/user")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` > One API for RCS, iMessage, MMS, and SMS. Build, test, and scale every channel — send your first message in minutes, not weeks.