 Everybody how's it going? Good try that again. How's it going? Last time was good. All right My mind will be almost as good. Um, I'm Ian Douglas. I'm a senior developer advocate at postman Thanks for having me. How many people here wondering like why is postman here at GRPC cough? No hands raised. All right. Well, then I answered all your questions out the table is great I've actually been doing quite a bit in GRPC this year and really enjoying it How many people here currently using postman in some capacity? All right first three people up here to grab a swag pack I've got socks on a couple of the chairs here. Come grab socks and a notepad if you want There are extra drink tickets in some of those socks. So if you use postman come grab Come grab a Well, grab that grab the notepad too because that's got the drink ticket in it So yeah, just grab the socks. No, just the socks just the socks just this sock pack All right last one one left one left run run. There we go Cool like I mentioned Postman postman is grateful to be here. Thanks for having us as a sponsor We actually introduced to GRPC in postman how many people here didn't know that postman did GRPC before today Okay, a couple of folks. So this this talk is for you So we we introduced it in January of 2022 and we've made some updates and changes to the UI and so my demo today I'm gonna kind of demo how to go through and actually set up GRPC in postman Just do a simple test with a template and then show you how to do a little bit of JavaScript testing in here as well We've got some other swag and stuff to give away that will will kind of go through We are gonna raffle off this cool little bobble head At some point so you will need to come by the the table if I've already scanned your badge The scanning thing didn't work So we need to take a picture of your badge and we're gonna randomly draw one of those badges To get our bobble head. Otherwise, we got some some other swag here to give away as well All right, so quick agenda I'm gonna show you kind of the growth we publish a report every year called the state of the API report and I want to show a little bit about the growth that we've seen in GRPC over the last couple of years. We've been doing this API survey since 2018 and It's kind of interesting to see some of the some of the growth there around different technologies and so on Anybody fill out that API survey this year or about 40,000 people that filled it out anybody in the room fill that out Anybody want to lie to me and tell me that you filled it out All right, come grab come grab our water bottle and bottle and our All right Well, the reason that you're hanging out with me besides my my dad jokes that I love putting on my slides We're gonna show how to design a GRPC API. We're not actually gonna like Program the API, but we're gonna show some of the capabilities of postman And you'll be able to do this in both the web interface of postman as well as the desktop version And you'll be able to do this as part of the free account as well So you won't need any specific account access to get into building and planning out your GRPC API in postman I'll try to save a little bit of time at the end for some Q&A I'm gonna have some QR codes on the slides towards the end with extra resources and so on We're actually doing a webinar next Wednesday for free that you can register for I'll have that code up here on the on the screen at The end and we're basically gonna walk everybody through a little bit of the history of GRPC But also how to design even deeper work around the proto files and how to do some advanced testing in GRPC API as well next week so with the state of the API report like I said, we started doing this in 2018 and For 2018 2019 we kind of lumped everything together is just microservices and we were asking people who are filling out the survey like what are you excited about in technologies and You know five six years ago. It was like oh we're interested in things like microservices in 2020 we actually split it out into different kinds of technologies So now we can split out, you know, are you are you actively doing GRPC or you doing rest? Of course rest is you know by far the most popular API architecture that we see But we have seen a little tiny bit of growth in GRPC over the years It started out fairly small only a few percent seven percent or so in 2020 use GRPC and over the last two years We haven't seen very much growth as far as like how many people are actively using GRPC is staying around that 10 11% Which is still great We're still seeing a fair amount of growth since we started kind of putting the survey out there A lot of people are interested in what this technology is so by all means keep talking to your co-workers talk to your companies about what it is you want to go build and We'd love to see we'd love to see more people using GRPC for sure so we started breaking down those technologies in these surveys and we do this every year and Last year we had about 35 36,000 people I think do the survey this year We had about 40,000 people fill out the survey. We'd love that to be bigger So if you happen to see an email from postman if you use postman and we send you an email last year For example, we gave out a ps5 And and some gift cards and so on so it can be worth your while to fill out that survey get in some raffles and things like that But all right demo time I'm gonna Unmirror my screen here and I'm gonna show you in postman kind of while we go through this So bear with me for a sec while I switch my screen And what I'm gonna do is I'm gonna walk you through Some templating that we do in postman and I'll zoom in on this Let me know if that zoom level is okay. Happy to zoom in a little bit more if folks need But I'm gonna walk you through what what do we need to do to kind of build out a GRPC? api inside of postman So I'm just to kind of get started I am logged in I am in a workspace You will need to be in a workspace to follow along with this Once you have a workspace What we're gonna do is we can start at a collection level or we can start at an api level if you don't see Some of these icons here. We actually made a change earlier in our earlier this year in our UI You can click this very bottom icon and you can kind of customize what you want to have show up And so just make sure that api builder is is enabled and then you'll have access to that So I'm gonna start in an api layer In our api builder and kind of show you what we have Capability of so the first thing I'm gonna do is click on create an api And we're gonna give it a name. I'm I'm a big fan of like really awful dad jokes as we call them Does anybody know a good storage mechanism for dad jokes? Where do you keep dad jokes? Keep them in a database so we're gonna call us our database api and What we can do here is if you scroll down in this interface you can see some of the integrations we do you can actually bring in Photo files from other revision control repositories and so on I'm gonna use this link at the very bottom here That says I'm gonna continue without a repository From here, we've got the name of the api you can come in you can start adding some documentation in here if you'd like But what I'm gonna do is I'm gonna expand this over here on the left panel and Again, it's asking us do you want to import something or do you want to create a new definition file? We're gonna go ahead and create a new one and then we've got a drop-down here that asks us what type of api Sort of schema do we plan to use and you can see here that we've got protobuf 2 and 3 It's been in beta for the year and a half that we've been released I don't know if we're trying to pull a Google and just call something beta forever, but We're gonna choose protobuf 3 for our version and then the definition format because we're protobuf The definition format is only proto so we don't allow you to change it from there There's a checkbox here to use a boilerplate And this is just some template code that we're gonna use today just for the sake of time if you leave that empty It'll basically start you from nothing and you can literally type in your own whole proto file if you want You can copy and paste over proto files Or like I said you can import things from other repositories You'll have that ability to just bring your proto files in here And I'll show you some of the structure that we can do with this as well So I'm gonna go ahead and create that definition we can see it made us something that's kind of library themed We're gonna change this to be about our jokes, so I'm just gonna change our package name here And I'm gonna change some of our messages here. I'm gonna call this a joke message and We'll just call this ID and then we'll do a joke and then maybe like a topic in here, so And so we'll do like get Joke request and we'll do this by ID and we'll say get joke by topic and This will be by our topic and then these are basically the endpoints that we kind of give you in this template Automatically where you can say I want to go get a single thing by that ID They would call this joke service And get joke request And that's gonna return a joke Just for the simplicity I'm gonna take some of these things out But basically we build an endpoint here for each of the four types of calls that you can do in gRPC We have the unary type at the top, which is kind of our you know The gRPC version of a restful single transaction, you know send a request get a response and hang up But then we also support the streaming Types in both directions where the client sends over one thing and gets a stream back or the client sends a stream and gets One thing back or Bidirectional streaming so we support all of those in gRPC inside a postman natively So just for the for the sake of brevity for today. I'm just gonna Make this two of them. So get joke by topic and that's gonna return a joke as well And then I'm just gonna take these other ones out just for the sake of brevity and lack of confusion So this is how we would work with a single proto file If if your company has like several proto files and you're importing and so on we also allow for that mechanism as well So over here when we look at our definition if you highlight over the definition You'll see these three dots come up on the interface and from here you can add folder structures And you can also add other files and so I'm gonna add a new file in here And I'm just gonna call this messages that proto because what I want to do is I want to organize my work a little bit Where I want to take all these message types. I don't want to put those in a separate file by itself So I'm just gonna take all of those message payloads out of here I'm gonna put those inside messages proto now We still have to define the package name in the syntax per regular proto buff sort of spec And we're gonna go through make sure you save your work as well If you see this dot in the tab like this, it means you have to save your work There's a save button if you're on on a Mac you can use command s PC and Linux you can use control s Automatically save those now we can do in our main file here. You see this one is flagged as root That's basically telling our gRPC system that this is sort of where you want to get things started is from here Now we can say I want to import My messages proto file and now these are just gonna automatically link And so if you have multiple files and folder structures For example, if you wanted to put these in a folder, then you can just do pathing in here just typical proto buff sort of setup here So we're gonna save this as is and one of the things that we do if you if you've used postman for restful APIs or graph QL APIs if you wanted to ever make a mock server You have to go in and manually build out a collection and manually start a mock server and you have to do these saved examples Just by having a proto file on here We just spun up a mock server for you. So mocking is automatic with gRPC in postman So we don't have to do that ourselves We do have to go build the collection But there is a mock server already built out based on everything you put in here as soon as you make any changes that Synchronizes to the postman cloud and will automatically update that mock server for you So let's go take a look at how to build that collection The workflow here is a little bit different if you're familiar with using postman and building out collections with of requests And so on this workflow is going to be a little bit different With restful API as you would start by making a new collection. There's a plus sign up here to make a collection There's a link down here at the bottom of this panel if I were zoomed out a little bit more to create a collection But to use gRPC we actually have to use this new button at the top of the UI So we have to click on this new button here and then from there We can choose all of the different technologies and also which part of the UI we want to be in so from here I'm just going to select gRPC and what this is going to do is it's going to start at a request level Which we can then save into a collection but to start out with we're going to just build out a request now We don't have a URL because we're still in design stage. We haven't actually built anything So we don't have a URL But in order to pick one of the methods that we make as soon as we click in this drop-down It'll say oh by the way, we notice you've got an API called our database API So you can automatically pick that and then through that Interpection there's your methods. It's ready to go and it'll show you with the icons here This is our unary transaction single upload single download and this is our stream where we're sending a single thing And we're getting multiple things back From the server and so it shows you with some iconography here what the different types are So we're going to do the get joke by ID If we if I zoom out a little bit You'll actually see all the different things across here like our scripting as well as our metadata Which is kind of the gRPC version of like query parameters Where if we really wanted to pass a message ID of some kind we could do it in here But we've already got that as part of our prototype or sorry our protobuf Set up here So what we can do instead is we can use this button here down at the bottom of the interface that you see right now It says use an example message what this is going to do again is it's going to interspect your proto file and say Oh, you had a message type for this already So let me go generate that for you it was an in 32 or an in 64 So it's just going to randomly put a number in here and so we'll say let's go get joke one two three four Now to invoke this this is actually going to go connect to a server But we haven't built anything yet So invoking this doesn't do anything we see a big exclamation point show up here where we have to enter the URL But again, like I said, we automatically do mocking for you and so we can just immediately pick this option that says use the mock URL and It inserts that for us and we're ready to go we hit invoke and if I pull up this part of the interface Let's click on this. Nope. Oh our metadata key contains a little okay, so I got to delete this meta key and We'll call that so now when we come back here and we show what happened We can see that our status code came back is zero. Okay, and it actually gave us a Fake response that comes back here. Now. I don't speak Latin But our our server I'm sure came up with a really funny Latin dad joke I only know one dad joke in Latin. How do you how do you tell someone in Latin to seize the day privately? Send the car pay DM Sorry, I know my my jokes my jokes are bad But our mock server is basically going to introspect the data types that you're using and it's going to do its best to try to Figure out, you know based on the data type now if you're doing really advanced protobufs where you're defining your own data types We might struggle a little bit on how to use those custom data types But our teams happy to talk to you about what it is you're building we're going to do our best to try to reflect on what it is you're building and And the mock server will try to keep up from here The nice thing about this now is we've got this all built out. We know we can call this we get a response back We get our status code. We see how long it took to call our mock server Is we can go ahead and save this and at this point? This is where it's going to say, okay Do you want to save this in a collection? So we're going to call this collection. We'll call it our database API and we'll go ahead and create that collection Save our work and now over here at this point now We can click on the three dots over here and we can continue to add other requests We can also change what this was so this was get joked by ID and We're all set to go now the other thing that we can do from here is we've got our mock URL in here Is our server is we can actually use our variable types and this just uses handlebar syntax if you're familiar with handlebars And now we can go build an environment for a mock server for example So I'm going to create an environment, and I'm going to call this mock and I'm going to call a variable URL. I'm going to put in the initial value So I thought I'd copied but apparently I had not and go grab that again Over here Okay, so copy that and I'm just going to put that in my environment variable over here and go back to my collection Go back to my request and now I can just put my Handlebar variable in here and make sure that at the very top right corner under environments. I choose my mock environment And if I go through and save all my work if you can discern the difference this one from a red color to kind of an orange color And if I hover over it it'll show me what that mock URL is going to be the power of this is now You can make an environment for your development mode your mock server mode if you have staging production And the only thing that you need to change For calling that RPC call is just changing this Which environment you're picking from that top right corner? So you can very quickly toggle between dev mode mock mode for writing your tests as well as your staging and your production mode So let's take a really quick look at how to do testings anybody here currently do JavaScript testing in postman of any kind Couple hands. I saw your hand first So we got a book up here called API first world It's a little graphic novel that we wrote as well as a a ball cap. We're welcome to come grab that your order And so What we changed also a little bit differently about the interface here for gRPC If you're familiar with rest API's and so on we normally have this tab that I've got my mouse cursor on right now We normally had a called tests and then we've got another one for pre-request scripts We've changed the nomenclature here now It's just called scripts and you see we have a different tab interface for before invoke and after response me personally I like this wording a lot better It makes it a little more clear as to how we're how we're writing Or when this code is actually going to execute So I'm just going to collapse this over here on the left side for a moment And what I want to showcase here is we've got all the snippets over here If you're not familiar with postman and our test interface, we have a bunch of test code That will actually write for you So for example, I want to test that my status code came back as a zero that my response time was less than 200 milliseconds In this case, maybe I'll make that two full seconds Or hitting a mock server, but maybe in dev mode or in production mode You want to make sure you've got certain speeds You can also test that certain metadata will exist or that For example, your message has a specific property So you can come in here and say I expect that message to come back to have a certain key with a certain value Now if you're hitting the mock server, you're not necessarily going to know that the joke that comes back Was you know, like my favorite joke that says They ran out of flatbread That didn't want me Posting on social media So they made me sign a Non-disclosure Agreement Right and so you can you can write a test like this, but this test is not going to pass Because if i'm hitting the mock server up here when I hit that invoke, we'll actually see that this test should fail for us We see down here test results one of three down the very bottom of the interface One of these one of these cancelled because it's in the wrong spot I'll just clear some of these out for a moment We see zero of one test so we can see we expected it to include this joke thing and that didn't work out You can always look at the response. Oops call cancelled. That's not what we wanted at all All right, let's just change this back to the mock for a moment Just make sure that's not the problem All right, so we can still see that the test failed because that didn't work out But if we look at the response, we'll actually do the json deserialization For you here just so you can see more human readably What that response is we also have our console here that will show in the case of an error We'll show a little bit more data in the console here as well So we've got all that script ready to go that you can That you can write for both the before invoke as well as the after response The before invoke would be something like if you have to set something up ahead of time like do some authorization In order to call this the main difference here is if you're doing streaming The after response test will not run until the streaming ends So for example, if we were to call this other endpoint where we're expecting a stream to come back from the server When we invoke this one This one actually ends right away, but if we were doing client streaming It actually holds that connection open until you manually close it There's a button to say close the connection afterwards and only once that connection is actually closed Does it run sort of the after response script? So that's the other main difference here It's it's unlike the typical HTTP REST API where as soon as that transaction's over it disconnects Because of the streaming nature we'll hold that connection open until you manually disconnect and at that point we'll run that code So we've got feature requests from from users that actually do grpc in postman asking things like hey Can we run these tests while these streamed packets are coming in? So the team is currently evaluating feedback from users. So if you Currently use postman and you currently want to do grpc in postman We'd love to hear feedback from you as far as what kinds of options you'd like to see What do you like about the interface? What don't you like about the interface? We'd love to get feedback from folks on that I'm going to hang out at the table out here for a little while again If you want to come by and scan your badge to win our little bottle head You're welcome to do that I think we got a couple of minutes left for a question But I've got one question for all of you Who here has been using postman the longest? So who here has been using postman for more than a year? more than two years more than three years five years seven years eight years nine years 10 years All right. Well, I've only got one swag pack left and I've got two hands raised. So that's tricky numbers True but postman's only been around for about a decade. So if I said who's been using postman for 12 years and they kept their hand up I know you're a liar but Yeah, then we give it to the other person. That's right. Um, so let's do this We'll just split the the swag pack So there's a mug and there's a ball cap and there's some socks and some stickers and so on So y'all can figure out how to coordinate to to share that. So thank you for playing along again We'll scan this I do have time for a couple of questions if you want to ask real quick I know that was like super fast-paced demo But if you've got questions about grpc and postman, I'll do my best to answer that for you and then we'll wrap up Oh, can you can you run grpc in the terminal? Yeah, so we currently have two command line tools One is Newman. One is the postman cli I believe that all you need is the collection id from here So if we click on this and we go over the information panel, you have a collection id I believe that you can run this with the collection id I do need to confirm that you can run the grpc with this But you should be able to all you should need is that collection id and we'll do our best to try to connect to that Again, if you need a different environment, there are command line options that you can say use this environment use that environment If you are using the variables for things like the servers But yeah, I'd love to confirm that for you and let you know Yeah question here. Yeah, thank you for the socks. Yeah The question about streaming I've been using postman, but I found the issue that I don't get the message it empty across the stream So for long pool streaming is there any other work around to get the message? Um, so when you're doing long term streaming, you don't get the terminator at the end No, I don't get any message until I close the stream You don't get any messages until you close the stream. Um, I haven't seen that myself I'd love to see like I'd love to see some steps to replicate that I'd be happy to help you through that. Um, if you if you can show me out of the table I'd I'd be happy to help you take a look at that. I haven't seen that myself um But I'm I'm also not, you know super expert on uh on this but um But yeah, I'd love to I'd love to take a look at that and see if I can replicate that for you And then I can take that back to the team. Yeah, thanks All right, well, let's quickly go back to the slides because we do have actually well He's running with the microphone. Let me go back to the slides here real quick And then I've got some extra resources that I wanted to share Yeah question on the slide here Um, so these are two qr codes if you want to grab pictures of this The qr code on the left side is for a webinar that we're doing next Wednesday Again, we're going to go through a little bit of history on graph ql For sorry on g rpc Uh, and how to set that up in postman and do some testing the second one here is uh postman academy It's the training program that we put together and again, it'll walk you through some history of g rpc, but it'll take you through Uh, some some questions there on how to get started with g rpc. So if you just want to grab a photo of that Um, I'll leave that up here for just a minute And aside from that. Yeah, if there's any other questions. Yeah Do you want to show you like the streaming demo that get jokes by topic if you have time like uh We don't because the next person's going to be appearing about two minutes But I'd be happy to demo for you out here at the table after I just wanted to add an official g rpc business. We are huge fans of bad jokes awesome Love it. Well, I'm hoping for the for the webinar that we have next week that I'll actually have my dad joke api Actually written for g rpc and we'll be testing against that. So Um, thanks. This is my contact info if you want to stay in touch with me. I'm ian douglas 736 on most social platforms I'm always a big fan of dad jokes. So if you have a favorite joke by all means connect with me on social And uh, and share your your dad jokes with me and uh, I'll wrap up. Thanks everyone