#2 Get Coin Details - Integration
hi everyone so in this video we are going to create our first flow design our action which is actually going to send the first request in order to get the coin detail okay that's what we are going to do you are here right at this level of the work flow okay let me just show you one more time the data integration and data flow okay not to create the rest request it's quite easy and fast all you need to do is to provide all this information okay the main part here is the script we are going to use in our parse or response body okay so we are going to mainly focus on that one first once we have understand logic behind they are going to create everything okay all together so let me show you first the end point that we are using you know to send the rest of course okay so this is the end point which is actually going to give us the coin detail or Bitcoin for example so the number one is the coin ID for Bitcoin okay so if I click on this link is going to basically give me an adjacent string that we get for that request okay this is the string that we get so let me put that in a an online application here so the entire script we've seen here we have it here okay and you can see it's much more clear so if you want to access for example the value one just the ID you can do data the coin thought Eileen you can get that that's basically the syntax that you will be using in the script in order to get that specific value so you can do data or coin dot UUID will get this one they dollar coin god slug we will get this one okay once we have once we pass our response okay so let's go back view a little bit the script that they are going to have okay so this is the response that we get the Jason string the first thing what we do we we have we have to check if we have a successful response or not okay so for that we will have two variables to be created in sorry one variable to be creating two variable the first one is the status code the other one is the response body okay the status code will have the the status code when you get the response okay when you send a request it is going to basically send a code and this variable will contain the code if it is equal to 200 we have a successful response okay so then we can execute everything that we have inside this curly brackets okay the first thing what we do here is we create a response body variable and we pass our response okay we access our response body like this in inputs dot response in this cold body and then we pass it so this variable contains this is a JavaScript object will contain the response which is the past response so we can now access the value that we have for example ID ID slug and so on so what we do now is we create an object create an object which is coin object and then we can do like this coin object dot ID equal to response body this variable dot theta dot duh I okay so you can get the idea and store it in this variable and then you can do the same for everything that you need so I'm gonna get the ideal of symbol name and the other one okay so once we have done with that you can create a output variable this one is there for the action step okay so in the action step I want to have a variable which will contain on this object okay this this is this one is created later you can use you can use that out outputs in your flow in your action okay so this is the entire script it's quite simple it's not complicated so let's create now our application our presenter action also the rest request and then put our script and see the result so let's start to create our application now so look for studio and then click on create application give it a name for your application so it's going to be clip to analysis and a description so I'm gonna put cryptocurrency analytics you can create and advance instigate mass okay select your application now we are going to create our action including signer so look for action here I can create so let's give it a name for our action it's going to be sorry get coin history and details that's what we want and click on something okay now so let's create our input variable so it's going to be we are going to have the coin ID as an input variable then we create our first rest request okay click on the plus button and then click on rest give it a title so I'm going to put for example gate coin and details select here define connect connection in line and then we are going to specify here the base URL which I have it here okay this is our base URL and there a saucepot okay and then drag and drop the coin tidied it up y'all here click on enable retry policy and select your tripod right save that one now click on plus and then we are going to write our script to parse our response body so let's give it a title here so it's going to be parsed response body get coin detail sorry so let's create our variables now which we are going to use in our script so the first one is going to be status quo and drag and drop the data appeal the second one is going to be response body and drag and drop as well the the other data view okay so remove that everything inside you have in the code and then we are going to insert now the code that we saw in the previous previously so let me just take this code copy that one and put it in here okay so let's now create our coin object output variable for the action step for the past action step so I'm going I'm going to give the name that I have here in my script coin object okay this is going to be the type is going to be an object here so I'm gonna select your object and I'm going to create all the child's okay so the first one is going to be ID and then I'm going to I'm going to have symbols log name ID so everything that we have in our script okay so now actually we can save the entire output variables they want this one as a as a template so if you click on kind of symbol there and you can select here save as templates okay creates lecture manually and then you can click on save as template give it a name coin details for example and then click on save and and we can use this template again so now we are creating our output variable for the entire action so it's the same coin object so we have it here now instead of pre creating everything I'm gonna just select the template that I have just created bitterness is coin details great so I have it here save everything and then drag and drop the data field that you have in the previous step okay the coin object data file let's say now let's test and see if we get a result or not okay this for Bitcoin that's a coin ID here number one so as you can see here we have some result so we have ID big symbol ID the name everything and then we can also see if you have a successful response you can see here we have 200 we can also test for other coins so I'm going to test for example the number 23 and you can see here we have the result thanks for watching
https://www.youtube.com/watch?v=JdzJBfJ_tic