问题描述
我有这个API文档,我应该把它变成一个更像用户友好的插件,就像一个小部件。
你是怎么做到的?
这是一个代码示例;
POST / message?key = [KEY]& performerId = [id]& customerId = [id]& nickname = [nickname] HTTP / 1.1
Host :[API]:80
[留言]
参数
名称必填类型说明
key是字符串由VS提供。请告诉我们您的密钥。
performerId是整数聊天应该出现在其房间中的表演者的身份。
customerId否整数客户的唯一ID。如果没有提供id,则认为这是未注册的客户。
昵称是字符串此用户在聊天中显示的名称。
post-data是字符串这是客户希望对房间说的消息(最多200个字符)。
示例响应
HTTP / 1.1 200 OK
Content-Type:text / xml; charset = utf-8
内容长度:[int]
{
成功:true | false
消息:[string]
}
响应参数
名称描述
成功无论您的帖子是否成功。
message如果成功为假,则显示错误消息。
我尝试了什么:
我的API文档是不同的请求和响应然而,它们在细节上似乎相当渺茫,导致开发人员在集成时花费大量时间。是不是有办法获取这些文档并创建一个更加用户友好的插件或模板,开发人员可以更容易使用?
I have this API documentation and am supposed to make into a more user-friendly plugin like a widget.
How do you do that?
Here’s a sample of the code;
POST /message?key=[KEY]&performerId=[id]&customerId=[id]&nickname=[nickname] HTTP/1.1
Host: [API]:80
[message]
Parameters
NameRequiredTypeDescription
keyYesstringSupplied by VS. Please ask us for your key.
performerIdYesintegerThe id of the performer in whose room the chat should appear.
customerIdNointegerThe unique id of the customer. If no id is provided, it is assumed that this is an unregistered customer.
nicknameYesstringThe name that this user will appear as in the chat.
post-dataYesstringThis is the message that the customer wishes to say to the room (max 200 chars).
Example Response
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: [int]
{
success: true | false
message: [string]
}
Response Parameters
NameDescription
successWhether or not your post was successful.
messageAn error message if success is false.
What I have tried:
I ahve the API documentation for different Requests and Responses however they seem rather slim in the details causing developers to spend a lot of time when integrating. Isn't there a way to take these docs and create a more user friendly plugin or template that a developer could more easily use?
推荐答案
这篇关于如何将API文档转换为窗口小部件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!