Coder Social home page Coder Social logo

api-server's Introduction

Api-Server

消息盒子 - API

消息盒子提供的API是符合RESTful API设计原则的,此API用于消息盒子系统内部数据通讯。

此API搭建在内网localhost服务器上,端口为3399

测试链接

GET /api

{
  "message": "Welcome to MessageBox API"
}

消息发布

POST /api/:token/message/:userid/:typeid/:type/:author/:title/:content

字段 说明
token 访问权限验证
userid 用户id:如果是私有消息,此项必填作为接收者;如果是公共消息,可以为空。
typeid 消息类型id:1/2/3/4/5/6
type 消息种类 :public(公共)消息/private(私有)消息
author 发布者
title 消息标题
content 消息内容
  • 例子:http://localhost:3399/api/*****/message/000001/1/private/测试发布者/测试标题/测试内容

  • 返回结果:

{
  "message": "Message created.",
  "id": "36222aa0-377c-11e6-825c-e7dc08197a61"
}

id作用是获取当前发布消息的id,以便后续根据id进行查询

根据id查询消息

GET /api/:token/message/:id

{
  "id": "36222aa0-377c-11e6-825c-e7dc08197a61",
  "userid": "00000001",
  "typeid": 1,
  "type": "private",
  "title": "xxxxx",
  "author": "system",
  "desc": "xxxxxxx",
  "content": "xxxxxxx",
  "sendtime": "2016-06-21 09:40:37"
}

api-server's People

Contributors

muyegongzi avatar xiaoluoboding avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

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