Giter VIP home page Giter VIP logo

api_shortener's Introduction

API encurtadora de URL

Descrição do Projeto

API desenvolvida para teste de uma vaga, desenvolvida conforme as regras da empresa. O objetivo principal dela é ser uma encurtadora de URL.

Linguagens e libs utilizadas

PHP e Mysql utilizando padrão MVC.

Lista dos Endpoints que compõe a API.


  1. URL Redirect - Redireciona a URL encurtada para a URL original

Url Postman: http://localhost/api_shortener/view/Url/UrlRedirect.php Exemplo de body:{"id":"47"} Positivo: 301 redirect Negativo: 404 Not Found


  1. User Insert - Cadastra um novo usuário no sistema

url: http://localhost/api_shortener/view/User/UserInsert.php Exemplo de chamada:{"id":"teste1"} Positivo: 201 Created Negativo: 409 Conflict


  1. Url Insert - Cadastra uma nova Url no sistema

url: http://localhost/api_shortener/view/Url/UrlInsert.php Exemplo de chamada: { "userid": "teste5", "url": "http://www.example.com" } Positivo: "201""Created" Negativo: 100 Usuário Inexistente


  1. User Stats - Retorna todas urls de um determinado usuário

url: http://localhost/api_shortener/view/User/UserStats.php Exemplo de chamada:{"id":"teste1"} Positivo: {"id":"47","userid":"teste5","hits":"5","url":"http://www.example.com","shorturl":"http://localhost/SSOqStuPnF"} Negativo: "404""Not Found"


  1. Url Delete - Apaga uma url

url: http://localhost/api_shortener/view/User/UserStats.php Exemplo de chamada:{"id":"teste1"} Positivo: 204 No Content Negativo: 409 Null


  1. User Delete - Apaga um usuário e também todas urls relacionadas a este usuário

url: http://localhost/api_shortener/view/User/UserDelete.php Exemplo de chamada:{"id":"teste1"} Positivo: 204 No Content Negativo: 409 Null


  1. Url Stats - Retorna dados de uma determinada url

url: http://localhost/api_shortener/view/Url/UrlStatsId.php Exemplo de chamada:{"id":"47"} Positivo: {"id":"48","userid":"teste5","hits":"0","url":"http://www.a.com","shorturl":"http://localhost/lIm4MyICDU"} Negativo: "404""Not Found"


  1. Url Global Stats - Retorna dados de todas urls cadastradas

url: http://localhost/api_shortener/view/Url/UrlStats.php Exemplo de chamada: Vazio Positivo: {"hits":"1","urlCount":"4"}{"id":"50","userid":"teste5","hits":"1","url":"http://www.example.com","shorturl":"http://localhost/sJFwhPnBwB"}{"id":"48","userid":"teste5","hits":"0","url":"http://www.a.com","shorturl":"http://localhost/lIm4MyICDU"}{"id":"49","userid":"teste5","hits":"0","url":"http://www.example.com","shorturl":"http://localhost/e2nJkirQF5"}{"id":"51","userid":"teste5","hits":"0","url":"http://www.example.com","shorturl":"http://localhost/BlHFL23mx0"} Negativo: {"hits":null,"urlCount":"0"}"000""Not Found"

api_shortener's People

Contributors

henrymaltz avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.