StedelijkLeiden.nl | API Docs
  • Home
  • Url's
  • API key
Powered by GitBook
On this page
  • Get code
  • Get list of all codes
  • Delete a code
  • Create code

Was this helpful?

Url's

All info about the stedelijkleiden.nl shortlink system!

Get code

GET https://stedelijkleiden.nl/api/u/get/:code

This endpoint allows you to get information about a code.

Path Parameters

Name
Type
Description

id

string

The code of the shortlink, for example stedelijkleiden.nl/docs (docs)

{
    "code": "docs",
    "longUrl": "https://docs.stedelijkleiden.nl/",
    "shortUrl": "https://stedelijkleiden.nl/docs",
    "private": false,
    "clicks": 7
}
{
    "message": "Code not found!"
}

Get list of all codes

GET https://stedelijkleiden.nl/api/list

Get a list of all existing public codes.

Path Parameters

Name
Type
Description

None

string

No parameters required

[
    {
        "code": "zermelo",
        "link": "https://gymnasiumleiden.zportal.nl/",
        "clicks": 10
    },
    {
        "code": "itslearning",
        "link": "https://sgl.itslearning.com/",
        "clicks": 8
    }
]

Delete a code

POST https://stedelijkleiden.nl/api/u/delete

Delete an existing code with your API key!

Request Body

Name
Type
Description

key

string

You api key secret!

id

string

Your api key id!

code

string

The code of the shortlink, for example stedelijkleiden.nl/docs (docs)

{
    "message": "Success!"
}
{
    "message": "Api key is invalid!"
}
{
    "message": "Url not found!"
}

Create code

POST https://stedelijkleiden.nl/api/u/create

Request Body

Name
Type
Description

id

string

Your API key id!

key

string

Your API key secret

private

string

IF the url is visible in the list!

customUrl

string

A custom name for the url!

longUrl

string

The long url to shorten!

{
    "code": "calendar",
    "longUrl": "https://calendar.google.com/",
    "shortUrl": "https://stedelijkleiden.nl/calendar",
    "private": false,
    "clicks": 0
}
{
    "message": "Custom url already exists"
}
{
    "message": "URL already exists"
}
{
    "message": "Invalid longUrl"
}
{
    "message": "Api key is invalid!"
}

PreviousHomeNextAPI key

Last updated 3 years ago

Was this helpful?