Code Monkey home page Code Monkey logo

micro-chat-api's Introduction

Instructions to test

# Create users

curl -X POST -d “user=Ivanov&user=123qwe” micro-chat-api.herokuapp.com/users.json

{“id”:1,“name”:“Ivanov”,“messages_count”:0,“auth_token”:“7b9ce33f-164f-4500-a46e-6c80907a7383”,“created_at”:“2016-05-27T09:11:31.773Z”}

curl -X POST -d “user=Petrov&user=123qwe” micro-chat-api.herokuapp.com/users.json

{“id”:2,“name”:“Petrov”,“messages_count”:0,“auth_token”:“e11c9d99-c7f9-4e92-8cd5-0bccaea792e5”,“created_at”:“2016-05-27T09:13:10.165Z”}

# Login

curl -X POST -d “user=Ivanov&user=123qwe” micro-chat-api.herokuapp.com/sessions.json

# Get users list

curl -X GET -H “Authorization: Token token=7b9ce33f-164f-4500-a46e-6c80907a7383” micro-chat-api.herokuapp.com/users.json

# View chats

curl -X GET -H “Authorization: Token token=7b9ce33f-164f-4500-a46e-6c80907a7383” micro-chat-api.herokuapp.com/chats.json

# Create chat

curl -X POST -d “chat=Zimbabwe&chat[]=1&chat[]=2” -H “Authorization: Token token=7b9ce33f-164f-4500-a46e-6c80907a7383” micro-chat-api.herokuapp.com/chats.json

# Post message to chat

curl -X POST -d “message=Zimbabwe” -H “Authorization: Token token=7b9ce33f-164f-4500-a46e-6c80907a7383” micro-chat-api.herokuapp.com/chats/1/messages.json

# Read chat messages

curl -X GET -H “Authorization: Token token=7b9ce33f-164f-4500-a46e-6c80907a7383” micro-chat-api.herokuapp.com/chats/1/messages.json

# Get unread messages

curl -X GET -H “Authorization: Token token=7b9ce33f-164f-4500-a46e-6c80907a7383” micro-chat-api.herokuapp.com/chats/1/unread_messages.json

# Mark unread messages read

curl -X DELETE -H “Authorization: Token token=7b9ce33f-164f-4500-a46e-6c80907a7383” micro-chat-api.herokuapp.com/chats/1/unread_messages.json

micro-chat-api's People

Contributors

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