API pour développeurs

Présentation de l'API

Requirements

  • A valid URLR. account (with verified email)
  • A paid subscription that gives access to API
  • Any language you can make an HTTP request with

Step 1 / Login

URL

https://urlr.me/api/login_check

Method

POST

Headers

Content-Type: application/json

Data

{
    "username": "johndoe",
    "password": "test"
}

If your credentials are valid, you'll get a token valid for one hour. Keep it for next steps.

Step 2 / Reduce a link

URL

https://urlr.me/api/reduce-link

Method

POST

Headers

Content-Type: application/json
Authorization: Bearer {TOKEN}

Data

{
    "url": "{URL}",
    "team": "{TEAM_ID}",
    "folder": "{FOLDER_ID}"
}
  • {TOKEN}: Replace it with the token given at step 1.
  • {URL}: Replace it with your URL to reduce.
  • {TEAM_ID}: Optional. Replace it with your team ID (you can find it in your dashboard).
  • {FOLDER_ID}: Optional. Replace it with your team ID (you can find it in your dashboard).

Step 3 / Read the result

Success

200 code

{"code": 200, "url_code": "YQ8hv"}

You can now use your reduced url like this: https://urlr.me/{url_code}

Error

400 code

{"code": 400, "error": 0}

The error field can have several values:

  • -1: L'API est reservée aux comptes avec abonnements, à condition que l'adresse email soit vérifiée.
  • 0: L'URL n'est pas valide. Veuillez la vérifier.
  • 1: Cette URL est considérée comme spam. Veuillez nous contacter si vous pensez qu'il s'agit d'une erreur.
  • 2: Vous avez atteint la limite horaire de liens réduits avec votre abonnement.
  • 3: Le créateur de l'équipe n'a pas renouvelé son abonnement.

401 code

{"code": 401, "message": "JWT Token not found"}

Verify your credentials and/or that you have provided a valid token.

Step 2 / Get stats of a link

URL

https://urlr.me/api/stats/{code}

Method

GET

Headers

Authorization: Bearer {TOKEN}
  • {CODE}: Replace it with your URL code composed of 5 random characters.
  • {TOKEN}: Replace it with the token given at step 1.

Step 3 / Read the result

Success

200 code

{"code": 200, "views": "150"}

Error

400 code

{"code": 400, "error": 0}

The error field can have several values:

  • -1: L'API est reservée aux comptes avec abonnements, à condition que l'adresse email soit vérifiée.
  • 0: this link doesn't exists
  • 1: this link doesn't belong to you

401 code

{"code": 401, "message": "JWT Token not found"}

Verify your credentials and/or that you have provided a valid token.

Step 2 / Get limits of account

URL

https://urlr.me/api/limits

Method

GET

Headers

Authorization: Bearer {TOKEN}
  • {TOKEN}: Replace it with the token given at step 1.

Step 3 / Read the result

Success

200 code

{
    "code": 200,
    "createdTeamHourMeter": 0,
    "createdTeamHourLimit": 500,
    "joinedTeamHourMeter": 11,
    "joinedTeamHourLimit": 2500,
    "personalHourMeter": 1,
    "personalHourLimit": 100
}

Error

400 code

{"code": 400, "error": 0}

The error field can have only one value:

  • -1: L'API est reservée aux comptes avec abonnements, à condition que l'adresse email soit vérifiée.

401 code

{"code": 401, "message": "JWT Token not found"}

Verify your credentials and/or that you have provided a valid token.

Nous utilisons des cookies d'analyse tiers facultatifs pour obtenir des statistiques de visite.
En savoir plus

Rejeter Accepter