Giter VIP home page Giter VIP logo

CCBSAPI

CCBSAPIとは、"Convenient Chat Bot Service API"の略で、 幅広い環境で様々な便利なツールを使うことを可能にする、チャットボット型のAPIサービスです。 インターネット上の様々な便利な外部サービスやCCBSAPI独自のサービスなどを繋ぎ、 様々なプラットフォームからの便利な機能の利用を容易にします。 ccbsapi.html.xdomain.jp

Web API

http://ccbsapi.php.xdomain.jp/v2/

仕様

httpsリクエストヘッダ:

Method GET/POST
Content-Type application/json
application/x-www-form-urlencoded

httpリクエストボディ:

key value
i CCBSAPI Inputs Object
o CCBSAPI Options Object
{
  "method":"POST", //or "GET"
  "Content-Type":"application/json",//or application/x-www-form-urlencoded
  "body":{
    "i":[
      {"type":"text","text":"検索ほげほげ"},
    ],
    "o":{
      "inf":"機能が見つかりませんでした"
    }
  }
}

httpレスポンス(JSON):

{
    "data": [
        {
            "type": "text",
            "content": "https://www.google.co.jp/search?q=%E3%81%BB%E3%81%92%E3%81%BB%E3%81%92"
        }
    ],
    "html": "<div class=\"ccbs_text\"><a href=\"https://www.google.co.jp/search?q=%E3%81%BB%E3%81%92%E3%81%BB%E3%81%92\">https://www.google.co.jp/search?q=%E3%81%BB%E3%81%92%E3%81%BB%E3%81%92</a></div>",
    "error":  false
}

Response Object(レスポンス.data):

data.type key value
object content Array[Response Objects]
text content text
image url image URL
audio url audio URL

使い方

var textData="YouTube検索ほげほげ";
 var endpoint="http://ccbsapi.php.xdomain.jp/v2/";
 var postObj=[{'type':'text','text':textData}];
 var xhr=  new XMLHttpRequest();
 xhr.open("POST",endpoint);
 xhr.setRequestHeader('Content-Type','application/json');
 xhr.send(JSON.stringify({'i':postObj}));
 xhr.onreadystatechange= function(){
   if(xhr.readyState==4){
    console.log(JSON.parse(xhr.responseText).html);
  }
}

ccbsapi's Projects

cgi-node icon cgi-node

CGI Node.js complete module to replace PHP on shared hosting such as GoDaddy

fold icon fold

FOLD file format for origami models, crease patterns, etc.

lawhub icon lawhub

Repository to track Japanese Law in text format

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.