go.epfl.ch - API

Infos

go.epfl.ch provides some API endpoints.


Prerequisites

  1. Be a member of the EPFL community (e.g. have a Gaspar login);
  2. Have an API token (you can generate one in your profile).


Enpoints


# aliases

aliases: Get all aliases (paginated)
GET https://go.epfl.ch/api/v1/aliases
Try it out

The URL accept some parameters, such as

  • sort=asc|desc (default is asc)
  • orderby=id|alias|url|clicks|created_at|updated_atc (default is id)
  • page=number (default is 1)
  • per_page=number (default is 10)
Example: GET https://go.epfl.ch/api/v1/aliases?orderby=created_at&sort=desc
Try it out

The results are paginated, please check the links and meta elements in the answer.


# alias

alias/{alias}: Get a specific alias
GET https://go.epfl.ch/api/v1/alias/{alias}
Try it out

alias: Create an alias
POST https://go.epfl.ch/api/v1/alias
Params:

  • token: 0123456789abcdef
  • alias: zombo
  • url: https://zombo.com


# clicks

clicks/{alias}: Get all clicks information on a alias (paginated)
GET https://go.epfl.ch/api/v1/clicks/{alias}
Try it out

clicks/csv/{alias}: Get all clicks information on a alias in a CSV file
    Note: there is a 2 hours cache on the query.
GET https://go.epfl.ch/api/v1/clicks/csv/{alias}
Try it out


CURL example

curl -X POST \
    --header 'Content-Type: application/json' \
    --header 'Accept: application/json' \
    -d '{"token":"0123456789abcdef", "alias":"zombo", "url":"https://zombo.com"}' \
    'https://go.epfl.ch/api/v1/alias'