Skip to content

Instantly share code, notes, and snippets.

View acapps's full-sized avatar

Alan Capps acapps

  • Zipwhip
  • Seattle, WA
View GitHub Profile
@acapps
acapps / zipwhip-deeplink
Last active August 29, 2015 14:02
Zipwhip supports deeplinking into our portals. The deep link logic works on pages that are hosted within the Zipwhip domain.
@acapps
acapps / js-overwrite-options-menu
Created June 10, 2014 15:46
Customize the Zipwhip Options menu text. Using the option in Zipwhip to link off to your own JavaScript file.
function findByText(_tag, _search, _value)
{
var aTags = document.getElementsByTagName(_tag);
var i = 0;
for (i = 0; i < aTags.length; i++)
{
if (aTags[i].textContent == _search)
{
aTags[i].innerText = _value;
@acapps
acapps / curl-contact-count
Last active August 29, 2015 14:01
Example cURL statement for retrieving contact count for Zipwhip account using contact/list.
$curl http://api.zipwhip.com/contact/list
-d session=[sessionKey]
–d pageSize=1
Where pages is the total number of contacts associated with the account.
In the example below the account has 89 contacts.
Response:
{
"total":1,
@acapps
acapps / curl-user-login-canada
Last active August 29, 2015 14:01
Example cURL statement for user/login with regard to Canadian numbers.
Example of Canadian Number:
$curl https://api.zipwhip.com/user/login
-d username=%2B15555551212
-d password=default
It is important to note that on Canadian numbers that you must put the number into E.164 format.
Standard user/login
$curl https://api.zipwhip.com/user/login
-d username=[phonenumber]
@acapps
acapps / curl-creating-altering-webhooks
Last active August 29, 2015 14:01
Example cURL statements for enrolling accounts into Zipwhip Web Hooks.
When installing Web Hooks the first step is to call app/install. One of the return values is the installedAppId. You can store this value, so you can make changes to your Web Hooks in the future. You can however, just use app/list and then snag the installedAppId from the payload.
INSTALL:
NOTE: Web calls do not take JSON as a single input. The settings parameter, however, does take JSON as an input.
$curl -X POST https://api.zipwhip.com/app/install
-d appId=4501
-d session=[SessionKey]
-d settings=%7B%22%2Fsignal%2Fmessage%2Freceive%22%3A%22http%3A%2F%2Fhosteddomain.com%2Fmessage%2Freceive%22%7D
@acapps
acapps / curl-message-get
Last active March 24, 2016 20:42
Zipwhip - message/get
GET /message/get HTTP/1.1
HTTP: api.zipwhip.com
Parameters:
session={session}
uuid={Message ID}
$curl https://api.zipwhip.com/message/get
-d session=[sessionKey]
–d uuid=[id]