Create external short url by method

I want to create a functionality where I post a URL to a certain url (endpoint) of my website, for instance mywebsite.com/wp-json/wl/v1/shorten?url=url-to-shorten.com, where I get a response with a shortened version of the URL that I sent to the URL above, for example mywebsite.com/akjv3, which redirects to url-to-shorten.com.

My question is if this is possible by using standard WordPress methods? I had some look at the documentation but could only find the following:

Short URL

Short Link

Which are not the functionalities I’m looking for as far as I read. Is there anyone who has any idea how to do this/can put me on the right path?

Read more here:: Create external short url by method

Leave a Reply

Your email address will not be published. Required fields are marked *