1 00:00:00,540 --> 00:00:03,730 In the previous video, we talked about a variety of ways you could use 2 00:00:03,730 --> 00:00:09,050 the MailChimp API to perform a specific task or automate a specific workflow. 3 00:00:09,050 --> 00:00:13,470 Typically, each of these tasks represent a single resource within MailChimp, and 4 00:00:13,470 --> 00:00:16,350 have their own URL, called an endpoint. 5 00:00:16,350 --> 00:00:19,450 For example, if you wanted to get a list of your campaigns, 6 00:00:19,450 --> 00:00:21,450 you'd use the campaigns endpoint. 7 00:00:23,180 --> 00:00:26,805 The campaigns end point is located 8 00:00:26,805 --> 00:00:33,534 at https://us10.api.mailchimp.com/3.0/campa- 9 00:00:33,534 --> 00:00:39,200 igns where us10 is my specific data center. 10 00:00:39,200 --> 00:00:44,670 This will vary account by account, but API keys end with a dash, us, and a number. 11 00:00:44,670 --> 00:00:46,565 The US number is your data center. 12 00:00:46,565 --> 00:00:50,170 3.0 describes the version of the API we're using and 13 00:00:50,170 --> 00:00:52,510 campaigns describes the resource we're using. 14 00:00:52,510 --> 00:00:56,770 For more complex workflows, you may need to interact with multiple API endpoints. 15 00:00:58,060 --> 00:01:02,200 In our API documentation, we lay out all available HTTP verbs and 16 00:01:02,200 --> 00:01:06,090 their actions, their individual requirements, and what they should return. 17 00:01:08,060 --> 00:01:11,190 We also give you some details about specific error messages 18 00:01:11,190 --> 00:01:14,150 that could be returned if something is missing from the request, 19 00:01:14,150 --> 00:01:18,910 such as a missing campaign subject line, or if the resource is not available for 20 00:01:18,910 --> 00:01:21,760 a particular reason, such as the campaign was deleted. 21 00:01:23,180 --> 00:01:26,640 You can see all of our API documentation at the link included in the teacher's 22 00:01:26,640 --> 00:01:27,290 notes below. 23 00:01:29,740 --> 00:01:31,340 With the new version of the API, 24 00:01:31,340 --> 00:01:35,140 we're also giving each endpoint an associated JSON schema. 25 00:01:35,140 --> 00:01:37,290 This schema file acts like a road map, 26 00:01:37,290 --> 00:01:42,400 explaining what data is required on input, and what data can expected on the return. 27 00:01:42,400 --> 00:01:44,990 Each schema also contains a list of links, 28 00:01:44,990 --> 00:01:48,210 that will include other related endpoints and aiding with discovery. 29 00:01:49,370 --> 00:01:52,400 Previous versions of the MailChimp API used individual methods for 30 00:01:52,400 --> 00:01:53,930 specific tasks. 31 00:01:53,930 --> 00:01:56,530 For example, to subscribe a new member to a list, 32 00:01:56,530 --> 00:02:01,010 you'd look at the documentation for the method, list subscribe or list/subscribe. 33 00:02:01,010 --> 00:02:05,090 With the new version of our API, we're taking a slightly different approach. 34 00:02:06,470 --> 00:02:09,650 MailChimp's API is based on rest standards. 35 00:02:09,650 --> 00:02:13,250 Which means that HTTP verbs carry a different set of instructions to 36 00:02:13,250 --> 00:02:14,650 MailChimp. 37 00:02:14,650 --> 00:02:20,500 The MailChimp API accepts get, post, patch and delete requests. 38 00:02:21,980 --> 00:02:25,340 Each of these requests interacts with a resource in a different way. 39 00:02:27,080 --> 00:02:30,440 For example, if you want to retrieve information from MailChimp, 40 00:02:30,440 --> 00:02:35,820 such as report data or a list of your subscribers, you can make a get request. 41 00:02:35,820 --> 00:02:39,830 To create a new resource or item by creating a new campaign or 42 00:02:39,830 --> 00:02:43,410 adding a new subscriber to your list, you'll make a post request. 43 00:02:45,450 --> 00:02:49,530 Patch requests are used to update existing items in MailChimp, like modifying your 44 00:02:49,530 --> 00:02:53,610 list information, or changing an editable section of a campaign. 45 00:02:53,610 --> 00:02:57,410 With a patch request, we'll only update the information that you send us. 46 00:02:58,570 --> 00:03:01,360 If you're unfamiliar with how to make a specific type of request, 47 00:03:01,360 --> 00:03:05,370 there are a number of sites, applications, and resources that can help you, 48 00:03:05,370 --> 00:03:11,980 such as web sniffer, an online web app, or postman, which is a plug-in for Chrome. 49 00:03:11,980 --> 00:03:14,790 Those links are included in the teacher's notes below. 50 00:03:14,790 --> 00:03:18,120 For this course, we'll just be covering the list resource. 51 00:03:18,120 --> 00:03:21,590 But we've tried to make nearly every aspect of MailChimp's interface 52 00:03:21,590 --> 00:03:23,730 accessible via the API. 53 00:03:23,730 --> 00:03:27,220 This includes the often requested ability to create a list within an account 54 00:03:27,220 --> 00:03:27,910 programmatically. 55 00:03:29,040 --> 00:03:32,200 For those of you with programming experience we have a variety of wrappers 56 00:03:32,200 --> 00:03:34,830 available for previous versions of our API. 57 00:03:34,830 --> 00:03:36,560 Check out the teachers notes included below. 58 00:03:37,710 --> 00:03:39,180 If you built an API wrapper for 59 00:03:39,180 --> 00:03:43,150 the new version of our API, drop us a line at the link in teachers notes below. 60 00:03:43,150 --> 00:03:46,240 We'll happily list your work on that page. 61 00:03:46,240 --> 00:03:49,390 If you built something else cool with the API we'd love to hear about that too.