{"id":1156,"date":"2019-02-21T12:13:19","date_gmt":"2019-02-21T06:43:19","guid":{"rendered":"http:\/\/blog.openwebsolutions.in\/?p=1156"},"modified":"2019-02-21T12:13:19","modified_gmt":"2019-02-21T06:43:19","slug":"restful-api-laravel-5-5-using-jwt-authentication-ubuntu","status":"publish","type":"post","link":"https:\/\/openwebsolutions.in\/blog\/restful-api-laravel-5-5-using-jwt-authentication-ubuntu\/","title":{"rendered":"Restful API In Laravel 5.5 Using Jwt Authentication in Ubuntu"},"content":{"rendered":"<p>Rest is a stateless client-server protocol, where each HTTP requests contains all the information to run it. So, there is no need to remember the previous state, which makes the API become stateless. Using API, we can easily create web services that connect with our codebase\/database and getting data either in XML or JSON format as a response.<\/p>\n<p>&nbsp;<\/p>\n<p>Now, we integrate Jwt Authentication in Laravel(5.5) for creating secure restful API.<\/p>\n<p>&gt; Open your terminal &gt; Creating a new project in Laravel by below command<\/p>\n<p>composer create-project &#8211;prefer-dist laravel\/laravel jwt_rest<\/p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-1198\" src=\"http:\/\/blog.openwebsolutions.in\/wp-content\/uploads\/2019\/02\/laravel1-1.png\" alt=\"\" width=\"1366\" height=\"768\" srcset=\"https:\/\/openwebsolutions.in\/blog\/wp-content\/uploads\/2019\/02\/laravel1-1.png 1366w, https:\/\/openwebsolutions.in\/blog\/wp-content\/uploads\/2019\/02\/laravel1-1-300x169.png 300w, https:\/\/openwebsolutions.in\/blog\/wp-content\/uploads\/2019\/02\/laravel1-1-768x432.png 768w, https:\/\/openwebsolutions.in\/blog\/wp-content\/uploads\/2019\/02\/laravel1-1-1024x576.png 1024w, https:\/\/openwebsolutions.in\/blog\/wp-content\/uploads\/2019\/02\/laravel1-1-1160x653.png 1160w, https:\/\/openwebsolutions.in\/blog\/wp-content\/uploads\/2019\/02\/laravel1-1-600x337.png 600w\" sizes=\"(max-width: 1366px) 100vw, 1366px\" \/><\/p>\n<p>Now we use the JWT package in our newly installed Laravel.<\/p>\n<p>Use the below code in your terminal, but the Laravel version should be 5.5 or above.<\/p>\n<pre class=\"western\">composer require tymon\/jwt-auth:dev-develop --prefer-source<\/pre>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-1199\" src=\"http:\/\/blog.openwebsolutions.in\/wp-content\/uploads\/2019\/02\/laravel2-1.png\" alt=\"\" width=\"1366\" height=\"768\" srcset=\"https:\/\/openwebsolutions.in\/blog\/wp-content\/uploads\/2019\/02\/laravel2-1.png 1366w, https:\/\/openwebsolutions.in\/blog\/wp-content\/uploads\/2019\/02\/laravel2-1-300x169.png 300w, https:\/\/openwebsolutions.in\/blog\/wp-content\/uploads\/2019\/02\/laravel2-1-768x432.png 768w, https:\/\/openwebsolutions.in\/blog\/wp-content\/uploads\/2019\/02\/laravel2-1-1024x576.png 1024w, https:\/\/openwebsolutions.in\/blog\/wp-content\/uploads\/2019\/02\/laravel2-1-1160x653.png 1160w, https:\/\/openwebsolutions.in\/blog\/wp-content\/uploads\/2019\/02\/laravel2-1-600x337.png 600w\" sizes=\"(max-width: 1366px) 100vw, 1366px\" \/><\/p>\n<p>As a result, a <strong>new file jwt.php is created inside the config folder.<\/strong><\/p>\n<p>&nbsp;<\/p>\n<blockquote><p>&#8216;secret&#8217; =&gt; env(&#8216;JWT_SECRET&#8217;),<\/p>\n<p>\/*<\/p>\n<p>|&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>| JWT Authentication Keys<\/p>\n<p>|&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>|<\/p>\n<p>| The algorithm you are using, will determine whether your tokens are<\/p>\n<p>| signed with a random string (defined in `JWT_SECRET`) or using the<\/p>\n<p>| following public &amp; private keys.<\/p>\n<p>|<\/p>\n<p>| Symmetric Algorithms:<\/p>\n<p>| HS256, HS384 &amp; HS512 will use `JWT_SECRET`.<\/p>\n<p>|<\/p>\n<p>| Asymmetric Algorithms:<\/p>\n<p>| RS256, RS384 &amp; RS512 \/ ES256, ES384 &amp; ES512 will use the keys below.<\/p>\n<p>|<\/p>\n<p>*\/<\/p>\n<p>&#8216;keys&#8217; =&gt; [<\/p>\n<p>\/*<\/p>\n<p>|&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>| Public Key<\/p>\n<p>|&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>|<\/p>\n<p>| A path or resource to your public key.<\/p>\n<p>|<\/p>\n<p>| E.g. &#8216;file:\/\/path\/to\/public\/key&#8217;<\/p>\n<p>|<\/p>\n<p>*\/<\/p>\n<p>&#8216;public&#8217; =&gt; env(&#8216;JWT_PUBLIC_KEY&#8217;),<\/p>\n<p>\/*<\/p>\n<p>|&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>| Private Key<\/p>\n<p>|&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>|<\/p>\n<p>| A path or resource to your private key.<\/p>\n<p>|<\/p>\n<p>| E.g. &#8216;file:\/\/path\/to\/private\/key&#8217;<\/p>\n<p>|<\/p>\n<p>*\/<\/p><\/blockquote>\n<p>&#8216;private&#8217; =&gt; env(&#8216;JWT_PRIVATE_KEY&#8217;),<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>Please check the above code in jwt.php, which need some key. These keys will be signed with an encryption key.<\/p>\n<p>To generate the secret key, please run the below code<\/p>\n<pre class=\"western\"><span style=\"color: #333333;\"><span style=\"font-family: Menlo, Monaco, Consolas, Courier New, monospace;\"><span style=\"font-size: small;\">php artisan jwt:secret<\/span><\/span><\/span>\r\n<\/pre>\n<p>Now registering auth.jwt middleware inside <b>app\/Http\/kernel.php<\/b><\/p>\n<p>protected $middleware = [<\/p>\n<p>..<\/p>\n<p>..<\/p>\n<p>&#8216;auth.jwt&#8217; =&gt; \\Tymon\\JWTAuth\\Http\\Middleware\\Authenticate::class,<\/p>\n<p>];<\/p>\n<p><b>Set Routes: <\/b>open the api.php from routes folder and set up all the routes for your project.<\/p>\n<p>Update app\/User.php as below<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<div style=\"background-color: black; color: white;\">\n<p>&lt;?phpnamespace App;<\/p>\n<p>use Illuminate\\Foundation\\Auth\\User as Authenticatable;<br \/>\nuse Illuminate\\Notifications\\Notifiable;<br \/>\nuse Tymon\\JWTAuth\\Contracts\\JWTSubject;<\/p>\n<p>class User extends Authenticatable implements JWTSubject<br \/>\n{<br \/>\nuse Notifiable;<\/p>\n<p>\/**<br \/>\n* The attributes that are mass assignable.<br \/>\n*<br \/>\n* @var array<br \/>\n*\/<br \/>\nprotected $fillable = [<br \/>\n&#8216;name&#8217;, &#8217;email&#8217;, &#8216;password&#8217;,<br \/>\n];<\/p>\n<p>\/**<br \/>\n* The attributes that should be hidden for arrays.<br \/>\n*<br \/>\n* @var array<br \/>\n*\/<br \/>\nprotected $hidden = [<br \/>\n&#8216;password&#8217;, &#8216;remember_token&#8217;,<br \/>\n];<\/p>\n<p>\/**<br \/>\n* Get the identifier that will be stored in the subject claim of the JWT.<br \/>\n*<br \/>\n* @return mixed<br \/>\n*\/<br \/>\npublic function getJWTIdentifier()<br \/>\n{<br \/>\nreturn $this-&gt;getKey();<br \/>\n}<\/p>\n<p>\/**<br \/>\n* Return a key value array, containing any custom claims to be added to the JWT.<br \/>\n*<br \/>\n* @return array<br \/>\n*\/<br \/>\npublic function getJWTCustomClaims()<br \/>\n{<br \/>\nreturn [];<br \/>\n}<br \/>\n}<\/p>\n<p>&nbsp;<\/p>\n<\/div>\n<p>User registration requires name, email, and password. So, create a form request for validating the data. Please use the following command:<\/p>\n<pre class=\"western\"><span style=\"color: #333333;\"><span style=\"font-family: Menlo, Monaco, Consolas, Courier New, monospace;\"><span style=\"font-size: small;\">php artisan make:request RegisterAuthRequest<\/span><\/span><\/span><\/pre>\n<p>Please <b>go to the app\/Http, a new folder Request is created, a new file RegisterAuthRequest.php is created, <\/b>open it and replace the rules method in below<\/p>\n<p>&nbsp;<\/p>\n<table width=\"638\" cellspacing=\"0\" cellpadding=\"4\">\n<colgroup>\n<col width=\"628\" \/> <\/colgroup>\n<tbody>\n<tr>\n<td valign=\"top\" width=\"628\">\n<p align=\"left\"><span style=\"color: #006699;\"><span style=\"font-family: Monaco, Consolas, Bitstream Vera Sans Mono, Courier New, Courier, monospace;\"><span style=\"font-size: medium;\"><b><code class=\"western\">public<\/code><\/b><\/span><\/span><\/span> <span style=\"color: #006699;\"><span style=\"font-family: Monaco, Consolas, Bitstream Vera Sans Mono, Courier New, Courier, monospace;\"><span style=\"font-size: medium;\"><b><code class=\"western\">function<\/code><\/b><\/span><\/span><\/span> <span style=\"color: #000000;\"><span style=\"font-family: Monaco, Consolas, Bitstream Vera Sans Mono, Courier New, Courier, monospace;\"><span style=\"font-size: medium;\"><code class=\"western\">rules()<\/code><\/span><\/span><\/span><\/p>\n<p align=\"left\"><span style=\"color: #212121;\"><code class=\"western\">\u00a0\u00a0\u00a0\u00a0<\/code><\/span><span style=\"color: #000000;\"><span style=\"font-family: Monaco, Consolas, Bitstream Vera Sans Mono, Courier New, Courier, monospace;\"><span style=\"font-size: medium;\"><code class=\"western\">{<\/code><\/span><\/span><\/span><\/p>\n<p align=\"left\"><span style=\"color: #212121;\"><code class=\"western\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><\/span><span style=\"color: #006699;\"><span style=\"font-family: Monaco, Consolas, Bitstream Vera Sans Mono, Courier New, Courier, monospace;\"><span style=\"font-size: medium;\"><b><code class=\"western\">return<\/code><\/b><\/span><\/span><\/span> <span style=\"color: #000000;\"><span style=\"font-family: Monaco, Consolas, Bitstream Vera Sans Mono, Courier New, Courier, monospace;\"><span style=\"font-size: medium;\"><code class=\"western\">[<\/code><\/span><\/span><\/span><\/p>\n<p align=\"left\"><span style=\"color: #212121;\"><code class=\"western\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><\/span><span style=\"color: #0000ff;\"><span style=\"font-family: Monaco, Consolas, Bitstream Vera Sans Mono, Courier New, Courier, monospace;\"><span style=\"font-size: medium;\"><code class=\"western\">'name'<\/code><\/span><\/span><\/span> <span style=\"color: #000000;\"><span style=\"font-family: Monaco, Consolas, Bitstream Vera Sans Mono, Courier New, Courier, monospace;\"><span style=\"font-size: medium;\"><code class=\"western\">=&gt;<br \/>\n<\/code><\/span><\/span><\/span><span style=\"color: #0000ff;\"><span style=\"font-family: Monaco, Consolas, Bitstream Vera Sans Mono, Courier New, Courier, monospace;\"><span style=\"font-size: medium;\"><code class=\"western\">'required|string'<\/code><\/span><\/span><\/span><span style=\"color: #000000;\"><span style=\"font-family: Monaco, Consolas, Bitstream Vera Sans Mono, Courier New, Courier, monospace;\"><span style=\"font-size: medium;\"><code class=\"western\">,<\/code><\/span><\/span><\/span><\/p>\n<p align=\"left\"><span style=\"color: #212121;\"><code class=\"western\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><\/span><span style=\"color: #0000ff;\"><span style=\"font-family: Monaco, Consolas, Bitstream Vera Sans Mono, Courier New, Courier, monospace;\"><span style=\"font-size: medium;\"><code class=\"western\">'email'<\/code><\/span><\/span><\/span> <span style=\"color: #000000;\"><span style=\"font-family: Monaco, Consolas, Bitstream Vera Sans Mono, Courier New, Courier, monospace;\"><span style=\"font-size: medium;\"><code class=\"western\">=&gt;<br \/>\n<\/code><\/span><\/span><\/span><span style=\"color: #0000ff;\"><span style=\"font-family: Monaco, Consolas, Bitstream Vera Sans Mono, Courier New, Courier, monospace;\"><span style=\"font-size: medium;\"><code class=\"western\">'required|email|unique:users'<\/code><\/span><\/span><\/span><span style=\"color: #000000;\"><span style=\"font-family: Monaco, Consolas, Bitstream Vera Sans Mono, Courier New, Courier, monospace;\"><span style=\"font-size: medium;\"><code class=\"western\">,<\/code><\/span><\/span><\/span><\/p>\n<p align=\"left\"><span style=\"color: #212121;\"><code class=\"western\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><\/span><span style=\"color: #0000ff;\"><span style=\"font-family: Monaco, Consolas, Bitstream Vera Sans Mono, Courier New, Courier, monospace;\"><span style=\"font-size: medium;\"><code class=\"western\">'password'<\/code><\/span><\/span><\/span> <span style=\"color: #000000;\"><span style=\"font-family: Monaco, Consolas, Bitstream Vera Sans Mono, Courier New, Courier, monospace;\"><span style=\"font-size: medium;\"><code class=\"western\">=&gt;<br \/>\n<\/code><\/span><\/span><\/span><span style=\"color: #0000ff;\"><span style=\"font-family: Monaco, Consolas, Bitstream Vera Sans Mono, Courier New, Courier, monospace;\"><span style=\"font-size: medium;\"><code class=\"western\">'required|string|min:6|max:10'<\/code><\/span><\/span><\/span><\/p>\n<p align=\"left\"><span style=\"color: #212121;\"><code class=\"western\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><\/span><span style=\"color: #000000;\"><span style=\"font-family: Monaco, Consolas, Bitstream Vera Sans Mono, Courier New, Courier, monospace;\"><span style=\"font-size: medium;\"><code class=\"western\">];<\/code><\/span><\/span><\/span><\/p>\n<p align=\"left\"><span style=\"color: #212121;\"><code class=\"western\">\u00a0\u00a0\u00a0\u00a0<\/code><\/span><span style=\"color: #000000;\"><span style=\"font-family: Monaco, Consolas, Bitstream Vera Sans Mono, Courier New, Courier, monospace;\"><span style=\"font-size: medium;\"><code class=\"western\">}<\/code><\/span><\/span><\/span><\/p>\n<p>Create a new <strong>ApiController<\/strong> by running the command:<\/p>\n<pre class=\"western\">php artisan make:controller ApiController\r\n<\/pre>\n<p>A new controller \u00a0<strong>ApiController.php will be created which consist of 4 functions.<\/strong><\/p>\n<p><strong>They are register(), login(), logout(), getAuthUser().<\/strong><\/p>\n<p><strong>register():<\/strong> \u00a0a successful response is returned with the user data that you have given on the registration form.<\/p>\n<p><strong>login():<\/strong> JWTAuth::attempt() is used for login action. A <strong>token<\/strong> is created for a successful login.<\/p>\n<p><strong>logout():<\/strong> If you click on logout, the <strong>token<\/strong> is expired successfully.<\/p>\n<p><strong>getAuthUser(): if the user is validated, you get a token and can be identified as a current user.<\/strong><\/p><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>Rest is a stateless client-server protocol, where each HTTP requests contains all the information to run it. So, there is no need to remember the previous state, which makes the API become stateless. Using API, we can easily create web services that connect with our codebase\/database and getting data either in XML or JSON format [&hellip;]<\/p>\n","protected":false},"author":20,"featured_media":1204,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[31,22,5],"tags":[33,71],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v14.8.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Restful API In Laravel 5.5 Using Jwt Authentication in Ubuntu<\/title>\n<meta name=\"robots\" content=\"index, follow\" \/>\n<meta name=\"googlebot\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta name=\"bingbot\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/openwebsolutions.in\/blog\/restful-api-laravel-5-5-using-jwt-authentication-ubuntu\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Restful API In Laravel 5.5 Using Jwt Authentication in Ubuntu\" \/>\n<meta property=\"og:description\" content=\"Rest is a stateless client-server protocol, where each HTTP requests contains all the information to run it. So, there is no need to remember the previous state, which makes the API become stateless. Using API, we can easily create web services that connect with our codebase\/database and getting data either in XML or JSON format [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/openwebsolutions.in\/blog\/restful-api-laravel-5-5-using-jwt-authentication-ubuntu\/\" \/>\n<meta property=\"og:site_name\" content=\"Openweb Solutions Blog\" \/>\n<meta property=\"article:published_time\" content=\"2019-02-21T06:43:19+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/openwebsolutions.in\/blog\/wp-content\/uploads\/2019\/02\/Laravel.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1279\" \/>\n\t<meta property=\"og:image:height\" content=\"720\" \/>\n<meta name=\"twitter:card\" content=\"summary\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/openwebsolutions.in\/blog\/#website\",\"url\":\"https:\/\/openwebsolutions.in\/blog\/\",\"name\":\"Openweb Solutions Blog\",\"description\":\"Transforming ideas into reality\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/openwebsolutions.in\/blog\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/openwebsolutions.in\/blog\/restful-api-laravel-5-5-using-jwt-authentication-ubuntu\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/openwebsolutions.in\/blog\/wp-content\/uploads\/2019\/02\/Laravel.jpg\",\"width\":1279,\"height\":720,\"caption\":\"Laravel\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/openwebsolutions.in\/blog\/restful-api-laravel-5-5-using-jwt-authentication-ubuntu\/#webpage\",\"url\":\"https:\/\/openwebsolutions.in\/blog\/restful-api-laravel-5-5-using-jwt-authentication-ubuntu\/\",\"name\":\"Restful API In Laravel 5.5 Using Jwt Authentication in Ubuntu\",\"isPartOf\":{\"@id\":\"https:\/\/openwebsolutions.in\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/openwebsolutions.in\/blog\/restful-api-laravel-5-5-using-jwt-authentication-ubuntu\/#primaryimage\"},\"datePublished\":\"2019-02-21T06:43:19+00:00\",\"dateModified\":\"2019-02-21T06:43:19+00:00\",\"author\":{\"@id\":\"https:\/\/openwebsolutions.in\/blog\/#\/schema\/person\/e27a52243ad3934ffa9590d2fd36ddd5\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/openwebsolutions.in\/blog\/restful-api-laravel-5-5-using-jwt-authentication-ubuntu\/\"]}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/openwebsolutions.in\/blog\/#\/schema\/person\/e27a52243ad3934ffa9590d2fd36ddd5\",\"name\":\"Santanu Aich\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/openwebsolutions.in\/blog\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/b54e7427b9f8197e785e6f9c4668c23b?s=96&r=g\",\"caption\":\"Santanu Aich\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","_links":{"self":[{"href":"https:\/\/openwebsolutions.in\/blog\/wp-json\/wp\/v2\/posts\/1156"}],"collection":[{"href":"https:\/\/openwebsolutions.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/openwebsolutions.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/openwebsolutions.in\/blog\/wp-json\/wp\/v2\/users\/20"}],"replies":[{"embeddable":true,"href":"https:\/\/openwebsolutions.in\/blog\/wp-json\/wp\/v2\/comments?post=1156"}],"version-history":[{"count":11,"href":"https:\/\/openwebsolutions.in\/blog\/wp-json\/wp\/v2\/posts\/1156\/revisions"}],"predecessor-version":[{"id":1176,"href":"https:\/\/openwebsolutions.in\/blog\/wp-json\/wp\/v2\/posts\/1156\/revisions\/1176"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/openwebsolutions.in\/blog\/wp-json\/wp\/v2\/media\/1204"}],"wp:attachment":[{"href":"https:\/\/openwebsolutions.in\/blog\/wp-json\/wp\/v2\/media?parent=1156"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/openwebsolutions.in\/blog\/wp-json\/wp\/v2\/categories?post=1156"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/openwebsolutions.in\/blog\/wp-json\/wp\/v2\/tags?post=1156"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}