GithubHelp home page GithubHelp logo

agiro-server's Introduction

agiro server

Proposed backend for the Android OCR scanner project, agiro.

API

Dev server

Start the dev server.

./dev_appserver.py /path/to/agiro-server/app/

Get token for the user [email protected] to use in later requests to the server.

curl http://localhost:8080/_ah/login \
    -d "[email protected]&action=Log+In" \
    -c -

Make request to the server with the auth token.

Replace with the contents of dev_appserver_login example [email protected]:False:185804764220139124118. That request will then be signed with [email protected] account token.

curl http://localhost:8080/invoices \
    -d "reference=123456" \
    -d "document_type=bla" \
    -b "dev_appserver_login="<PLACE COOKIE HERE>"; Path=/;"

Production

Obtain auth token for the user.

curl https://www.google.com/accounts/ClientLogin \
    -d Email=<YOUR EMAIL> -d Passwd=<YOUR PASSWORD> \
    -d accountType=HOSTED_OR_GOOGLE \
    -d source=agiroapp \
    -d service=ah

This will return something like.

SID=DQAAA...
LSID=DQAAA...
Auth=DQAAA..

Take the content of Auth and use in the next request.

curl -c - \
http://agiroapp.appspot.com/_ah/login?auth=DQAAA..&continue=http%3A%2F%2Fagiroapp.appspot.com

This will return the ACSID cookie that we will use when making request to the api.

#HttpOnly_agiroapp.appspot.com	FALSE	/	FALSE	1294864134	ACSID	AJKiY...

Now we can add new invoices for the authenticated user.

curl http://agiroapp.appspot.com/invoices \
    -d "reference=123456" \
    -d "document_type=bla" \
    -H "Cookie: ACSID=AJKiY..."

And list the recent added invoices.

curl http://agiroapp.appspot.com/invoices \
    -H "Cookie: ACSID=AJKiY..."

agiro-server's People

Contributors

johannilsson avatar

Stargazers

 avatar

Watchers

 avatar  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.