Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <!doctype html>
<html lang="en">
  <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
  <title>Zipwhip Message Send API Example</title>
<div class="p-3">
  <h2>Zipwhip Message/Send API</h2>
  <p><a href="" target="_blank"></a></p>

<!-- Form for capturing session, mobile number and message body params  -->
<form class="border p-4 bg-light" action="" method="POST">
  <div class="form-group">
      <label for="session">Session:</label>
      <input type="text" class="form-control" id="session" value="">
  <div class="form-group">
      <label for="contacts">Mobile Number:</label>
      <input type="text" class="form-control" id="contacts" placeholder="2065551234" value="">
  <div class="form-group">
      <label for="body">Message Body:</label>
      <textarea class="form-control" style="height:90px;" id="body" placeholder="Enter message body here"></textarea>
  <input type="submit" class="btn btn-primary" id="submit" value="Submit">

<!-- Display Success or Failer Message after Submit -->
<div id="success-alert" class="mt-3 alert alert-success alert-dismissible" style="display:none;">
    <button id="close-alert" type="button" class="close">&times;</button>
    <strong>Message Sent</strong>

<div id="failed-alert" class="mt-3 alert alert-danger alert-dismissible" style="display:none;">
    <button id="close-alert" type="button" class="close">&times;</button>
    <strong>Message failed to send</strong>

<!-- Display JSON response after Submit-->
<div id="json-response" class="d-none py-4 border-bottom">
    <code class="language-json" id="api-response">





                $(document).ready(function() {
    $("#submit").click(function(event) {
        let session = $("#session").val();
        let contacts = $("#contacts").val();
        let body = $("#body").val();
        messageSend(session, contacts, body);

function messageSend(sessionKey, phoneNumber, messageBody) {
    if (!sessionKey) {
        alert('Missing session key. Please login first.');
    } else if (!phoneNumber) {
        alert("Please enter a phone number.");
    } else if (!messageBody) {
        alert("Please enter a message body.");
    $.post("", {
                session: sessionKey,
                contacts: phoneNumber,
                body: messageBody
            function(response, status) {
                if (response.success == true) {
                } else {
        .fail(function(response) {
        // Display json results on page
        .always(function(response) {

// Display syntax highlighted json results
function displayJsonResponse(response) {
    $("#api-response").ready(function() {
        if ($("#api-response").length) {
            $("#api-response").text(status + '\n' + JSON.stringify(response, undefined, 2));