GithubHelp home page GithubHelp logo

lcsouzamenezes / sinesp-api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hiltonkbr/sinesp-api

0.0 0.0 0.0 293 KB

Is a simple API develop in NODE JS, to integration in SINESP for free user :)

Home Page: https://contrateumdev.com.br

JavaScript 100.00%

sinesp-api's Introduction

Sinesp OpenSource API v1

Is a simple API develop in NODE JS, to integration in SINESP for free user :)

How to teste API

Endpoint demo Request POST

https://sinesp.contrateumdev.com.br/api

Body:

{
   "key":"chavedemostracao",
   "plate":"hbm6603"
}

Response ALERT:

{
   "code":200,
   "data":{
      "ano":"1978",
      "anoModelo":"1978",
      "chassi":"*****09660",
      "codigoRetorno":"0",
      "codigoSituacao":"1",
      "cor":"Branca",
      "data":"2020-10-29T13:00:39.948-03:00",
      "dataAtualizacaoAlarme":"",
      "dataAtualizacaoCaracteristicasVeiculo":"",
      "dataAtualizacaoRouboFurto":"",
      "marca":"VW/FUSCA 1300 L",
      "mensagemRetorno":"Sem erros.",
      "modelo":"VW/FUSCA 1300 L",
      "municipio":"PINDAMONHANGABA",
      "placa":"BHS1192",
      "situacao":"ROUBO / FURTO",
      "uf":"SP"
   }
}

Response SUCCESS:

{
   "code":200,
   "data":{
      "ano":"2003",
      "anoModelo":"2004",
      "chassi":"*****80726",
      "codigoRetorno":"0",
      "codigoSituacao":"0",
      "cor":"Prata",
      "data":"23/05/2019 às 17:25:02",
      "dataAtualizacaoAlarme":null,
      "dataAtualizacaoCaracteristicasVeiculo":null,
      "dataAtualizacaoRouboFurto":null,
      "marca":"FIAT/PALIO FIRE",
      "mensagemRetorno":"Sem erros.",
      "modelo":"FIAT/PALIO FIRE",
      "municipio":"RIBEIRAO DAS NEVES",
      "placa":"HBM6603",
      "situacao":"Sem restrição",
      "uf":"MG"
   }
}

Responses ERROR:

Plate error:

{
   "code":500,
   "error":"Sem informações, verifique se é uma placa válida",
   "plate":"",
   "infos":"null"
}

No key

{
   "code":403,
   "error":"Solicite a chave da API"
}

How to consume API in $.POST Jquery

function getData(platesearch){

    $.post({
        method: 'POST',
        url: 'https://sinesp.contrateumdev.com.br/api',
        data: {'key': 'chavedemostracao', 'plate': platesearch},
        success: function(resultado, status, xhr) {
            if (resultado.code === 200) {
                console.log(resultado)
            }else{
                console.log(resultado)
            }
        },
        error: function(data) {
            console.log(data.error)
        }
    })
}

sinesp-api's People

Contributors

jhowbhz avatar backofficesolucoes avatar jhowjhoe avatar dependabot[bot] 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.