Last active
August 29, 2015 14:01
-
-
Save acapps/fc5ae5857773490df22a to your computer and use it in GitHub Desktop.
Example cURL statements for enrolling accounts into Zipwhip Web Hooks.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
Response: | |
{ | |
"success": true, | |
"response": { | |
"appId": 4501, | |
"appKey": "json_webhooks", | |
"installedAppId": [xxx], // Used for alter | |
"settings": { | |
"/signal/message/receive":"http://hosteddomain.com/message/receive" | |
} | |
} | |
} | |
LIST: | |
$curl -G https://api.zipwhip.com/app/list | |
-d session=[sessionKey] | |
Response: | |
{ | |
"success":true, | |
"response":{ | |
"apps":[ | |
{ | |
"appId":4501, | |
"appKey":"json_webhooks", | |
"installedAppId":[xxx], // In case you do not store from the install you can retrieve from app/list | |
"settings":{ | |
"/signal/message/receive":"http://hosteddomain.com/message/receive" | |
} | |
} | |
], | |
"capabilities":[ | |
"/d2c_landline_advanced_autoreply", | |
"/group" | |
] | |
} | |
} | |
UPDATE: | |
$curl -X POST https://api.zipwhip.com/app/alter | |
-d installedAppId=[xxx] | |
-d session=[SessionKey] | |
-d settings=%7B%22%2Fsignal%2Fmessage%2Freceive%22%3A%22http%3A%2F%2Fhosteddomain.com%2Fmessage%2Freceive%22%7D | |
REMOVE: | |
$curl -X POST https://api.zipwhip.com/app/uninstall | |
-d installedAppId=[xxx] | |
-d session=[SessionKey] | |
Response: | |
{ | |
"success": true, | |
"response": "Uninstalled app" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment