Crash Course: APIs w/ Facebook & Twilio | Christopher Castiglione | Skillshare

Playback Speed

  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x

Crash Course: APIs w/ Facebook & Twilio

teacher avatar Christopher Castiglione, Co-founder of One Month

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Lessons in This Class

11 Lessons (1h 52m)
    • 1. What Are APIs [8:12]

    • 2. Databases Part 1 [14:16]

    • 3. Databases Part 2 [2:59]

    • 4. APIs Read & Write Data [5:29]

    • 5. APIs: XML & JSON [9:12]

    • 6. The Facebook API: Basics & Like Button [12:10]

    • 7. The Facebook API: The Graph API [9:24]

    • 8. The Facebook API: The Graph Explorer [29:02]

    • 9. Facebook: Recap & Beyond [3:44]

    • 10. The Twilio API [12:08]

    • 11. APIs for Every Occasion [5:35]

  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels

Community Generated

The level is determined by a majority opinion of students who have reviewed this class. The teacher's recommendation is shown until at least 5 student responses are collected.





About This Class

Enroll now to get instant access to all lectures and class materials! 

Are you a creative or entrepreneur that wishes you could speak tech with your web development team? Sure, you’ve heard about APIs, but maybe you’re not totally sure what they are?

In this class we’ll learn all about APIs: what they are; and how to get started using them! Later on we’ll look at some code and live data from both Facebook and Twilio.

Hey Chris, what's an API?

Here's an example: have you ever heard someone say something like, “The NY Times has an API we can use.”? What they are saying is "The NY Times has some data that you can freely access and use in your project." 

In addition to that, the term API can also refer to apps that write and process data on our behalf. We’ll cover this, and much more!  

Who Is this Class For?

This class is made for the total beginner. If you’re looking to learn about APIs you’re in the right place. If you’re a developer looking to query some API data, we’ll be providing you with code examples to take home.

For Non-Programmers

Maybe you're new to APIs? Or you've had one of the IT guys in your office try to explain this to you before, but to no avail? I totally get it, and so I've designed this class with you in mind. 

What I’ve found is that the best way to learn the concepts of programming is to actually write some code yourself. (Much like how we learn a foreign language - you have to use the knowledge). If you’re not a developer, you should still be able to follow along with the code examples because we'll break down the logic step-by-step. Basically what I’m saying is... that we’ll learn by doing here.

Sign up for this class and you’ll learn:

  • What is an API?
  • How an understanding of APIs can help cut development time of a project in half
  • What APIs are available and worth knowing about?
  • How to register a Facebook App so that we can start using the Facebook API
  • How to write code to make an API call to Facebook that delivers a user’s “Top 10 Facbook likes”
  • How to set up an app with the Twilio API

This Class Includes

  • Over 1.5 hours of easy to follow video content
  • A project designed by me for you to be able to apply your skills
  • A self-assessment and worksheet
  • The final slide deck
  • Code examples for working with the Facebook and Twilio API

I’m looking forward to class!


Feedback from my Programming For Non-Programmers Series:

"You taught the class in four hours what took me two years to teach myself." - Matt Jared, Capital Factory Austin, X

"I've traveled a steep learning curve thanks to Chris' friendly and lucid style of teaching." - Charles Best, CEO of

"I wish I had taken this class 5 years ago!" - Michael Goodwin, UX Designer 

"You are the only person who has been able to sufficiently teach me code." - Darren Hakimi, Analyst  

"You are Articulate and Engaging. Broad and Diverse Range of Topics. That s right bro!!!!! Not easy to address so much in limited time." - student feedback

"Informative, digestible, actionable" - Katherine, Entrepreneur

Even for a non tech person like me (who yes, has 50,000 emails in her inbox and actually thinks thats totally normal), I was able to keep up. My intent was to get a good overview of what the heck programming actually is, and better understand the language/terms associated with it.  I  certainly got that.  I also appreciated your passion for teaching. I will absolutely recommend the class to my friends. - Debra-Ellen Glickstein,  Entrepreneur 

Meet Your Teacher

Teacher Profile Image

Christopher Castiglione

Co-founder of One Month


Chris Castiglione is the co-founder of One Month (Learn to Code in 30 Days), and the host of the On Books Book Podcast. He has taught at Columbia University and has written for, Crawdaddy Magazine, and Thought Catalog. Read more from Chris on his blog @ 


Sure thing. Email chris[at] with any questions you might have. 

See full profile

Class Ratings

Expectations Met?
  • 0%
  • Yes
  • 0%
  • Somewhat
  • 0%
  • Not really
  • 0%
Reviews Archive

In October 2018, we updated our review system to improve the way we collect feedback. Below are the reviews written before that update.

Why Join Skillshare?

Take award-winning Skillshare Original Classes

Each class has short lessons, hands-on projects

Your membership supports Skillshare teachers

Learn From Anywhere

Take classes on the go with the Skillshare app. Stream or download to watch on the plane, the subway, or wherever you learn best.


1. What Are APIs [8:12]: - Hey, - Chris here. - Welcome the crash course AP Eyes and interactive data. - So I'm really happy to be teaching this course. - I've been teaching it for about a year now as part of my programming for non programmers - workshop. - And, - um, - it's it's been going really well, - like, - because I know how hard a B I's can be if you're not a programmer and even some beginner - developers or even some higher level developers. - Um, - how does trouble with understanding AP eyes? - It could be a bit complex. - And so what I want to do here in this class is understand what are AP eyes right? - How can we use them in our project and to just, - conceptually understand you know how to get started? - What is the best practices? - And to that end, - we'll be looking at a lot of examples a lot of real life examples, - but we'll also be looking at code. - And so, - even if you're not a developer, - I think the best way to understand this stuff is just to get in and actually see it. - Um, - I mean, - slide slide presentations and books they helped will give us some theory, - the supporters, - but we actually want to apply and do something with it. - So we'll be doing a little bit of both, - um throughout and just, - you know, - let's get started. - What are AP? - Eyes. - Okay, - so maybe you've heard someone say Yelp has an A p I we can use or The New York Times is an - A p I we can use. - What does it mean when there's an AP I? - Well, - really All this person means is that there's some data out there, - right? - You can imagine Yelp has some data that they want to get to us. - So yelp, - if you ever been there, - has a lot of data about restaurants, - you know all over the city all over the world and reviews that their customers come and - give reviews for different things. - Different comments. - Wouldn't it be awesome if we could get some of that data? - Right? - Maybe I'm making a project, - and I want to include, - you know, - reviews of the city. - I have maybe, - ah, - real estate app. - And I want to show people. - Yeah, - you know, - there's also really awesome restaurants on this street, - right? - Or there's really good bars in the street. - You know, - I could find that data. - Where would I get that from? - I don't want to. - Like, - added in myself, - right. - We take a lot of time to make my own database on my own data collection. - I don't go around the city and, - like, - write those all down or Google map it for a day. - But Yelp has that, - and they've organized it for you. - And so we could take that data and we could bring that into our project. - That's the power of AP eyes being able to access the data that Yelp has right being Evel - access to data that Google as that Facebook has about our friends, - right? - Twitter, - tweets, - different stuff. - We can use all of that data in our own projects, - and that's exactly what people are doing. - So with Yelp, - for example, - you can see here the scenario I just described. - I can see that there's court bars and restaurants in the area, - right? - And they have some like four stars. - Things are cool. - I could look more and then go. - Yeah, - you know, - maybe I want to buy a house around here, - right? - Truly, - I didn't need to go and find out this stuff themselves. - They just queried the yelp ap I grubhub will show you. - Hey, - if you wanna take take out right, - we'll tell you. - You know, - these are the reviews that people are giving it on Yelp. - Their business is just about helping you get, - you know, - take out from restaurants making easy online or from your iPhone. - But they don't want to worry about reviews, - so they just take that data from Yelp. - An FBI is like a bank vault, - and it's true, - Um, - when you go to the bank to get money, - right, - this is what we're gonna call the human AP I experience. - Right? - This is something you do, - You go to the bank, - you get out money. - Well, - how do you do it? - Let's look at this example. - I think this will help us understand. - Ah, - human ap, - I so that we can understand what are really a p. - I is. - And so when you go to the bank, - you walk into Bank of America, - you enter the vault, - you take $20 then you go out and you know you go to the restaurant. - You spend that money that's like a normal day, - right? - Totally not correct. - Now we don't do that. - What do we do when we go to the bank? - We don't go into the vault And why? - Well, - obviously, - it's There's other people's money in there, - and then yours, - right? - Then the bank doesn't want you to possibly steal that or to take too much, - right? - They need to monitor that. - And so how do we get our money out of the bank? - What? - We use an interface in this interface, - right? - The A T M. - And now what do we do with the mall? - I take out my card and I put in my pin number, - and then it knows its crest. - It's like a It's Chris. - And then it just allows me to take the money I have access to. - And even in these denominations, - right, - I can only kind of take out, - like, - 20 or 40 maybe somewhere up to 400 for a day, - right? - If you've ever had kill large sum of money out, - you know you have to do different days, - day by day. - Yeah, - and so they they basically limit you on how much you could do and on who it is, - Right? - This is important in this scenario of this human, - A p I. - The person making the programming here are the completing. - The task is you. - You're coming to the bank pressing the buttons. - It's going to the vault, - right? - The month metaphorical vault here, - and it comes back and you get your $20 bill. - This is a pretty common experience. - Now, - let's look at this as if it were data, - right? - And what was in the database was data we wanted access to. - This is exactly how on a P I works. - So here we want to get out. - Data. - Let's say that I want to get my most recent tweets. - So what do we dio? - Well, - every a p. - I is gonna have an interface right the way that we can get to that data they're all gonna - have, - For example, - a developer site, - right? - A developer site is gonna have a way that we can find out. - How do we get that data from the database? - And so we'll go here, - for example, - to the Twitter's developer site. - Right, - Steph, - not twitter dot com and we'll find out how to get access to our data and what we right here - is some code to complete the program, - right. - So we're basically writing code on our behalf to say, - Hey, - this code is gonna go to Twitter and it's gonna come back with a tweet, - or it's gonna come back with some D m's right or some data. - Maybe all my tweets are gonna come back. - Whatever it is, - we write that in the code, - and that's the task. - Were writing. - And this is how a common AP I call is made a p I. - What does it stand for? - I'm not usually the type of person that teaches and explains what all of these letters mean - . - Html XML. - It's usually not that important, - but with a P I I'd like to explain because I think the letter I an a p I is important to - understand this interface right application programming interface, - and you can see it already. - We've talked about the interfaces that we use to interact with our data. - Really, - any project you make any Web project. - It's all about the data, - right? - It's a lot of the data that we want to get, - whether it's users, - whether it's a transaction and then we see it through different interfaces. - A website iPhone, - for example. - Let's check Twitter on her iPhone, - right? - And we see this display here. - Let's check Twitter on tweet deck. - Let's check Twitter on Twitter, - right? - There's lots of different places that you can interface with Twitter. - What do I mean? - Well, - all we're talking about is some data, - and the data base here is common, - right? - It's going to stay the same for all of these. - So it doesn't matter where you check Twitter where you update it. - All you're really doing is finding a way to interface with the data in the database. - And so we need to understand a little bit more about databases and how they work and then - come back to understanding how interfaces work with the data. - But that's the flow that we're looking at here with. - AP eyes interfacing with data 2. Databases Part 1 [14:16]: - Okay, - So let's understand a few fundamental things about databases, - and this will set the foundation for when we move forward and talking with AP eyes. - This will give us a sense of some of the vocabulary and concepts that are underlying really - any website or Web service. - So databases. - Well, - let's take an example of the difference between front end back end and how databases - interplay with website. - Here we have Zappos, - and maybe you've been This happens before, - right? - You come to the home page and what do you see? - Is he an image? - You see some colors Isam content. - And then you click What's to be clicked by a shoe and your forwarded to another page. - We can call that like the shoe page. - You come from the home page to the shoe page. - That's what you see. - You see the front end in your browser. - Any website is gonna always display in the browser. - But what really happens? - Well, - when you click on that shoe, - what's really happening is that that file is going to another back and file right. - This back and file is gonna have some back in language. - Maybe you'll be PHP or Ruby and that language talks to the database. - So this is the kind of flow we have will have in the front end something like HTML, - CSS and JavaScript. - Three languages working together, - which I only have one back and language. - We could say it's PHP in this case, - and we'll have one database that interacts. - And the storyline here might be something like, - Well, - I come to the store, - I'm gonna buy shoe and we come from that home page to the back end page, - That black page And that says, - Hey, - is ah, - is Chris a user? - And it looks in the database. - A database is just like an Excel filed its rows and columns. - And then it's like, - No, - Chris isn't a user. - And so it may say, - Hey, - okay, - well, - let's have him log in and then send him to this middle page. - This this cart recon shop out, - check out Another scenario might be back on the home page to the left, - Click the button. - I'm returning. - So now I go to that back in black page. - It looks for the database. - It looks for my name, - and it's like, - Yep, - he is a user let's send him directly to the cart. - He doesn't need the log in right. - So there's always this kind of, - like brain in the background, - this controller, - right, - that's that's deciding. - You know, - in this case it might just be one file like a literal file that's being red, - top to bottom, - and that's interacting with one database or maybe many many files. - But I think it's think it's easy to understand it with just being one file. - In some cases, - that's the truth. - So let's dive into the database what's happening in there with the data. - So in a database, - we have a bunch of tables. - Okay, - what's the table? - Well, - we may have a user's table, - for example, - and a user's table will be made up of something like the name right, - The user, - the password, - the email address. - You can see we have columns and rows. - It's much like an Excel spreadsheet, - like I said, - and you know, - for the user, - we may have a name like caustic right, - and then my password really secures. - Here. - Get 1234 and my email address, - right, - so each row represents a user. - Each column represents some attributes about that user. - Here's another example. - So we may have posts. - This could be a block post, - right? - And for the post, - Will may have things like in the row that first row we have. - Ah, - and I D c. - There's an i d for each one the eighties, - like the Social Security number for each for each line, - right? - It's just kind of like a number that never changes. - Right, - So we have in the rail, - we have a number, - right? - Let's get to the post state. - We have a date. - We have some content title, - right? - And let me have three block posts here, - and then we may have a table for comments right The way that you decide these tables. - Well, - this is part of the database schema, - and this is outside of the, - you know, - learning here. - But the idea is that we are putting into different tables these like objects where this - user's these posts were separating them. - These happen to be three tables that come with wordpress. - So just for example, - these air three tables you might see with wordpress and then how we join them together and - how we make them work together that's what shows us the you know, - the entire front, - the website, - the block. - Whatever it is, - we never see these distinguished tables. - Just one more thing, - another way that I think about these tables. - And again if you've never seen a database, - Uh, - but you've probably seen Excel A. - Databases like the Excel file itself right, - and that each of these tables, - if you've ever used the feature in Excel that you could make like a spreadsheet for each - page, - right, - you may have you, - me to your finances, - and that might be one file and then within their you may have one spreadsheet for you know - , - home, - another spreadsheet for work, - another spreadsheet for health or medical benefits or whatever you got in there. - But the idea is that you separate them into subjects, - but they're within this one file, - so we're separating our content into different tables. - But they're all part of one database and usually one database for a project. - Let's look a little bit more here. - We have the column for the users, - right? - This column is sometimes also known as the fields. - You can use either one when we describe a database and then we have the rose, - right? - And as I said, - each row represents in this case, - a user or may represent a block post. - It's one item, - right? - One record is another way. - We will call this our rows or records. - So here we have some vocabulary that you might want to write down. - We have again Fields and Records, - right users here, - right for all of our users we could do. - And this is some SQL code makes a select all from users where I d equals two, - and that's going to select all that Star Ming's all. - We're gonna grab that whole row there, - right? - So this is some X Q o code. - SQL is a language that used to query databases, - and it's agnostic. - It doesn't have to do with anyone language. - You can use Ruby and SQL, - PHP and SQL, - right? - Anything, - really, - um, - to interact with the database. - And in this case, - let's say we wanted to grab let me run to write some PHP code. - So in our file will write PHP and SQL code together. - And then when it executes it right, - so I'm clicking. - I'm on the front page of a website. - I'm clicking into a block post and this codes gonna read top to bottom and it's going to - say something like, - Hey, - go to the database and select post title No. - Two. - Bc post title Where is that right the right there. - Okay, - so select post title from posts. - What's Post Post is the table name? - Okay, - so select post title, - right, - That one. - That one column there from posts The So Table Where I d equals one so well on Lee. - Get that one bit of data. - Can you imagine what's what's going to spit out that one piece of data there from the row? - And there it goes, - comes back into you are Project. - So that's the interchange of their exchange that we have when we're writing code on the - back end and it's going back and forth, - we're using one back in language like PHP. - PHP works. - SQL write. - SQL again is particular to databases and General, - you could use it with my sequel database or post Grasser Oracle. - All these different databases will use SQL, - and then it comes back with data. - This is the exchange. - Let's look at an example of this in real life here So this is this is really what you would - see if you were to log into your database, - it's Ah, - PHP my admin, - which is just a view of our my sequel database. - Okay, - don't get caught up with the words. - Essentially, - this is a way that we can look into the database. - Well, - how did I get here? - Well, - quite simply, - if you were to sign up for hosting account with something like hosted Gator or Blue host or - any really hosting account, - um, - have it open here. - You would log into your control panel. - And so when you sign up, - you automatically get a U R L on a user name and password for this control panel, - and you would come down somewhere down here to our databases. - Here we go. - And all you have to do is click this button here, - and that's the database would open. - Now you need to create a database first. - It's just like two steps. - You would come into this screen first. - And if I just open this up here and we get this screen here, - you just basically put in a name for whatever database you'd want to dio call it whatever - you want to call it, - and you'd click create database. - It would take a second to chug for a second, - and you can see the database that I just created. - It shows up down here one final step that you need to do in this kind of messes People up - because they forget sometimes is you need to assign a user basically user name and password - to that, - and so you can create a new one here or I've already created one. - So I just need to assign that user by adding them by clicking this year. - That says, - Hey, - what privileges does this user having? - Unlike it's me, - man, - give me all the privileges Gold sweet, - good to go and we're good to go. - So you would come back when she set that up and just simply click on this year and it would - pop up with your database. - And so I've already done those steps, - but hopefully that grounds this in. - You know, - you could do this yourself if you were interested in going off and doing this, - have some tutorials on my blawg pf and p dot at me. - You can check out for setting that up, - but let's continue. - I mean, - I just think that grounds it enough in where this stuff is coming from. - I'm also using ma'am, - which is a local data base, - so that I don't need to be connected. - Teoh. - A server remote server. - So anyway, - but same same long story short. - This is the database. - This is the view. - What I've done is just installed a basic WordPress install. - So with WordPress, - you get 11 tables here for one site, - okay? - And so this is exactly what we were just looking at with the slides. - And you can see if I come into my posts, - right, - click into their and click on browse so I can see what's in there and we see exactly. - Yep. - Here we go. - We have the I DS, - right? - The post state. - So each one of these is one block post we get to the content of a blockbuster title. - Right is the new one. - Here's a new one here. - Each one of these is a block post. - And the columns each one of these attributes off that right. - And so exactly like we showed. - If we wanted to query some data from here, - we can go to this SQL tab. - It's going to allow us to write some data. - We can click on this. - I'll just delete this default to give us. - And let's type our own So you would do select Oh, - the star from the table. - It's the table name up posts, - right. - That's what we want to get data from. - And if I do that, - we'll see everything. - See exactly what we just saw there like, - we'll just show us everything. - We have everything. - When I get a specific piece of data, - we don't want to get all the data won't come to SQL here. - And then it's like this. - And this is where I waas here. - So select all from posts. - Where? - Where? - What? - Well, - let's just get one piece of data will get the i d. - Number one cool. - And so when I do, - I d number one. - Whatever the idea Number one is, - we get that there and you can see we have the post here. - I just wanted to get the title of this. - I can come here and edit. - This is a little annoying. - If you were to come back here, - it deletes the last thing you wrote, - you have to rewrite it. - But if you look at it So in this case, - instead of getting all I can just say, - I just want one piece of data. - I want the post title from posts and, - like, - click this and go. - And there you go. - It just grabs that one piece of data for me. - Okay? - With this query here. - Yeah. - So everyone to get just the most recent Blawg post, - we could say something like Select Blawg title is the block title from Posts An order by I - D in limit one. - Just show us one. - And now it will order by I d. - Well, - now it's still showing us the 1st 1 when we can do something like order by descending. - So show us the last one first. - And there you go. - That happens to be the last block words that was added to the site at the moment 3. Databases Part 2 [2:59]: - the important thing here just understand, - is that we have the back in language. - We have the SQL and it's talking to our database, - right? - It's giving it some kind of command. - Select that stuff for May and is coming back with some data, - right? - These in the languages we use, - this is the process we use. - And this will all make sense when we get to AP eyes because we'll see how it's actually - kind of fundamentally built on this premise. - And here's one more example. - So if we were actually going to this down here is the website, - right, - you can see that this is exactly what happened. - So on load, - when you load, - it looks that the back end code it goes, - Hey, - are there any new posts? - Looks in the database. - It says, - Hey, - send me the most recent posts sends back the data. - The back end goes, - Yep, - this is it. - Checks forests and outputs it to the front. - Right? - You only ever see that front end part, - but this is what is going on in the background. - These three parts talking together in closing will add there's only four statements or - commands. - You can make with SQL. - Every SQL query will start with one of these four words. - You can insert data into the database, - select data from the database. - That's like showing it. - Yeah, - you can update so I can take existing data and add something to it. - Or I can delete data. - Those are the four commands you can dio um, - act upon. - You could make longer things like select certain things or insert, - you know, - into one line or, - you know, - be more specific, - but these are the four general principles. - Okay, - I'm gonna make this unnecessarily complicated now and only because that's the way it is. - And I feel like I'm a journalist trying to report on this more s. - So bear with me, - this is true. - These of the four commands Sometimes they're also referred to as create, - read, - update and delete. - I mean, - the principle is the same. - It's just different words, - right? - So creating is the same, - is inserting reading the same selecting update and delete say the same. - So there's just different words, - you hear it's either insert, - select update, - delete. - That's actually what you type. - Um, - there's these other principles which working certain other languages right, - but create, - read, - update delete. - I bring this up because, - well, - you may also hear people refer to this as the crowd, - and that's what they mean. - Okay, - so the crowd is this idea of creating reading, - updating is leading. - It's the four things you can do to data, - and that's what it is. - Moving forward. - I'm gonna simplify this even Mawr and just say, - basically, - we're reading and writing data, - okay? - I mean, - that's the idea. - We're taking data from the database. - We're putting data into the database. - Yeah, - we could be deleting it. - Yeah, - we could be updating it, - but let's just keep it simple reading and writing. - But that's all the theory about how I got here and now you know the terms. - And if you're interested, - you can pick up an SQL book or learn a bit more about this terms. - But now we know where they come from. 4. APIs Read & Write Data [5:29]: - AP eyes read and write data. - So now that we've looked at databases and a little bit lower level kind of what's going on - underneath the hood, - let's come back to the higher level. - You know, - what can we do with AP eyes? - But we can read and write data. - What does that mean from the user's perspective? - Well, - we might come to a site like TechCrunch here and these buttons over here pretty familiar - with right pressing these kind of things. - Whenever you press one of these buttons, - they're liking something or Google, - plus ing it. - What you're doing is you are writing data. - OK, - you're writing data now. - Think about it on this interface here. - I'm pressing a button and it's going to some back end code and it's updating. - Let's say if I click the like button for Facebook, - it's updating Facebook's database with some data, - right? - So I'm just writing data from one interface, - the TechCrunch site. - Maybe your site. - Click the like button boom, - boom boom. - Facebook's database. - Updated writing data, - right? - What else can we do? - Well, - here, - you might think of this as reading data. - So now we're taking data from Facebook, - right? - And so this goes and it's select all friends, - right? - Sex, - all your friends from the user table in data in Facebook status. - And then it shows them here. - And so we could also think of an A p I as reading data reading, - data writing data. - Here's another example. - So here on the Huffington Post, - you can see the same thing. - Let's break it down a little bit, - step by step. - So here, - where season tweets and send me to tweets of people I follow. - So I show up on Huffington Post and I can see friends. - You know, - who I'm following on Twitter and things that they've tweeted related maybe to this article - or to The Huffington Post today. - And so that's what it's saying. - It's saying the code executes on the Huffington Post site and it says, - Hey, - go to Twitter and Twitter. - Send me to treats of people I follow. - Twitter responds. - It goes into the database. - That's a little search comes back and shows me a personalized message. - Okay, - cool. - Here is that data just personalized to my friends? - Here's an example of reading data, - and that would be the A P. - I call on the flow that it takes appear. - You see it writing data. - Okay, - so it's like, - Hey, - what do you want on tweet about? - Right? - What's your take on this? - And so I can write in some data here or something. - It's pre filled, - maybe, - and I click the tweet button. - And what's happening in the background? - Is there some code? - And it translates to, - you know, - post this on my Twitter at Castaic. - And, - of course, - because I'm logged in right and I have, - like, - a cookie or some kind of session. - That's what it's called. - It knows I'm logged in. - It was That's me. - And then that data is sent to Twitter, - which is really just writing to their database, - right whenever I update on the interface of the Huffington Post, - somewhere out there, - right and some server of Twitter is getting updated, - and that gets updated for every instance of Twitter that we have. - And sometimes we get a message back and you know, - the data will say, - like okay, - done. - And then we couldn't display that we want. - When we posted her, - things went well, - sometimes you want to read lots of data. - Okay, - so the two previous examples were, - you know, - nothing that you couldn't do just by going to facebook dot com or twitter dot com or - updating, - you know, - a status were liking something. - Just one instance of updating a single record in the database. - Well, - maybe we want to do a lot of things at once, - right? - Of many things in the database were read many things and put them together in some kind of - a really interesting way. - When we re lots of data, - this is sometimes referred to as a mashup. - Combining data are functionality from two or more sources. - So a mash up and these air popular, - you can google them and look on the web. - But any time you've ever seen data, - you know, - put on a Google map, - you know, - geographic data like this, - an infographic, - right? - You're taking data in this case from Craigslist and were plotting it. - So we're giving it a different interface or giving it a different look right? - Mash up. - Sometimes you want to write lots of data. - So maybe with one click, - I want to execute a handful of functions, - right? - I want to show my love for Nicolas Cage by clicking K's your Q and having every single - Nicolas Cage movie instantly moved to my cue and Netflix. - Awesome Marathon weekend. - Apparently things person thought so. - So this is what we can do here. - And ah, - you know, - this may be something that had taken, - I don't know this contain, - like, - an hour, - I guess, - arm or you make it distracted and start reading all the bios and get on Wikipedia and who - knows where this goes? - But all of that can be automated with a few lines of code, - right. - You write the code, - and we interface it with a button so that the user doesn't have to do anything more than - okayed your Q and instantly 49 movies. - That's the max 50 would be crazy. - Get added to the database. - And here's how that would look. - Of course, - Netflix has their own um you dev site for their a p I. - And so when you click that button, - some code is running over to Netflix and updating their database 5. APIs: XML & JSON [9:12]: - AP Eyes, - XML and Jason. - All right, - so let's go back. - Let's go back to the beginning of the Internet or what felt like the beginning of the - Internet 19 nineties right here is a well, - here is yahoo dot com When we went and logged on something like a, - well, - all of the users and they all stayed within a, - well, - all of the news, - right? - It was all kind of suspended within this what was called a walled garden. - You know the data. - It was like owned by a well, - and you couldn't get it out. - Same thing with Yahoo, - anything that was inside the Yahoo's site or within that domain, - there was no way to share it right. - There is no way there's no like social buttons. - There is no way to do anything that was outside of this walled garden. - One of the first popularized ways that data could leave a website was with RSS RSS got - really popular around 2000 for 2005 and it still is. - But around there you could go to a site like NPR, - write a new site, - CNN. - You would see these buttons. - They would look like this little orange button when you clicked on it. - You could then take that feed and subscribe so I could subscribe to you all the political - stories. - NPR described all the music stories and what do I mean by subscribe? - Well, - you know, - when you clicked on it, - you would get that in your Google reader, - right? - Or you would get that on your dashboard. - You could read in other places that weren't NPR, - or if you remember, - I Google was pretty popular back in the time. - I think people may still use it now, - and it was just like a place you put dashboard widgets so you could click on it and then - you would see that come here. - Well, - let's get through those steps. - What happens when we click on RSS? - If you know, - if I go to the NPR site and I dig around a little bit, - it's even on the home page. - You could click RSS, - and then you find all of the RSS feeds that have available these subscriptions. - We could click on music here, - and what do we get? - Let's take a look. - I'll make this little bigger. - We just get a bunch of data a bunch of data about the link to a certain story, - right? - The title of a story, - The date a story was published here. - This is a bunch of data and it's formatted in the language of XML. - You could see it says it appears, - XML, - um, - this is XML. - So what happens is when you click on the NPR site, - you're basically downloading or transmitting this file right and opening it in some other - service so that when this file updates so that with this file updates here, - I have linked to it and my i Google or my dashboard or Google Reader wherever I am, - subscribe to that. - This data will also update right. - But it's cool because I don't have to worry as a user, - and I have to go back to NPR, - right? - I can just come here. - This is my interface to that data, - right? - You can make these for everything can go to Craigslist, - and you could do a word search and say, - Hey, - if a bike for under $100 comes available, - making our assess for that, - subscribe to it and then view it here as a widget like it's as easy as that. - And in a way that's like a really simple A p I that were using. - And we're using the XML language for that. - So now, - by transmitting this data right or linking to it, - everyone, - I think about it. - We can have that data on the Huffington Post site here, - right, - and then make a link to it, - right? - Or a call on DSA send it to Twitter or receive it from Twitter is like a common language, - right? - It's Ah, - I think it is like the Esperon toe. - And could Wikipedia that was like the common language that was gonna bond all of the - languages English, - French, - Russian. - There's gonna be one language to unify everything. - Well, - in some ways, - we could say XML was sort of like this language that you could send it back and forth like - the Huffington Post could be written in ah, - against PHP or PERL. - It might be it could be written in PERL, - and then we could have the Twitter site, - which is written in Ruby, - right. - And the two of them can talk because they have this language, - this letter, - so to speak, - that you're sending back and forth when they speak back and forth. - We don't talk right to the database, - right? - We're not having the Huffington Post can have access to Twitter's database. - You know, - just is you building an app today can actually get into their database. - There's too much information in there. - It's like the bank fault, - right? - You could compromise their system. - You could take data. - That's not yours. - Direct messages. - That's from your neighbour. - Whoever. - Right. - So we have to put a layer in between there, - right, - A security away for security away. - Teoh rate limit you if you're taking too much data and shut you off And so we put this - middle layer and that's how this works here, - right? - And so instead of giving, - you know, - SQL directly to the database and direct access No, - no. - We put this middle layer here. - Well, - we'll send back. - Maybe XML or Jason will talk about in a 2nd 1 of these languages is common language that we - can send. - And then Twitter was the database, - and then they send it back to us in that data format of XML or Jason. - So what is Jason then? - And how is that different than XML? - What do we do with us? - Well, - Jason, - it's a lightweight data format, - and it's used by many AP eyes. - And so at this point, - I should, - you know, - make clear that Jason is the way of the future with a P I data formatting. - Right. - So we want to use Jason one possibles. - What all those words meant basically, - um XML It's fine. - We can still use XML, - but Jason tends to be the trend moving forward. - And so if you have the option or, - you know, - now you know they're both doing the same job. - But, - you know, - Jason is gonna be a little bit faster, - a little more lightweight and a little bit easier to read. - For most developers, - it's not Jason. - It's Jace on without the A and it stands for JavaScript object notation in the resource - files. - We have some XML and Jason files that have created just raw XML that we can look at. - Here is the XML example front, - NPR and just right into our browsers. - Now we could change things and highlight things just to see what's actually in here. - It's just data noticed. - There's no logic in here, - right? - It's not saying, - You know, - I can only access this if I'm a, - you know, - logged in user. - It's not letting me add up things in my car, - right? - There's no there's no like logic, - or if this or else that it's there's no credentials, - it's just data. - In a way, - it is just like a database. - You know, - Um, - I think of it. - You're probably familiar with CS V Files. - You know, - comma, - separated value, - CSP eyes, - what you use sometimes to export data from excel. - Right, - And you just go and you export it and then you couldn't import it. - Teoh another program or excel, - right? - Another Excel file. - Well, - that's exactly what XML as XML is kind of like that. - For your database, - you can export out as XML right, - or you could even export out of your database as CSP, - but is just one of those kind of common languages that weaken store everything into and - then bring somewhere else and import or do something with Let's take a look at another one - of these, - So here we have Jason Feet. - Now this is what Jason looks like. - Jason. - Some people think it looks a little uglier and you don't have that pink color, - but it's a lot born light weight than XML. - And let me show you what I mean. - Actually have an example of this which is Can you tell? - You know what it is? - It's my likes on Facebook. - Okay, - so you can see my name. - You could see my Facebook i d. - And some of likes the i. - D. - The created time and I have an example of this here which is in Jason that we're looking at - now. - But I also have an example of it in XML so side by side, - you can see how the XML I mean, - while it looks nice and pink in very cleanly tagged, - it's a little verbose tohave category category. - I d i d. - It's repetitive. - Where is this right? - It's a little more clearer. - And this notation also followers. - I mean, - this is little more high level, - but just more standard interfacing with javascript just easy to work with Java script. - It works nicely with a lot of languages, - whereas XML is just a little heavier. - So, - um, - overall, - we want to choose Jason, - and this is one of those reasons why, - uh, - actually you can't even get XML out of the Facebook A p I, - as we'll see in just a bit. - But I converted this just so you guys can take a look how it would look. - So look at this. - Look through it, - get familiar with it. - And in the next project, - we're going to work with parsing this, - which means making an interface for this doing something with it. 6. The Facebook API: Basics & Like Button [12:10]: - the Facebook FBI. - So you're gonna want to come to you. - Developers dot facebook dot com This is the developer site for Facebook, - and it will allow you to have access to the FBI and the data and a lot of other cool - features that the developers have access to. - To even get into this site. - You will need a Facebook account. - Okay, - so everything's kind of tied to your Facebook account. - Uh, - you could just sign in and you should see yourself up here if you don't review, - Obviously. - If you know, - faced with account, - just go set it up if you want to use this site. - Um, - when you get here, - this is cool. - This is a cool place to start. - If you want to see how other companies using Facebook, - you know what are their user conversions or return on investment? - There's some good stuff in there to just get an idea of creative ways to use the Facebook - FBI. - But I'm not gonna read through that. - We're not so interested in that today because we're developers, - right? - We're putting on our develop. - Perhaps we want to jump into the data, - and so I want to direct you up here and this. - These are the main features of how we can get started with the Facebook data. - The docks tab here. - This is where we'll spend most of our time. - We can learn about how to use the A P. - I will be code snippets, - tutorials, - all the good stuff news. - Um, - this is a great page because the team they're really dedicated to giving updates and - tutorials since the since they've started with the A p I. - And so you can look through the archives, - just get a sense of like, - you know, - what's deprecate ID. - Now what's coming up? - It's a really good place to get all this kind of updates and leave some feedback and the - APS so this will make more sense in a bit. - But the apse is where you're going to come to register your app. - Uh, - what we can do is we can look through all the docks. - I mean, - can play with the data. - But when it's time to deploy and go live, - this is really want to come and set up your app, - and it just kind of makes it official. - You get like a token and a secret and all this stuff. - So So let's come to the docks here. - Click on docks and you'll see right away that Facebook FBI. - There's a lot of complexity in here, - you know, - for whether you're developing for IOS or Android the Web, - there's many different options and how you might get started. - What we're interested in today is setting up some a P I calls via the Web. - What we can dig through here a little bit. - Got a core concepts under core concepts. - The first place I want to show you is the social plug ins. - This is the easiest way to get started. - Get your foot in the door and it's something you're very familiar with, - right? - The like button. - So if you're wondering, - how do I get a like button on my site? - You can click on the like button here on. - Do you know you'd reach the documentation that explain how it works? - Some of the best practices, - but right here. - Okay, - so this is the code that you can generate to make a like button, - and when you generate is code, - we simply put it into our site and you're making an A P I call in the background. - It it's so easy to set this up. - They want you to use their data, - of course, - that they want the like button to be and probably every single page in the entire Web. - And so they're being easy as possible. - They're going to generate the code for you. - Let's do that ourselves now and get our site set up with the like button. - To do this, - you'll need the resource files provided in the course. - Okay, - so here we have Facebook. - Basic face with basic is just gonna be a plain HTML file with some CSS and images, - right? - And if I just open this year, - there's nothing in here. - It's just CSS and HTML. - There you go. - No magic. - Let's take a look at the code. - Open up the code. - I could just drag this file to sublime, - and it's really there's just nothing in There is just some basic HTML. - Your 1st 10 minutes of HTML class, - you probably would have learned this here. - And so there we go. - Just have that there. - And so what we're gonna do is you want to grab some code and put it into our site now this - code won't run locally. - Right? - Locally meaning, - if you So I double click this file to open it in chrome or you kind of just dragged it to - chrome. - There's airways. - You can locally update things and view things. - We need to put this on a server. - Now. - We could use ma'am right? - The local server, - or we'll need to put it on. - Ah, - hosting that we set up if you're a bit confused. - Of what? - Those two things I said where Please refer to the set up. - Ah, - but the beginning and how to get hosting or map set up for this. - We actually can't even use local. - We need to put it. - We can't use map. - We need to actually put it on the internet. - It's the only way the Facebook like button will work. - So how are we gonna do that? - Well, - I've used FTP to get into my server, - right. - So my server here that I have set up with host Gator and I can just come and take this file - , - These files I gave you guys and we're just gonna upload them to the internet, - you could either take them from here, - right and dragged them. - That's one way to do it, - or I've also set it up over here. - So this mirrors. - This is what's on my computer and this is what's on the server over here. - So you could have just taken it here. - Dragged it over as well. - This is Transmit. - You may be using cyber duck or some other application, - but again, - all I'm doing is taking those local files, - dragging them onto the Internet. - And I set them up on my domain that I bought, - which is just the sub domain AP ice that seek a ST dot com. - And so now all I have to do is go to the browser to view that. - So I'm gonna go there and you can see this Index. - This is just saying, - Hey, - there's some files here you can get to and I'm gonna click on my folder and there you have - it reviewing that same file that was a second ago on my local on my desktop, - and now when viewing it. - But it's on the Internet. - It's at this address here, - and this will allow me to put a like button on this page and get up and running. - So what do I do? - Well, - let's come back to the depth site. - The first thing is gonna ask us is Hey, - where's the page? - You want to put the like button on and so I can just grab the U R l and paste it in there. - Let's see if it likes it. - I'm gonna think about it. - Looks pretty good not getting any errors, - so I'm just gonna press, - get code to grab the code. - Of course, - you could set some of these parameters. - If you want to change things, - make a different form or whatever, - but we'll just grab a code so you could get code. - And what do we see? - What we see Two steps here and honestly, - if you just read this, - it would be pretty easy, - I think pretty intuitive. - Um, - let me just highlight what needs to happen. - Essentially, - we need to take this code here. - This is what they're calling the sdk, - right? - That's going to allow us. - It's kind of like the library that's going to allow us to do anything with the Facebook ap - I So we just have to include this once into our project and as they tell us. - I mean, - to put it right after the opening body tag. - So that's some pretty basic HTML stuff right there After the opening body tag, - some was pasting it in right there. - Right, - This whole bit Just get out in denting clean it up, - and there we go. - That's step one. - And now the second thing they're telling us is this bit of code here. - No place this where we want the plug into appear. - So wherever I want that, - like, - button to show up now that we're gonna put that code there. - So maybe I want to hear underneath my title, - have a like button. - That's it. - So once I do this, - I can save my code, - right? - I just added the two snippets and upload it to my server. - I don't need to upload everything again the CSS and the images. - Although you could I'm just gonna grab this one index file. - The only place we made the update and transmits going to say, - Hey, - do you want to replace that? - And I'm like, - Yeah, - and so now I'm just gonna come to that address again where I have it here and whenever - fresh boom, - there it is. - We got a like button, - and if you like it right will pop up. - What? - You send a message if you want, - and hopefully my photo will show up for a fresh. - There you go. - If you are this far, - you might want to check your Facebook and unlike it, - so your friends, - unless you want to show them. - But that's what's happening. - That's probably sending that to your newsfeed right about now. - You could also unlike it like that. - And so there we go. - We have a like button set up in our page. - It's pretty easy if you curious what these other options are. - These are just some older ways to do it with the XF b M L. - I frame and you are l but won't want to do with the HTML five way. - This is just the you know, - the best way to do it. - So there we go. - So that's a simple AP I call and these social plug ins that they provide. - There's a lot of really good ones that you can get some super like seemingly powerful ah - functionality in your sight. - But just a few clicks. - So comments, - for example, - is pretty sweet If you want a commenting system, - right? - A threaded commenting system on your site. - Well, - you can click on this social plug in for comments, - and it's the same routine here. - We just need to tell it where we gonna put this, - and I'm gonna put it on that same mural. - Of course you're gonna put yours wherever you're hosting it on the server. - We could set the with number of posts if we want all this, - But we're just gonna grab the code again. - We want the HTML five version. - Now, - We don't need this library again, - because this is, - you know, - we've already done that again. - This is like the injection of were connected to Facebook, - right? - We're bringing in that connection, - but this is all we're gonna need forever. - We want a place, - the comment system. - So I'm gonna grab that and come back to my project. - And let's say we had an H two here and I could just make any chooses comments. - That's just some HTML and I can pace that code. - There we go. - And now I'm just gonna updates filed by dragging and dropping it on the server. - Yep. - I want to replace what's there? - Come back to our projects very fresh. - And there you have it. - We have a comment system as well. - So now you could write a comment pretty cool. 7. The Facebook API: The Graph API [9:24]: - next. - We want to look at the graph a p I. - That's going to be under a p I reference and graph a p i the graph AP I It's like the core - of the Facebook FBI. - There's a lot of data here in the graph FBI and so we can look here and click on graph FBI - to enter. - And we'll see a lot of details here and how to get started and what kind of information we - have access to things like the albums the friends links, - messages, - tons of stuff in here that we could grab. - But hold on, - let me let me back up a second and I'm gonna give you guys some code that I got just from - this page here just on how to get started with the simplest AP I call using the graph a p I - , - and this will help us see it in action and make some sense of it. - What you're gonna want to do is look at the Facebook me example I've given you that's gonna - be under Facebook. - It's with me this year and let's upload this story server and see what happens. - Minute, - come back and put it in the root here. - And then we have Facebook. - Me and so I just uploaded it. - They're just drag and drop it there. - So now I have Facebook, - me and all of those files on my server. - You may have noticed how I changed from dot html in the last example to dot PHP. - And that's because we're gonna be writing some PHP code in there. - Let's take a look first. - What's going on? - Well, - if you come to your server and you refresh well, - you should see something like this and I'm gonna click on Facebook. - Me and you should probably see my name showing up, - right, - just like this year. - So it's the template that I gave you as the html CSS template. - No magic there and then just this name here. - Now this name this is coming from the Facebook database. - This is an A P. - I call. - Let's look at how I did that. - We can open up the index that PHP file in sublime by dragging it or I just or I just did - command. - Oh, - and I've written the code for this example so that we can see what happened without Evan. - Actually do any code in this round. - So here to here we have the basic PHP call, - right? - Everything else is just some HTML, - but because the stock is called dot PHP were allowed to put into PHP code here. - And so I put some in. - And what did I do? - Well, - I made a really basic call to the FBI. - Here. - See this girl here? - Why don't we take this and put it in the browser and see what's there? - Okay, - there we go. - What is this? - What kind of code is this? - Do you guys remember? - It's maybe XML or Jason, - right? - This is some Jace. - Um, - if you can recall with the curly braces Yeah. - Is this, - um, - Jason code that you can get from the graph a p I And this is the only public data that - Facebook's made available. - Then you can come here and you can put in your own handle, - right? - Your vanity name or whatever it is or your number even says my Facebook number. - That would work the same if you put your number and you'll get this public data. - And so now we can take this Jason feed and that you are well comes into our project. - And so here we have the URL. - And what are we doing with this? - You're l? - Well, - we can use this function here, - right? - So there's this function in PHP and you can see it once looked like this. - And so anything that I put between this and the two parentheses, - it's going to grab that Web page, - right? - It's gonna grab what's on that webpage. - The code. - Well, - what's on that page? - We know there's that Jason Data. - So that's exactly what it's doing. - It's taking that Jason Data pulling it into our project, - and specifically, - we're assigning it to a variable here. - Right. - So we're kind of just like putting into this little word of this bucket so that all of that - data is now accessible through this one word here. - This next step here, - This is just a standard step. - We need to put it in the function. - J. - Sandy code. - Right. - So again, - we're just putting this here into this year. - You just need to go through this step here to decode the Jason. - And now we have the output and we are good to go. - So those the two steps, - we pull it in, - Put into a variable to code the Jason. - This stuff here, - This line down here. - Echo. - Remember, - Echo prints out what we have is gonna print out our name, - but that's not gonna make maybe so much sense right now. - I want to, - um, - look at where I got that from. - So these lines here, - this is where he contests to see the output, - Basically, - to just check. - You know, - is this stuff coming incorrectly? - And if it's coming incorrectly, - Well, - what's the data that were pulling in? - So I can uncommon this right? - So you'll notice there's the's great out pieces of code. - This is commented code. - It doesn't get executed while it's gray. - Um, - there's two different ways to do it. - We have this block one here, - Right? - This one here. - You see, - if I remove that now we're have this exit units would work, - but that's not even code. - So that would error. - But so we just want to get rid of these and we can try if we can comment these out here - like this. - Well, - now this PHP code that I've written this will run right from top to bottom it's gonna read - through here. - And this is just some testing that you can dio The powerful thing here is this print are - Let me show you what it does. - So I'm gonna save this. - Come back uploaded to your server, - refresh and we refresh that print art took that variable tick wallet data and now it's - displaying it here on our page. - Right? - And so exactly all of this here that's on Facebook site we contest in, - say, - Oh, - actually, - that's coming out here on our site, - right? - So again, - we pulled in the data. - That was the first step. - And then we're just testing and we're saying, - OK, - everything's here. - And now that third step is just taking what we want and bringing that specific piece of - data into our project. - And so, - you know, - I just wanted the dame rights name here, - so I grabbed it. - Well, - how did I do that? - Well, - the way we grab the name was we take the graph Alp variable. - Remember, - everything's in here right now, - and then we just dig through it a little bit and so we go. - This is the symbol to go through an object and we went taking everything into consideration - . - I want the name right and let's look that looks like again. - So here's everything and I want the name. - So I just take what I want. - All right. - If I wanted the gender, - I couldn't comment. - This year, - you'll see we'll grab the gender right And if I wanted the This one's a little tricky into - this, - but this will take your I D and pull your image based on the i d. - So let's see if we grab a name. - We did that one. - Let's grab the gender and the I D to make this image and let's see what happens now when - they're fresh. - There you go. - So now I'm just pulling out the name, - the gender, - right, - And the photo there. - And if I do a control view page source well, - what's actually happening into the hood? - We'll notice. - Of course, - none of the PHP is printing out, - but the output code is right. - The, - uh this is by testing and my name right, - and the image says that image. - And you can see this the link that I created this graph dot facebook dot com image right - Click on it will bring me to that image on Facebook's page. - There you go. - I am. - And there you have it. - No, - I So I can get rid of my testing here. - I don't need that anymore. - And we can have our page that we made. - Also, - if you were looking at the testing code, - there were some things that pre opening close that just kind of formats. - This in a nice way view. - If you were to remove this, - it would still work. - This one and this one. - This is the powerful line that lets you do the testing. - But this just kind of formats it the pre formatting. - So yes, - all together we have that and we're pulling in some data into our project. 8. The Facebook API: The Graph Explorer [29:02]: - the next project I want to work on with the graph a p I is getting into the photos by photo - albums and Facebook and pulling that data into our project. - Let's say we had ah, - blawg or, - you know, - some kind of profile that we want to take some of our photos mean we're making a photo - gallery, - and we wanted the latest updated photos from Facebook to you also update on our home page. - Right? - That'd be pretty cool. - So how do we get access to that data and then pull it into our own project? - Well, - we want to start with a graph a p I. - And I'm not sure you an easier way to look through the documentation of the graph a p I. - We can click on tools here. - And the first option here is the graph ap I explorer, - the graph FBI Explorer, - if we click into it, - will allow us to funnel through the data in the graph FBI. - So we can see basically hate. - What data can I get out of here like how much is in here and how do I query it? - Let me show you what I mean. - So the thing we just did the most basic is just taking your name here, - our number, - right? - And querying that data. - And we had at first what we had, - if you remember, - was just was just this bit of public data. - Now, - of course, - information on Facebook is private, - right? - Most everything except for this little bit here. - You know, - my list of friends my list likes, - you know, - all that kind of stuff. - I don't want everyone having access to that data, - right? - Just as if I'm not like friends with you on Facebook, - I can't even see most of your photos, - right? - Right now, - like with the human interface with me clicking around. - And so the same goes with the data. - I don't have permission to get that stuff. - Let's come back to the graph Explorer. - But what we can do is we can get permission for that. - And what that's going to be called is this access token, - right? - And the access token is like a password or some permissions that we have. - We've been granted so that when we use this token with our code will be able to get more - than just the public data you dig into the good stuff? - All right, - So how do we start using this? - Well, - let's find some data that we want to use the graph. - Explorer, - will, - you can simply come and just start playing around the Jason code here and zooming through - it. - And you can also come over here to the left and take around a little bit. - You see, - if I click here, - I'll be able to get all of the information. - First name. - Just get the first name. - Let's say we wanted music. - What? - We can come down here and click on music. - You have to click the submit button after we make requests, - and it will bring us back the data. - And so then here we get the Jason feeds. - This here would be the entire bit of code. - Everything that you've ever liked, - that acid it with music. - You get that whole Jason feed and it comes in a you Earl, - which is gonna be right here. - This is gonna be the new your l we need. - And this your l if you click that there, - you actually see the full your l That's what that ISS and then they're just abbreviating it - there. - But we can get this full your l receiving Grab that and bring that into our project. - But now we can't just come and go to the browser like we did before this year. - Right? - Because if I append that on here and I we're gonna get an error, - it's gonna say error access token is required to request this resource. - So what? - That sayings. - Yeah, - basically, - I don't have permission to get this stuff. - Well, - what we can do is we can use this access. - Took it. - So they're granting us an access token. - Um, - this one they're giving us here, - it's temporary. - I think it lasts for about an hour, - but we can use it. - Let's just see what it does first, - So I'm gonna copy it. - You want to come here and append to the end of the URL and access underscore? - Token Equals says that the party added here and access underscore token equals and then - paste in that access token. - And now if I return There you go. - So now have access to all that data, - just as it did with the first example. - Right. - So back here, - you can see we have our access token when we click this year could get access talking. - You'll see the access we have now. - You may or may not have some of these checked, - but if you want access to birthday or to the likes, - right, - you have to actually check this and then get an access token and you're getting a special - token it wants me to do this year. - You may have to log in again, - are verify it. - But I've already clicked all mine, - So unlimited access, - which is kind of cool in your testing, - right When you're testing, - you could play around the token that has unlimited access. - When we go live, - you may want to limit it and just have just likes or just the events with one thing you - need because what you're going to see and this is going to the future a little bit right of - deploying it. - But what you'll see is I'm gonna come on. - And if I'm a random user, - it's gonna say, - Hey, - I want to access your likes. - But if you're asking for everything your likes, - your friends, - your friends of friends, - your photos, - I'm gonna as a user of you like Why do you need so much information? - You know the site if it's Huffington Post, - er whatever, - blawg. - Um And so that's where that's where these permissions come in. - When we're testing, - we can take everything because we just want to see what we can get. - But then we probably want a parrot down when it's time to launch that we don't, - you know, - intimidate our user and be like a or taking everything from you. - And so there you go, - there we have it and we have access to our data. - Well, - what I want to do now is I'm not gonna take music. - I'm gonna take Get rid of these here. - I'm gonna take some vote photos. - Me going to the photo album. - See how we do that. - If I click here, - you can look for photos, - Photos down here. - Click on that. - Remember, - we need to resubmit it. - There it goes and cool. - Now we have the photo data, - the I D. - Which is my i d and each of the photos. - You notice that for one photo, - we have various sizes to its storing different sizes of that one photo. - So we're going to get into this in a second before I go to that, - let's see what's going on here. - Notice how I'm a pending anything after this question mark. - It's becomes little variables. - And so I'm saying we're field equals photos, - right? - And so what that's doing is it's going and looking for the table in the database where it - can pull all that data about just about photos. - And so we're getting specific. - Remember when we just had this? - It was either the public or the front facing data, - but now we're like, - specifically drilling in. - You don't have to worry too much about writing this by hand. - It's just kind of good to know what it's doing. - That's why this Explorer it helps make thes queries for us. - And then all we have to do is take this girl right now. - I'm gonna take this your own bringing into my code, - and we'll do it by scratch this time. - So we're taking your HTML. - This is just the index html that we had, - right index, - that PHP that I created. - So we have this index that PHP and I'm saying, - Hey, - I'm gonna write some PHP inside of the HTML. - It's here And what PHP do I want to write? - Well, - the first thing I'm gonna do and its plot this out with some comments men, - if all the same procedure as they did in the last example. - The first thing I'm gonna dio is I want to get the data. - The second thing will need to Dio is a test of the data. - You need to do that, - but helpful. - And finally, - we will print out the results. - So I like to put my comments and steps, - so I know that, - you know, - in English these are the three things I need to do logically, - and it makes it easier. - I could just go through now and kind of translate that into the PHP language. - So get the data from Facebook. - Well, - we know where the girl is. - We have that. - And we have the code from the last example cause I should yet to do it. - And so you could pause here and you look back at that and take this upon yourself if you - want to play with it. - But let's go through. - I'll do it right now. - So we need to take that you, - Earl, - we need to take that. - You are l using the function file file. - Get contents and you could see sublime. - Help me out. - It's like a what file do you want to get? - And the final I want to get is going to be at a URL, - right? - It's gonna be a that Facebook, - your all. - Not that That's not the whole thing. - So we need to go back to the graph. - Explorer. - What was it again? - OK, - it's graphed out facebook dot com with all this stuff right, - Furthermore, - unity this access token in the 2nd 1 was gonna grab it now. - So graft at facebook dot com With that, - there we go. - Looks pretty good. - And remember, - I always need to upend my access token and access token equals There you go. - And I always need to end everything I do in PHP with this semicolon ends the line. - So I'm taking all of this content an ominous sign it to a variable. - Of course, - I can call this very well anything I want, - but I call it the graph. - You are l which makes sense and I need to take all of that Jason we're taking and I need to - decode it, - decode it so that I can use it in my PHP. - Project groups want to use a variable. - So he's the dollar sign and the line with semicolon so that it knows the lines finish. - And then I can make a new variable to put this into. - There we go. - There's there are steps. - So all of this goes into their now. - I could do stuff with that. - And I'm doing What am I doing with them decoding it? - And that decoding happens. - And now it's in this word here. - So we're just going step by step, - kind of knocking it around. - And now we want to use that graph output. - And so we contest. - Let's test to make sure that graph out but worked properly. - So these prints are this print our function, - and I'll just put graph up in there and and line we're done. - This looks pretty good. - So I'm saving this and uploading it to the server I need to do is take it from your local - right. - So this template file upload it here. - And when I come to the site now I can see you Facebook photos click on that, - and I haven't error has failed. - Open stream. - Http. - Request up. - Okay, - so, - you know, - sometimes this will happen. - It's pretty normal when you're developing stuff that you're gonna have an error come up and - generally and PHP the errors are somewhat friendly. - Like they're trying to help you. - They're gonna tell you like the line that era razon or try to describe best they can. - What was up? - Um, - it may be that this is Http s. - That would be my guests, - and I just copied it wrong. - So let's take a look at the explorers. - I look at that wrong, - and yet you could see, - Actually, - it needs to be HD to be s, - which kind of makes sense. - So if you come back to your code, - right? - And we were just at the s here. - Http s save it and upload it. - Now, - when I come back to my projects and I refresh Okay. - Cool. - There. - We got it. - All the data is test. - Everything's working. - That is a lot of data. - Whoa. - Okay, - cool. - It's all coming into my project. - That looks good. - Another way that I could have tested that https thing was to just put that whole earl up in - the browser and see if it was working here. - You can see that when I take the s away here. - This is the error I was getting. - So this is a good way to Testa's well, - with the S. - It works perfect. - Very cool. - So now I have all the data in my project, - and this looks kind of messy, - so we can clean that up a little bit if you remember. - In the first example, - I cited that if you put these pre tags around the test formats it for you and so open and - close in the line, - save it back and refresh very ghetto. - And if you're wondering I'm working off the server with that PHP file. - I would recommend that you just uploaded each time and drag and drop it. - Um, - you know, - take your time with this pause and do what you have to dio. - I'm just doing that for speed sakes, - you know, - watch me. - But every time but in what I'm basically doing is in transmit. - You can just go here and just open file with It's not really the best way to definitely - wouldn't recommend it on the production for a client or anything. - But if you're just playing around and ah, - you know, - trying the Lord and I think it's fine. - So that's alleged there. - And now we can see the same data that that mess of data that was pouring down the page, - but it's organized a little bit better. - So now I can read it. - And, - baby, - it still looks a bit scary. - But I mean, - look, - it's fairly to it. - If we read through it, - there's an I D of the number. - Then there's something called photos objects. - Something called a ray of this could get a little scary. - Well, - let me show you how to read through this and get what we want. - You know, - first, - my eye goes to you. - Well, - what do I want? - Well, - I don't know, - man. - So many things. - Um, - what if we were to just take one of these images, - right? - Some of this data and open it. - I mean, - I think it be cool if we could show some of the images that I want. - The source. - It's the width and height for that. - I don't want a smaller image. - Maybe I'll take a smaller image I'll take this. - This one down here, - this one that's to 40 by 3 20 Right. - These air, - actually, - all the same image. - I mean, - I know that already, - but you could just test them by copying that link and pasting into the browser. - There you go. - You can see that there. - All right. - And you would see it if I were to grab a different one. - There you go. - This one there looking pretty good. - Um, - cool. - So if I wanted to bring these into my projects right, - you could pick the size. - You want whatever one you want. - And now that I know the data that I want now, - you just have to find how do I go down this tree to grab that data? - Well, - let's start here. - I need something called source and we just work our way back. - Source six. - That's inside of images. - Images is inside of zero data. - This gets a little bit confusing. - I'm not gonna lie. - This takes a little while, - but the idea here, - the concept is that I have to kind of dig through this tree, - right to find that piece of data I want. - And so let me show you how this might look. - Let's start at the top and go back down. - So at the top, - let's just say we wanted to get the I d will start something simple to get the i d. - All I need to dio take that output and say I want the I D. - That one's pretty easy. - Let's save it and take a look at what we got. - So if it dragged down to the page, - all the bottom quote that see a day So I'm pulling that piece out right? - And I printed that out of the bottom. - Looks like it's part of everything, - but I printed it out their Colson. - Now we know that. - That's how you get the idea. - That's pretty easy. - I just said Pointed to I D. - Well, - if you want to go one level deeper, - what if we wanted to get the i d for the photo or the photo name of the person that - uploaded it? - So for that, - and this is gonna be a little tricky when you do an object. - So I had an object. - We use that arrow that I just use the arrow i d. - But now I need to go these air on the same level. - I need to go one level deeper into the array, - and it's gonna look a little bit different. - I'm needs these brackets, - so I'm gonna do I d data zero array and then arrow I d. - That's an object to a narrow name. - So let me just do that and we'll see how it works. - See if I remember. - So what? - I said there was a need to say, - Just tried a different line. - Graph output. - That's what it's called. - I need to go to you. - Was that again? - Photos data zero. - So photos is an object, - and then data zero it said array. - So it looks like that with these break its brackets here and then once I'm there, - I need to go into I d. - I know I need to go into from name, - and that's an object object. - So it follows this index year from name. - All right, - so if this works, - I should be printing out the i d. - I'm gonna comment this out. - We don't need that anymore. - So it should be printing out the person's name that uploaded that photo of me. - So got that. - We're saving it. - And when you refresh and I come down to the bottom of the page yeah, - we grabbed it. - We grab the name. - Where? - There. - There you go. - Looks pretty good. - And, - ah, - you know I can I can put some if I want to put like an H two before they're each three and - then after their this will just put some HTML tags around it so that we can see it's - different and we can see. - So basically, - this is just some HTML on putting an HTML open and close. - And then anything between there's that data. - Let's take a look. - So I'm saving this. - And so now we won't actually get that photo right. - So instead of going into from, - I want to go into images, - noted a sounds on the same line. - So I want images. - And then which one did we want? - We want the smaller one. - So images. - Let's say this one here, - we'll get five. - So images. - Five source. - That's where that lies. - So let's see if we can grab that. - So instead of from its images images five, - remember? - Was it a ray and it was five source like that, - so that should be the full. - See if it works. - There you go. - So now we have that you are well, - so I'm pulling that your URL into my project. - Right? - That director where? - L and that's really powerful. - Because what can I do with that? - Of course I can put it in image tags. - Let's take a look. - And so now that we have that direct reference to the image, - this is that image link, - right? - Well, - now I can just use some HTML to print out the image ends. - What would that look like? - Well, - they might just wrap an image tag and sort of image source just like an HTML. - And then here I want Teoh, - and this is a little bit advanced. - But what I'm doing is I'm just as I would write some normal html amazing print out some - HTML and then join this image as the image that would be like the reference to it. - Then we need to end this here like this. - So let's take a look and see if that worked. - And there you go get the photo down there. - Cool. - So now we come back our code. - Just explain again. - We have this image tag, - This opening image tack. - And what we're doing is we're just where you would put the image, - right. - We're just putting this, - which represents the image that these join it. - Right? - So if you've ever used java skirt before, - use a plus here. - We're using PHP s dots, - and this is escaping. - So what this means is, - well, - you need to have a this ah, - double quote here, - just in html. - And if you put that there ends, - if you had one, - it would end. - And so we need to have this here escaping. - It kind of allows it to print out if I view source. - All right, - So they escaped one prints, - outs, - and then I can see it there. - Right, - cause it needs to be there on both sides. - Ah, - and it doesn't get ready, - is PHP. - It just knows how you put that back slash before it. - I actually want to see that when it prints out in the code. - So that's this piece right here. - And then this ends, - joins us. - A little works cool. - So now we have one image, - and ah, - I don't think we need to test anymore. - I can comment this out here. - I just did command question Mark my browser and the comments at all that. - So I won't see that testing good and everyone to point out multiple images. - Um, - all they would do is take this line here and just copy it twice. - Really? - Right. - And I could put a b r at the end here if I want to just separate these, - right? - So just break the line so they don't sit next to each other. - And this would be the same image twice. - But if I wanted to go through to a different image, - I can just go to one writes, - I'm just going down that tree. - Come back here. - I fresh. - She had two photos. - And so now if I add another one here rates at a second photo and 1/3 photo and I'm just put - on these be ours to break the line after each time. - Now I'll put out the three most recent photos from that list of photos. - And when we come back to the site and refresh Lario, - you see three photos, - some weird stuff that's coming from my timeline. - I think Christmas pyramid here. - Great. - Uh, - And so that's how that works. - Um, - those numbers here are each of the numbers. - And remember, - we're just reading that from the Jason. - These were the sizes you remember. - So it kind of makes sense that if you want to make them smaller, - we could probably choose a smaller. - Remember, - they were going incrementally. - Those would shrink, - and we could even make them something like eight Weaken. - Go back to the testing if you wanted to see, - I think eight is option for a very small photo. - Let's undo the testing and come back and see if it works. - And we're just 80234567 eight yet but the smallest size er here, - So eight would be 97 by 1 30 And if you go to the bottom of the page, - you can see Yes, - they all came in like that. - So that's what we're doing here. - We're reading these, - uh, - these objects in these arrays. - That's what this is. - And it's it's all part of the Jason that is being brought into our project. - So finally, - I'm just gonna top this off. - This is getting a little advanced here, - but you should get a sense for, - like, - what's possible. - But it's You may notice that, - like these numbers like this is a little inefficient because, - I don't know, - hard coating these. - And I'm repeating the same thing. - Three lines. - So what we could do is we could loop through so that we could just put one line and have a - loop. - It just says, - Well, - now it zero the next time it's one of the next time, - it's too. - Can you imagine? - Right? - So I just have this one line here, - right? - So get rid of these here. - And what if we wrote a little loop so that it changed right incrementally and that would be - pretty nice. - It would be less co two be easier to manage and what that's gonna look like. - It's gonna be a four loop, - and this is just ah, - you know, - a standard coding concept. - It's in many concepts, - and it's gonna look like four, - right? - It's gonna write it all out. - Oh, - I know I know what you're thinking. - It's horrible. - It's standard and really what it's saying if you just kind of copied it, - you just have it in here saying, - um, - I this thing I'm making up. - I was variable, - I whatever that is and call whatever I zero as long as zero is less than five do this thing - . - And so each time will go through and make it one more. - So it would be like I plus plus +0123 and increment. - So if I put this number and here in place of zero the first time this I will be zero, - it'll go again. - Plus plus will be +12345 stop, - Right as long as it's less than five. - So it's gonna print out five times five images and then it's going to stop because I'm - saying less than five. - And so we do this correct. - Come back here. - And so I'm gonna undo Undo this. - Commenting here. - We don't need the comments, - the testing anymore. - Just want the five images gonna refresh. - And there you go. - So now we have our five images printing out. - That's pretty sweet, - little blawg. - And again, - this would update in real time if I would add more photos to my timeline. - Right. - And we're going from zero photo to the five photo. - You could even go back in time and say something like Started number 10 and then go through - 10 to 15 whenever you have flexibility there. - But that's essentially what you're doing. - You're in commending this number and that increments here, - and you can have some fun with that. - So this is our example of photos. - And Ah, - please look through that and look through the graphic spore and have some fun. 9. Facebook: Recap & Beyond [3:44]: - There are a ton of other options and features available in the A P. - I so weaken keeping into the graph a B I or you can click around the docks a little bit - more and you may come across Facebook. - Query language, - SQL and F UL. - It's pretty much the same as the graph a p I and you know ad price. - Start with a graph a B I. - But SQL allows you to do just a few more. - There's a few more things you can't do with the graph api I, - but you can get access to with F u L. - And the nice thing about EFC ul is it's very similar to SQL right, - which many people are familiar with, - so that you can query the database and, - well, - what's going on here. - You can see Yes, - you're basically writing statements just like SQL Select name from user so that you can get - that kind of data and they give you a lot of examples here. - We couldn't click around a bit under the FBI references and find all of the tables that we - have access to in Facebook's database and all of the common and all of the columns to so - for the photos table. - And you can see the columns. - We have what each one is doing. - And of course, - of course, - this isn't SQL right? - Were no have total control, - but F g well, - they're limiting in some ways, - but this is what we have access to. - Digging further into the FBI. - You may see the open graph the open graph that I don't know why it sounds so much like the - social graph. - It's pretty confusing, - but, - um, - open graph what this is This allows you if you want to go beyond a like button and you've - seen this before, - I can say, - Hey, - Chris cooked something right or Spotify is really popular when you see it's like someone - listen to a song on Spotify So this allows you to use extra verbs and that kind of stuff, - the actions and objects is what they call it here. - So if you're interested in that, - you may want to learn more about using the open graph. - And when you're finally ready to put your thing live on the Internet, - remember the access codes we've been using? - They're just kind of basic, - but you're going to need to get familiar with the sdk for PHP if you're gonna use PHP and - this will show you how to set up your I d in your secret, - the permanent ones and get users to your site. - It's a bit more complicated than just this. - You'd have to read through the documentation, - but essentially, - you're putting this on your site. - Someone can either Facebook connect right and connect into your site. - Or you can get in access to come from some other way from your user. - But that person has to authenticate you on their site. - You'll also need to get the app I D and Secret, - right? - These things, - Um, - And by doing that, - and to do that, - you need to go to APS here and absolute value to register your domain. - And so you would click on, - create new app and you put in your app, - name, - name, - space, - and what they'll do is they'll set you up with this here. - You don't need to fill out a few more things that will prompt to you as faras your l in - your name and authenticate it and stuff. - But it only takes a few minutes to get set up and you get your own app, - key and your secret and using that with the sdk. - Putting this on your server reading through this, - you should be able to get up and going with the face with the FBI and throw it live up - until here, - you could just do the like button. - Remember the like button. - It makes it so easy. - You don't even need to authenticate your user. - It just does it kind of automatically for you. 10. The Twilio API [12:08]: - able Now we're gonna look at the twilio AP I twilio is pretty cool. - They allow software developers to programmatically write some code that interacts with a - phone or an SMS, - right? - What that means is I can write some code that makes your phone ring right. - Or when you call me, - you can leave a message, - and I can put it in my database or do something with it. - Right? - Um, - you know, - typically, - you would rely on a big, - you know, - big system in the past, - like cisco or something. - Teoh set up Ah, - calling. - You know, - press one for this option. - Press two for this option. - This whole, - this whole thing of routing actually, - no idea that works, - But I do know twilio works. - It's super easy. - Um, - you can get started just by signing up for an account and writing some PHP code. - And that's what we're gonna dio. - It's pretty great. - And so what you see here is we're going to write some goat and it's gonna you know, - we're gonna help get up to you twilio, - and then we'll have the phone interact with it and magically, - things will happen. - So to get started with twilio. - We need to comment to you twilio dot com and we're going to sign up for an account. - We can come over here and click on the log in button. - Don't click on the register now. - It's a little bit of a bad ux. - Some people click on that and register for the seminar. - What we're gonna do is actually log in and get an account. - So we log in here and of course, - we may not have an account yet, - but we can sign up for free. - All right, - great. - So we just want to put in her name here and get started. - Well, - the first thing they're gonna ask you to do is just Do you verify that your riel? - And so you just need to throw in your phone number here and click text me Just go through - the next few steps, - getting set up. - Twilio sent me an SMS. - I put in the verification, - just go through that little step, - and now they will assign you. - Ah, - phone number. - Right. - So this is my phone number, - right? - That I can use for my only for my account of the giving me here. - Um, - and you could choose your own if you want and get a different get a different phone number - . - Area code. - Gonna fall of flexibility. - Once you do a paint account, - you could even get an 800 number, - which might be cool for your business. - But we're just gonna stick with this one that they're giving me, - and I'm gonna get started. - Giulio really wants to make this easy for you right now. - They're showing you that you can just send an SMS, - make a call, - receive a call. - You can do all this basic stuff right here without even writing a line of code. - So if I want to send myself a message, - send SMS. - Yeah, - I just heard it go. - Um, - and so it send me that sms to my phone number, - and now they're kind of walking you through the steps. - They're like, - this would be the code to execute that. - This is some curl you could execute via your code if you wanted to. - Um and they would do the same for each of these here. - But let's go into the account, - and we're gonna walk through reading some of the code ourselves when you get in here. - We have a trial account, - right, - And they're telling us you have a trial account. - You could use it pretty much as much as you want, - you know, - But you're going to get this message when we if you call, - if you use that number, - it's gonna say you're using a trial account. - And so that's basically how this works. - Um, - you can put $20 into your account. - This would be removed. - That message would be removed on You could just upgrade if you want, - but we're fine. - Just using the trial account we can get to see you know just how things are working. - Do a few things Note here. - Um, - we have this account s i D. - Which is going to be our account secret I d. - And we have this account token. - If you click this here, - you'll get the token. - It will appear that they're right. - So these were going to be kind of like our passwords, - right? - The s i d. - The secret and the token. - Those are data that we can pass with our request. - So that were like, - Hey, - this is who I am. - These air secret like I have these right, - and, - ah, - Windows, - who I am clicking on numbers here at the top will show us the numbers that we've bought, - so you can buy multiple numbers if you want. - As you've seen, - they gave us a default number, - but if you want to put as many numbers, - you know we could buy a new number. - They are a dollar each. - That's a dollar for most normal numbers in $2 for a 1 800 number. - And then if we click into the number, - so want to click into the number here, - you'll see we have some options. - So here, - voice requests your l. - What this is saying is that if I put a direct link to a file right, - like a file on my server, - when I call this number, - Twilio will read the code in this file and do whatever I tell it to Dio. - That's pretty cool. - That's what you want to do. - It would be cool if we could call this number right and then write a message in some code. - It's like, - Hey, - how's it going right? - Or it could place a music for us or a bunch of different things, - and so that's what we're gonna do now we're going to write some code in sublime right and - sublime text editor, - and we're gonna uploaded to the server and then we're gonna find that link and put it here - so that when we call this number, - any of the code we write is going to executed. - So I want to direct you to the class files, - and here I have a template that I've made. - And if I just open this up in supply, - I'm you'll see that it's just two lines of code. - This is gonna be the header that we're gonna need just the top of our pages. - So I just did that for you just cause it makes it easy less copying and pasting. - Um and we have it here. - And so what I'm gonna do is I'm gonna create a duplicate of this and rename it, - and I'll call this Say hello. - So now I have in my template, - just in case you guys need to come back and you want to make a new one later and we're just - gonna work in the copy. - Say hello. - I'm gonna open this in sublime when you make a call and interact with Giulio. - We use the language of twin will. - This is a market language that twilio has created for us. - Interact with, - and it's pretty easy to get started with. - Here is an example a response. - And if I call, - you're gonna get a voice of a woman that's going to say, - please leave a message after the tone, - hopefully with not his deep voice and ah, - in a way to record. - All right, - But this is the twin language, - and you may notice from a previous lesson that this is really just some XML code. - It's some XML co that they've standardized for their system so that when you use thes calls - , - you get a certain kind of response. - We're gonna look a twinkle in a little more in just one second. - But I also want to point out here, - um, - the helper libraries here So twilio can be accessed using any programming language here, - and you can see they have libraries for each of the language that will help you out. - So these are just based to get you started. - And there's so many good ones. - Maybe once you've never even heard of the great thing about using the twilio a p I is The - documentation is so well written. - I think they make it just so easy to get started and to even learn about the concepts of AP - eyes. - If you are new, - JP II's in general and so that's why I would recommend it. - Facebook is also good. - I find Twitter to be confusing lately for for newbies and, - um not recommending that. - But this is working really well, - so you can see we can use it for all the different languages. - And they have a bunch of how twos. - So then, - for each of the languages, - these are tutorials that they've written step by step. - You can see this one. - They have the code for PHP. - In Ruby, - you can go down call screening so that you can set up all these. - Really? - They're just applications, - right? - These are applications that someone has written that twilio is written for us. - Teoh, - do some really cool stuff and the list goes on and on and on. - This is a great way. - You can go in here and just copy some code. - Read the documentation. - What did they dio right, - But before we go there. - You may need to understand. - Well, - how do we start writing the code and where do we put it? - So that's what we're gonna look at here so that you can just write some of the most basic - twilio commands and get it going. - So that is so. - That is why we're going to use twiddle. - Okay, - So twin will Here, - we can look through it. - You can see we have some twin will verbs so we can do things like, - Say, - which is gonna say a message to us will read the text, - right? - Play is gonna play some audio, - etcetera, - etcetera. - Let's just try what say first, - How would we invoke say verb? - We're going to come to our code here. - And remember I said, - this is the header. - This needs to be there, - and we're going to start off by righting response. - Great. - And so everything between their if we put a twilio, - the twin will actually a verb. - We'll get executed so I can write something like that and that's all we need. - And so now I can save this and I want to put it on my server. - Once it's up on my server I just need to go find the URL Cool. - There's the file I created. - And there we go. - That's what you want to see. - So there's some XML, - and that's exactly how it should look. - And this is the direct link to that code. - So now let me to do is take this code and paste it in here underneath her number. - So a voice, - a crest, - and this is where it will go. - So that looks good. - I can save this change. - Great. - Awesome. - So let's give it a try. - I'm gonna call this number now. - Hello. - Thanks for being awesome. - And it worked. - Yeah, - that's all there is to it. - So, - in addition, - you can click on numbers here, - twilio numbers, - and I have that open and you can buy another number if you want. - Here's where you would come to buy toll free number. - Of course you're going to pay. - Like I mentioned, - it's gonna be $2 for that. - So there's some other features here we can look at. - We can also look at the logs and the logs will take a snapshot of whoever is calling that - number. - So I just call that number and there it is. - This is the call I made and have a record of that number. - There 11. APIs for Every Occasion [5:35]: - so there are thousands of AP eyes available on the Internet that you can start reading the - documentation for and getting set up with. - You have the basics of Jason XML. - You know how to set it up under server by now, - and we have a little bit of an idea of how access tokens will be needed to give us off - indication. - Usually, - you'll need some kind of access token for most AP eyes. - Here's a view use cases that I've seen for interesting ways of influencing AP eyes. - So again, - just at a higher level here was gonna kind of overview and look at some implementations. - Puppy stream. - This is a startup. - They were wondering, - How could we launch a photo sharing site without building a mobile app? - Right, - So they didn't have the resource is to build a mobile app, - but they wanted to have a way that somebody could upload via their phone. - Well, - you know, - why reinvent the wheel if you think about it? - There's already so many photo applications on your phone are ready. - And so what puppy stream did was they used instagram and via the AP? - I now think about how this works on their site that middle bit there, - that yellow middle bit. - They have what's like a listener. - It's a listener, - and it's just basically looking at when people upload on instagram, - right? - And if someone uploads on Instagram, - who's also authenticated with site So a user off, - um, - uploads via instagram and hashes it, - puppy stream. - Well, - then the puppy stream site. - It recognizes it goes up somebody who's a user of the site and just did a hash puppy stream - is here. - Let's grab that photo So it takes in that Jason, - you know, - similar to how you would take photos with Facebook, - right in our example. - And it takes that Jason and it pulls in in, - and it stores that photo on the puppy stream site. - It makes reference in their own database rights. - Now they have captured that data, - and that's a pretty easy way to do it, - to leverage what's already out there. - And you can even then Macon automation to then post it to Facebook on behalf of this user, - right? - So all they have is this one code base in the middle, - but they're leveraging different AP eyes to make its social and to really not reinvent the - wheel with technology, - Sonar was wondering, - You know, - how can we bring in connections from other social media sources? - The problem they had was, - you know, - just the empty party problem. - You download an app in the APP store, - you come on, - nobody's using app. - So how do we solve that problem there wondering? - Well, - they decided they could take existing data from foursquare Twitter, - Facebook and populate their app. - So it looked like other people were using the app. - If you're not familiar with how the APP works, - it's looking for friends and friends of friends in the area. - So if I log on now, - it's saying, - You know who else at this party who's a friend or who's a friend of a friend that maybe I - don't know who around the block it yet. - It's maybe a little little 100 0 brooking on your privacy a little bit, - but that's how it works. - And, - um, - yeah, - and so they use this data so that when you come on, - even if none of my friends are using it, - it's saying, - Hey, - you know, - someone just checked in around the corner on Facebook, - you know, - someone just used foursquare. - Here's their likes, - and you can see all of this data. - See, - Net is a company in a website that does reviews of electron ICS, - telephones. - TV is all that. - Over the years they've acquired different partner sites, - right? - And when you have a bunch of different sites coming together over the years right, - they could be written in. - That's a different languages or have different practices where their own best practices - their own developers working on these segments. - How do we unify that data? - How would we bring that all together so that we can share it internally, - Right amongst all the partner sites? - One of the developers from Cnet was speaking at mastery, - and he explained how this problem worked. - I'm not actually sure that these were the languages, - but using this as an example. - So they had all of these different acquisitions, - and they wanted to bring them together, - right, - And each of them has their own data flow in their own databases. - But we needed a way to unify this data. - So what he came up with was an internal A P I, - and the internal AP. - I said, - you know, - it doesn't really matter that we have all these different databases and always different - this stuff all around the Net. - We can make an A p I. - And maybe they used XML. - Maybe they used Jason, - but the idea being they used one uniform call and wait to interface with the data in a way - that we could make this whole system flow much more fluidly. - So in closing, - there are a lot of AP eyes out there. - Here's just a few Foursquare has geo data, - you know, - if you need a email newsletter. - AP I mail. - Chimp has ways you can integrate their product, - discuss payments. - Google has tons of a P eyes. - You probably don't even know they have the prediction. - A p I is amazing and we're check that one out. - Ah, - and AP eyes even for real life things around us. - So thanks a lot. - Here's the block will post up additional questions from my class and resource is and you - can reach me on Twitter at Stig. - Thanks for watching