Get an API resource
/apiplatform/management/v1/apis/{apiId}/resources/{pathname}
Returns the resource at {pathname} for the {apiId}
API. API resources are files attached to an API containing overview or documentation text or other files. The {pathname} is the filename of the resource you want to view. The pathnames of attached resources appear in the artifacts array returned in response from the /apis/{apiId}
resource.
Users requesting this resource must be assigned the Plan Manager, Gateway Manager or API Manager role and must be issued the Manage API, View All Details or View Public Details grant for the specified API.
If users requesting this resource are assigned the View Public Details grant, details of the APIs that are published to Developer's Portal are returned.
Request
- application/json
-
apiId: string
A unique ID referencing a specific API.
-
pathname: string
The path to the API resource.
Response
- application/json
200 Response
403 Response
object
-
detail(optional):
string
Detailed error message
-
errorCode(optional):
string
Application specific error code
-
errorDetails(optional):
array errorDetails
additional errors
-
errorPath(optional):
string
-
instance(optional):
string
URI to the link that provides more detail about the error
-
status(optional):
string
HTTP status code
-
title:
string
Summary error message
-
type:
string
Error type
500 Response
object
-
detail(optional):
string
Detailed error message
-
errorCode(optional):
string
Application specific error code
-
errorDetails(optional):
array errorDetails
additional errors
-
errorPath(optional):
string
-
instance(optional):
string
URI to the link that provides more detail about the error
-
status(optional):
string
HTTP status code
-
title:
string
Summary error message
-
type:
string
Error type
Examples
The following example shows how to retrieve a resource for the latest iteration of an API by submitting a GET request on the REST resource using cURL. For more information about cURL, see Use cURL
curl -i -X GET
-H "Authorization: Bearer access_token"
https://example.com/apiplatform/management/v1/apis/{apiId}/resources/{pathname}
where,
-
{apiId}
is a unique Ids of a specific API. See Get APIs. -
{pathname}
is the filename of the resource you want to view. The path names of attached resources appear in the artifacts array returned in response from Get API details.For example:
"artifacts": [ { { "content-type": "text/html; charset=utf-8", "pathname": "api103_overview_htmloverview_bootcamp.html" }
Example of Response Headers
The following shows an example of the response headers.
HTTP/1.1 200 OK Server: Oracle-Traffic-Director/12.2.1.0.0 Date: Wed, 22 Mar 2017 09:43:13 GMT Content-Length: 1493 Content-Type: text/html;charset=utf-8 X-oracle-dms-ecid: 49d14691-2176-4c99-aed3-38438604f528-00001e9d X-oracle-dms-rid: 0 Via: 1.1 otd_opc Proxy-agent: Oracle-Traffic-Director/12.2.1.0.0
Example of Response Body
The following example shows the contents of the response body in JSON format, including the contents of the api103_overview_htmloverview_bootcamp.htm
file requested in the cURL example.
<div style="width:75%;text-align:justify;font-family:sans-serif"> <div> <h2 style="color:blue">API Overview</h2> <p> This API allows you to interface with our energy company's billing system. Specifically, the API receives a customer number and returns that customer's usage and billing details for the most recent billing cycle. You can also retrieve a usage and billing estimate for the upcoming billing cycle. </p> <h3>Using the API</h3> <div style="background-color:#f8f8f8;padding:10px 35px 10px 35px;width:80%"> <p> After <span style="font-weight:bold">registering</span>, you can access the API by using any client capable of making calls to an HTTP resource. See the documentation tab for detailed information about using this API. </p> <p> To register, first create a record for your application in the developer portal. After you have done this you can register your application to this API. </p> </div> <h3>Terms of Use</h3> <div style="background-color:#f8f8f8;padding:10px 35px 10px 35px;width:80%"> <p> The API requires a <span style="font-weight:bold">application key</span>. Requests without this key in a header or query parameter are automatically rejected. You can find the key on the Application's detail page after you register your application for this API. </p> </div> </div> </div> <p><em>Oracle Confidential. Copyright 2016, Oracle and/or its affiliates. All rights reserved.</em></p>