Downloads a FILE type document/get the inline content or source url of a certain document.\n
https://apis.wso2.com/api/am/publisher/v0.9/apis/{apiId}/documents/{documentId}/content
GET
apim:api_view
curl -k -H "Authorization:Bearer b0982cd2aacd463ff5f63cd5ebe58f4a" "http://127.0.0.1:9763/api/am/publisher/v0.9/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents/daf732d3-bda2-46da-b381-2c39d901ea61/content" > sample.pdf
HTTP/1.1 200 OK
Content-Disposition: attachment; filename="sample.pdf"
Content-Type: application/octet-stream
Content-Length: 7802
%PDF-1.4
%äüöß
2 0 obj
<</Length 3 0 R/Filter/FlateDecode>>
stream
..
>>
startxref
7279
%%EOF
Type | Name | Description | Schema | Default |
---|---|---|---|---|
Path |
apiId required |
**API ID** consisting of the **UUID** of the API.\nThe combination of the provider of the API, name of the API and the version is also accepted as a valid API ID.\nShould be formatted as **provider-name-version**.\n |
String | |
Path |
documentId required |
**Document Identifier**\n |
String | |
Header |
Accept optional |
Media types acceptable for the response. Default is JSON.\n |
String |
JSON |
Header |
If-None-Match optional |
Validator for conditional requests; based on the ETag of the formerly retrieved\nvariant of the resourec.\n |
String | |
Header |
If-Modified-Since optional |
Validator for conditional requests; based on Last Modified header of the\nformerly retrieved variant of the resource.\n |
String |
HTTP Code | Description | Schema |
---|---|---|
200 |
OK.\nFile or inline content returned.\n |
|
303 |
See Other.\nSource can be retrived from the URL specified at the Location header.\n |
|
304 |
Not Modified.\nEmpty body because the client has already the latest version of the requested resource.\n |
|
404 |
Not Found.\nRequested Document does not exist.\n |
Error |
406 |
Not Acceptable.\nThe requested media type is not supported\n |
Error |
Upload a file to a document or add inline content to the document.\n\nDocument's source type should be **FILE** in order to upload a file to the document using **file** parameter.\nDocument's source type should be **INLINE** in order to add inline content to the document using **inlineContent** parameter.\n\nOnly one of **file** or **inlineContent** can be specified at one time.\n
https://apis.wso2.com/api/am/publisher/v0.9/apis/{apiId}/documents/{documentId}/content
POST
apim:api_create
curl -k -H "Authorization:Bearer b0982cd2aacd463ff5f63cd5ebe58f4a" -F file=@"sample.pdf" -X POST "http://127.0.0.1:9763/api/am/publisher/v0.9/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents/daf732d3-bda2-46da-b381-2c39d901ea61/content"
HTTP/1.1 201 Created
Location: http://localhost:9763/api/am/publisher/v0.9/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents/daf732d3-bda2-46da-b381-2c39d901ea61/content
Content-Type: application/json
{
"visibility":"API_LEVEL",
"sourceType":"FILE",
"sourceUrl":null,
"otherTypeName":null,
"documentId":"daf732d3-bda2-46da-b381-2c39d901ea61",
"summary":"This is a sample documentation pdf",
"name":"Introduction to PhoneVerification API PDF",
"type":"HOWTO"
}
Type | Name | Description | Schema | Default |
---|---|---|---|---|
Path |
apiId required |
**API ID** consisting of the **UUID** of the API.\nThe combination of the provider of the API, name of the API and the version is also accepted as a valid API ID.\nShould be formatted as **provider-name-version**.\n |
String | |
Path |
documentId required |
**Document Identifier**\n |
String | |
Header |
Content-Type required |
Media type of the entity in the body. Default is JSON.\n |
String |
JSON |
Form |
file optional |
Document to upload |
file | |
Form |
inlineContent optional |
Inline content of the document |
String | |
Header |
If-Match optional |
Validator for conditional requests; based on ETag.\n |
String | |
Header |
If-Unmodified-Since optional |
Validator for conditional requests; based on Last Modified header.\n |
String |
HTTP Code | Description | Schema |
---|---|---|
200 |
OK.\nDocument updated\n |
Document |
400 |
Bad Request.\nInvalid request or validation error.\n |
Error |
404 |
Not Found.\nThe resource to be updated does not exist.\n |
Error |
412 |
Precondition Failed.\nThe request has not been performed because one of the preconditions is not met.\n |
Error |
Delete a document of an API\n
https://apis.wso2.com/api/am/publisher/v0.9/apis/{apiId}/documents/{documentId}
DELETE
apim:api_create
curl -H "Authorization: Bearer b0982cd2aacd463ff5f63cd5ebe58f4a" -X DELETE http://127.0.0.1:9763/api/am/publisher/v0.9/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents/ffd5790d-b7a9-4cb6-b76a-f8b83ecdd058
HTTP/1.1 200 OK
Type | Name | Description | Schema | Default |
---|---|---|---|---|
Path |
apiId required |
**API ID** consisting of the **UUID** of the API.\nThe combination of the provider of the API, name of the API and the version is also accepted as a valid API ID.\nShould be formatted as **provider-name-version**.\n |
String | |
Path |
documentId required |
**Document Identifier**\n |
String | |
Header |
If-Match optional |
Validator for conditional requests; based on ETag.\n |
String | |
Header |
If-Unmodified-Since optional |
Validator for conditional requests; based on Last Modified header.\n |
String |
HTTP Code | Description | Schema |
---|---|---|
200 |
OK.\nResource successfully deleted.\n |
|
404 |
Not Found.\nResource to be deleted does not exist.\n |
Error |
412 |
Precondition Failed.\nThe request has not been performed because one of the preconditions is not met.\n |
Error |
Get a particular document associated with an API.\n
https://apis.wso2.com/api/am/publisher/v0.9/apis/{apiId}/documents/{documentId}
GET
apim:api_view
curl -H "Authorization: Bearer b0982cd2aacd463ff5f63cd5ebe58f4a" "http://127.0.0.1:9763/api/am/publisher/v0.9/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents/0bcb7f05-599d-4e1a-adce-5cb89bfe58d5"
HTTP/1.1 200 OK
Content-Type: application/json
{
"visibility": "API_LEVEL",
"sourceType": "INLINE",
"sourceUrl": null,
"otherTypeName": null,
"documentId": "0bcb7f05-599d-4e1a-adce-5cb89bfe58d5",
"summary": "This is a sample documentation",
"name": "PhoneVerification API Documentation",
"type": "HOWTO"
}
Type | Name | Description | Schema | Default |
---|---|---|---|---|
Path |
apiId required |
**API ID** consisting of the **UUID** of the API.\nThe combination of the provider of the API, name of the API and the version is also accepted as a valid API ID.\nShould be formatted as **provider-name-version**.\n |
String | |
Path |
documentId required |
**Document Identifier**\n |
String | |
Header |
Accept optional |
Media types acceptable for the response. Default is JSON.\n |
String |
JSON |
Header |
If-None-Match optional |
Validator for conditional requests; based on the ETag of the formerly retrieved\nvariant of the resourec.\n |
String | |
Header |
If-Modified-Since optional |
Validator for conditional requests; based on Last Modified header of the\nformerly retrieved variant of the resource.\n |
String |
HTTP Code | Description | Schema |
---|---|---|
200 |
OK.\nDocument returned.\n |
Document |
304 |
Not Modified.\nEmpty body because the client has already the latest version of the requested resource.\n |
|
404 |
Not Found.\nRequested Document does not exist.\n |
Error |
406 |
Not Acceptable.\nThe requested media type is not supported\n |
Error |
Update document details.\n
https://apis.wso2.com/api/am/publisher/v0.9/apis/{apiId}/documents/{documentId}
PUT
apim:api_create
curl -k -H "Authorization:Bearer b0982cd2aacd463ff5f63cd5ebe58f4a" -H "Content-Type: application/json" -X PUT -d data.json "http://127.0.0.1:9763/api/am/publisher/v0.9/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/documents"
{
"visibility": "API_LEVEL",
"sourceType": "INLINE",
"sourceUrl": null,
"otherTypeName": null,
"documentId": "0bcb7f05-599d-4e1a-adce-5cb89bfe58d5",
"summary": "This is a sample documentation for v1.0.0",
"name": "PhoneVerification API Documentation",
"type": "HOWTO"
}
HTTP/1.1 200 OK
Content-Type: application/json
{
"visibility": "API_LEVEL",
"sourceType": "INLINE",
"sourceUrl": null,
"otherTypeName": null,
"documentId": "0bcb7f05-599d-4e1a-adce-5cb89bfe58d5",
"summary": "This is a sample documentation for v1.0.0",
"name": "PhoneVerification API Documentation",
"type": "HOWTO"
}
Type | Name | Description | Schema | Default |
---|---|---|---|---|
Path |
apiId required |
**API ID** consisting of the **UUID** of the API.\nThe combination of the provider of the API, name of the API and the version is also accepted as a valid API ID.\nShould be formatted as **provider-name-version**.\n |
String | |
Path |
documentId required |
**Document Identifier**\n |
String | |
Body |
body required |
Document object that needs to be added\n |
Document (Document) | |
Header |
Content-Type required |
Media type of the entity in the body. Default is JSON.\n |
String |
JSON |
Header |
If-Match optional |
Validator for conditional requests; based on ETag.\n |
String | |
Header |
If-Unmodified-Since optional |
Validator for conditional requests; based on Last Modified header.\n |
String |
HTTP Code | Description | Schema |
---|---|---|
200 |
OK.\nDocument updated\n |
Document |
400 |
Bad Request.\nInvalid request or validation error.\n |
Error |
404 |
Not Found.\nThe resource to be updated does not exist.\n |
Error |
412 |
Precondition Failed.\nThe request has not been performed because one of the preconditions is not met.\n |
Error |
Get a list of documents belonging to an API.\n
https://apis.wso2.com/api/am/publisher/v0.9/apis/{apiId}/documents
GET
apim:api_view
curl -H "Authorization: Bearer b0982cd2aacd463ff5f63cd5ebe58f4a" "http://127.0.0.1:9763/api/am/publisher/v0.9/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents"
HTTP/1.1 200 OK
Content-Type: application/json
{
"previous": "",
"list": [
{
"visibility": "API_LEVEL",
"sourceType": "INLINE",
"sourceUrl": null,
"otherTypeName": null,
"documentId": "0bcb7f05-599d-4e1a-adce-5cb89bfe58d5",
"summary": "This is a sample documentation for v1.0.0",
"name": "PhoneVerification API Documentation",
"type": "HOWTO"
},
{
"visibility": "API_LEVEL",
"sourceType": "URL",
"sourceUrl": "http://wiki.cdyne.com/index.php/Phone_Verification",
"otherTypeName": null,
"documentId": "4145df31-04f1-440c-8d08-68952874622c",
"summary": "This is the URL for online documentation",
"name": "Online Documentation",
"type": "SAMPLES"
}
],
"next": "",
"count": 2
}
Type | Name | Description | Schema | Default |
---|---|---|---|---|
Path |
apiId required |
**API ID** consisting of the **UUID** of the API.\nThe combination of the provider of the API, name of the API and the version is also accepted as a valid API ID.\nShould be formatted as **provider-name-version**.\n |
String | |
Query |
limit optional |
Maximum size of resource array to return.\n |
Integer |
25 |
Query |
offset optional |
Starting point within the complete list of items qualified.\n |
Integer |
0 |
Header |
Accept optional |
Media types acceptable for the response. Default is JSON.\n |
String |
JSON |
Header |
If-None-Match optional |
Validator for conditional requests; based on the ETag of the formerly retrieved\nvariant of the resourec.\n |
String |
HTTP Code | Description | Schema |
---|---|---|
200 |
OK.\nDocument list is returned.\n |
DocumentList |
304 |
Not Modified.\nEmpty body because the client has already the latest version of the requested resource.\n |
|
404 |
Not Found.\nRequested API does not exist.\n |
Error |
406 |
Not Acceptable.\nThe requested media type is not supported\n |
Error |
Add a new document to an API\n
https://apis.wso2.com/api/am/publisher/v0.9/apis/{apiId}/documents
POST
apim:api_create
curl -H "Authorization: Bearer cdcc8cf6016ed10620edf3a1d3c5ef2b" -H "Content-Type: application/json" -X POST -d @data.json "http://127.0.0.1:9763/api/am/publisher/v0.9/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/documents"
{
"visibility": "API_LEVEL",
"sourceType": "INLINE",
"sourceUrl": null,
"otherTypeName": null,
"summary": "This is a sample documentation",
"name": "Introduction to PhoneVerification API",
"type": "HOWTO"
}
HTTP/1.1 201 Created
Location: http://localhost:9763/api/am/publisher/v0.9/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents/ffd5790d-b7a9-4cb6-b76a-f8b83ecdd058
Content-Type: application/json
{
"visibility": "API_LEVEL",
"sourceType": "INLINE",
"sourceUrl": null,
"otherTypeName": null,
"documentId": "ffd5790d-b7a9-4cb6-b76a-f8b83ecdd058",
"summary": "This is a sample documentation",
"name": "Introduction to PhoneVerification API",
"type": "HOWTO"
}
Type | Name | Description | Schema | Default |
---|---|---|---|---|
Path |
apiId required |
**API ID** consisting of the **UUID** of the API.\nThe combination of the provider of the API, name of the API and the version is also accepted as a valid API ID.\nShould be formatted as **provider-name-version**.\n |
String | |
Body |
body required |
Document object that needs to be added\n |
Document (Document) | |
Header |
Content-Type required |
Media type of the entity in the body. Default is JSON.\n |
String |
JSON |
HTTP Code | Description | Schema |
---|---|---|
201 |
Created.\nSuccessful response with the newly created Document object as entity in the body.\nLocation header contains URL of newly added document.\n |
Document |
400 |
Bad Request.\nInvalid request or validation error\n |
Error |
415 |
Unsupported media type.\nThe entity of the request was in a not supported format.\n |