 So today I'm going to talk about OpenEvent API server. OpenEvent API server provides the endpoints for managing an event management system. It is based on FlaskRest.JSON API. It has several endpoints like to create events, sessions related to those events, speakers to maintain admin settings like PayPal, Stripe Payment, etc. Let's just jump on it. First what we can see here is the documentation of the OpenEvent API server. We'll be providing the link in the description of this YouTube video. Okay, so let's start with the very first part that is authentication using endpoints. How do we authenticate so that we can make log in using the endpoints? We have used JWT authentication as you can see here. So what we do in JWT authentication is we send as a body the email and the password. As a result, we get an access token. So this takes token and access token has three parts separated by the dots where we start different kinds of information. Now how do we create any user that we can authenticate? So let's just see here. If I click on create a user, you will be given the documentation for creating a user. To create a user, we send this body as a post request to the endpoints in here. Now as a result, we get a user created and we get in the response according to the schema of the user, whatever we created. So these are all the relationships belonging to that user. And these are the attributes of the user that we just created. So we have the last name here, the first name here, and then the email and all other things. After that, so we created the user. What if I want to say I want to update the user? So what do we do? We just go to the link and click here to show and you get the necessary information. Once you've created a user and we have got the access token, the next really important part of the API is obviously creating the event. So let's come to the events. As you can see on clicking on events, we get the parameters and descriptions that you need to send as attributes while creating the event, of course. These are the attributes that you can send. There are required fields also. Here is the type mentioned for the particular attribute and the description. The name, the start set, the end set and time zone that these are the required fields. So you must send this while creating an event. What we would do to create an event is actually similar to the user we actually created. Here we send a post request to the events endpoint with the authorization with the JWC authentication key that we just got. And we send a body like this, the name, the start set, the end set and time zone. You can fill in other information as well. So according to an event, accordingly an event is created and we get a response just like we got in users. These are all our relationships in that event. This is the attribute and this is the link form from which we can access that particular event. So now if you want to see all the details of the event again, what will I be doing? So what we'll be doing is using the event details endpoint and this link so that we can get the details. We can either use the identifier of the event or ID of the event. We send the request with the JWC authorization and we get the corresponding response. Let's now look into a few different kinds of API. Most other APIs that we'll be using. So here we'll be sending a JSON API format request and get a JSON API response depending on the permissions we have. Admin API as well as event API. But there are a few different kinds of API, for example, uploading a file. So as we know that RESTful API do not handle uploading a file pretty well. So what we'll be doing is we will be sending a separate flash endpoint and we will be using that. And in the response we provided a similar JSON response to give the feel of our RESTful API. So what we do is we have a content type of multi-part format data and we set the form, the name of the file, input this file and there is the file name that you are sending. So we don't have to do exactly this. We can just click on the upload button in the form and this will automatically send actually a request like this to the API. So otherwise we can also do this. We'll be doing a demo on how to use it with the curl as well. So now after we have sent a post request, we will be getting a response like this, which is the URL for the file that we just uploaded. What happens is we don't actively create any kind of schema, anything in the background. What we do is we have some upload functions and helper functions that we use to store it either either locally or in Google Storage or S3. Now let's look at a similar kind of endpoint that is the even export. So even export also we don't use particularly API JSON format. What we follow of last API endpoint, this is the kind of endpoint because this usually this uses salary in the background. Since it takes a lot of time, it doesn't block the functionalities. Here what we do is we send a body request like this and return gets a task URL. After this task URL, we can send a get request to that task URL and we'll be getting a zip. So this is how things work. Let's look into the examples. What we have here is this is the server running. As you can see, the server is right now running in 127.001. I have the development configuration on so you see the developer is on right now. This is the PSQL server. So we are using PostgreSQL. So the PostgreSQL, suppose you want to see the schema of the events. So what we're going to do is we're going to do something like this. And this will show you the entire schema. These are all the columns. These are the types. This is where it is stored. If you go down, you can see the foreign key constraint that are maintained at the table as well. As well as the other levels that refer to this events table or other levels having foreign key constraints to even underscore ID. So that's that. Similarly, you can see the sessions and you'll be getting a similar kind of result. The more or less, that's more or less PostgreSQL. Now let's make some queries. So as we saw in the docs, the first thing that we need to do is create a user in order to obviously authenticate. What we do is we have a user, the email of the user as we know this should be unique in the entire table. So we'll be using a different one, different email this time. So we send a post request like this and this is the attributes. This is the email and this is the password. When I press enter, I get a result. This is the user that we just created and that particular email. We don't obviously show the password and these are all the relationships for that user. Now let's get the access token for that user using the GWT authentication. We need to send a request to slash auth slash session. So see this one. So when we do that, we can do something like this. And we will be getting the access token. So after we get the access token, this is the access token which we will be using for authentication. Now let's create an event. To do that, we'll make a post request to that particular endpoint we just saw. This is how we send the authorization with the access token key. We mentioned the type of the API endpoint that we want to use. In this case, it is the event, the name of the event, the start set, the end set, the time zone, etc. So after we have done that, we will have this as a response. These are all the relationships for the event and these are attributes of the event. Now as you can see, this is the link. So as I said before, if I want to go to a particular event, then how do I do it? We will send a get response to the particular endpoint. You can see in this endpoint ID is 71 here. So we get all the details related to that event of the 71 ID. Now suppose I want to list all the events, not just one event, but all the events that they actually have been created. You have to be an admin to do that, right? Or they should be public. Now, what I do is I send a get response, sorry, request to these events endpoint. Okay, then that will list all the events that are there in the servers you can see. And we can see there is a count of 7. These are all the relationships start and these are the attributes. After that, suppose you want to change something in the event, like update. What do we do is, for example, in this response, end date is 14. I want to make it 15, let's say. What do I do? I will use a patch request. So that means, see, we can see that we're sending a patch request and the end date. I have changed it to 15. Now, if I do that, we'll be getting an error. So this is how an error message will be looking. What is happening is I'm trying to change 71 in ID, but I have mentioned 69. So that's how you get an error in the endpoints. It is also a JSON API format. If I correct, if I'm correct and I do this, I will have the updated event. And as you can see, endpoints or ends is now changed to 15. So let's try doing the export event. So to do the export event, what we need to do is send a post request to the export endpoint. Suppose I want to export a send server requested salary running in the background. And I get the test URL back. What we do now is we send a get request to the test endpoint. So we are sending a get request to that task with the ID we just got. This is the ID. And as you can see, we now get the download URL link. So now similarly, if I want to say import an event, then what will we do? Let's go for an example to import events. So what I am doing is sending event. Sending event 1.zip to this particular endpoint. This will create an event for me. It will also return a test URL. And as you can see, an event with ID 71 has been created. To see that in the database, we can do something like this. We get events. So that's some of the examples. You can try out different other endpoints that are mentioned in the documentation. The event export and the event import uses salary and reduce in the background. I haven't actually shown it. What it does is it sends a request to the reduce server, which then puts it into a salary queue. I will actually leave the steps to start the server in the description, or I will link it to the GitHub repo. It is also presenting the documentation, so yeah. That's it. Thank you.