Method
Summary
A method available on an API resource.
Description
The method is an API resource and a HTTP verb. The method, nickname, summary, and type are required.
Fields
Field Name | Type | Since Version | Description |
---|---|---|---|
id |
String | The method identifier | |
apiId |
String | The API identifier to which this method belongs | |
path |
String | The API path | |
verb |
String | The HTTP verb | |
name |
String | The name of the operation | |
summary |
String | A short summary description of the operation | |
description |
String | A detailed description of the operation | |
returnType |
String | The return type of the method, e.g. void, array, or a type found in models | |
parameters |
[Parameter] | A list of accepted parameters | |
responseCodes |
[ResponseCode] | A list of possible response messages and their meanings | |
consumes |
[String] | The content types that the operation consumes | |
produces |
[String] | The content types that the operation produces | |
properties |
{String, String} | A list of properties associated with this API Method. The list of properties may vary, depending on the type of the parent API. |
Example JSON
{ "id" : "014d138b-816c-42b8-8a2a-5b63e72ea46d", "apiId" : "6d81f576-bf40-4fbd-8625-63d8f206f649", "path" : "/users", "verb" : "GET", "name" : "getUserById", "summary" : "Gets a user by ID", "description" : "If the user does not exist, then a *404 Not Found* error is returned", "returnType" : "User", "parameters" : [ { "name" : "userId", "type" : "string", "format" : "string", "description" : "", "required" : true, "allowMultiple" : false, "items" : null, "defaultValue" : "text", "schema" : { "id" : "", "format" : "", "$ref" : "#/definitions/User", "type" : "string" }, "paramType" : "body" } ], "responseCodes" : [ { "code" : 404, "message" : "Not Found", "schema" : { "id" : "", "format" : "", "$ref" : "#/definitions/User", "type" : "string" } } ], "consumes" : [ "application/json" ], "produces" : [ "application/json" ], "properties" : { "soapOperation" : "calculator", "soapNamespace" : "" } }