Subscribe

POST subscribe.{format}

Authentication
Yes PUBLIC API Token
URI Parameters
mobilenumber Valid 10/11 digit mobile phone number being subscribed
list Valid name of an existing list in your account, either this paramater, or BOTH shortcode and keyword must be completed
keyword Valid name of an existing keyword in your account, can be used in stead of List paramter, but must be accompanied by a Shortcode
shortcode Shortcode associated with the specified Keyword in your account
lastname (Optional) Last name associated with the constituent being subscribed
firstname (Optional) First name associated with the constituent being subscribed
Response Parameters
subscription
message Contains a success message on successful subscription
error Contains the details of an error on subscription failure
status Status code for the POST attempt. 200 on success. 400 or 404 on error

Request Example

WINDOWS USERS – Please see note at the end

Note that either a list name or BOTH a keyword/shortcode are required or a 400 error will be returned, in the case that all 3 are supplied, the list name will take precedence over the keyword/shortcode combination.

curl -v -D - -H 'Authorization: Token token="[public_api_token_here]", type="public"' -H "Accept: application/json" -H "Content-type: application/json" -X POST -d ' {"mobilenumber":"[valid_mobile_ph#]","list":"[valid_list_name]","firstname":"John","lastname":"Deere"}' "https://fundraise.givesmart.com/api/v2/subscriptions/subscribe.json?"

or

curl -v -D - -H 'Authorization: Token token="[public_api_token_here]", type="public"' -H "Accept: application/json" -H "Content-type: application/json" -X POST -d ' {"mobilenumber":"[valid_mobile_ph#]","keyword":"[valid_keyword_name]","shortcode":"[valid_shortcode]","firstname":"John","lastname":"Deere"}' "https://fundraise.givesmart.com/api/v2/subscriptions/subscribe.json?"

Should return a 200 status so long as all of the parameters are valid. Please exercise caution using this API as organizations can only subscribe constituents that have explicitly agreed to receive mobile communications.

By default these commands will not work on the Windows command prompt as it does not escape double quotes properly. Windows users can use Cygwin to have a Unix-like command prompt, or they can structure the calls to escape the quotes like so:

curl -H "Authorization: Token token=\"[api_token_here]\"" -H "Accept: application/json" -H "Content-type: application/json" -X GET -d " {\"status\":\"collected,pending\",\"transaction_type\":\"sale,credit\",\"amount_min\":\"50.00\"}" https://fundraise.givesmart.com/api/v2/reports/transactions.json?

and

curl -H "Authorization: Token token=\"[api_token_here]\"" -H "Accept: application/json" -H "Content-type: application/json" -X GET -d " {\"id\":\"[report_id_here]\"}" https://fundraise.givesmart.com/api/v2/reports/results.json?