Mobilize set up - mData web service
To create a new mData:
1. Select Text Messaging in the left pane, and then select mData.
2. At the top of the page, select + NEW MDATA.
The new mData form opens.
3. In the How do you want to build your application? section, select Use a Web Service.
4. Enter the following URL: https://events.mobilizeamerica.io/api/v1/organizations/ORGID/events?per_page=3&max_dist=50×lot_start=gte_now
Note: In the above URL, replace the numbers with the appropriate values for your customer. Enter the Organization’s Mobilize ID (ORGID) for the organization hosting the events.
5. Replace ORGID with the organization’s Mobilize ID number.
6. Set how many events to return per text by editing per_page=# (URL default is 3 events).
7. Set how wide of a radius to return events from by editing max_dist=## (URL default is 50 miles).
8. Check Request method is set to GET.
9. Change the Response format to JSON.
10. Use the text below in the template.
{% if count > 0 %} Events in your area:
{% for event in data %}{% assign location = event.location %}{% assign timeslots = event.timeslots | sort:'start_date' %}{% assign details = event.title %}{% if location.address_lines %}{% assign details = details | append: ", " %}{% assign address_lines = location.address_lines | join: " " | strip %}{% assign details = details | append: address_lines %}{% endif %}{% if location.locality %}{% assign details = details | append: ", " | append: location.locality %}{% endif %}{% if location.region %}{% assign details = details | append: ", " | append: location.region %}{% endif %}
{{ details }}.
{% for timeslot in timeslots limit:3 %}{{ timeslot.start_date | date: "%a, %b %d, %-l:%M%P" }}-{{ timeslot.end_date | date: "%-l:%M%P %Z" }}
{% endfor %}RSVP here: {{ event.browser_url }}
{% endfor %}
{% else %}
Enter copy organization wants to use here if no nearby events are found. Example: Find an event near you or volunteer from home:
https://www.mobilize.us/
{% endif %}
11. Select Assign Custom Web Service Parameters.
12. For args, enter the word “zipcode” (not the numerical digits of a zipcode).
Note: This field is case-sensitive. Use only lowercase letters, and do not include leading or trailing spaces.
13. In the Response Defaults section, review each of the default error messages and make any changes in the corresponding text box.
-
The Default/Error response is sent when mData does not recognize the search query sent by the user.
-
The No Results Found response is sent when the search query sent by the user does not return a result.
14. When you are done, select Create.