Was this helpful?

 

API Platform Base Path: https://api.enterprise.apigee.com/v1

API Resource Path:

/audits/o/{org_name}

Description: Lists audit records for management operations against APIs, API revisions, and policies. (Note that base path inserts audits before organizations: /audits/organizations/org_name}.

Verb: GET
Auth: Basic Auth
Media types:
application/json
text/xml

Overview:

For every call made to the management API, Apigee Edge logs an audit record. The /audits API enables you to obtain a record of all management calls made against entities in an organization.

By calling /audits, you can determine, for example, when an API proxy was deployed to an environment, and by whom. You can also use the audits API to retrieve the management history of OAuth tokens, enabling you to verify app end user consent.

To generate a request to the audit API, append the target resource as a URL parameter to the base path of the request for an audit.

A response from the audit API returns a history of CREATE, UPDATE, and DELETE operations on the audit target.

Supported audit targets include:

  • /apis/{api_name}
  • /apis/{api_name}/revisions/{revision_number}/policies/{policy_name}
  • /apis/{api_name}/revisions/{revision_number}/resources/{resource_name}
  • /oauth2/accesstokens
  • /oauth2/authorizationcodes
  • /oauth1/accesstokens
  • /oauth1/requesttokens
  • /developers
  • /apps
  • /apiproducts

Note that a resource name identifies a JavaScript, Python, Java, or XSLT file stored under /resources in an API proxy configuration.

To retrieve all audit records for sub-entities, use the query parameter expand=true. By setting expand=true on /apis, you return audit records for all revisions, policies, and resources for all API proxies in your organization.

For API revisions, deploy and undeploy actions are recorded as CREATE operations. Therefore a CREATE action on an API revision indicates that a new revision was deployed while the previous revision was undeployed.

Sample Request:
$ curl -X GET -H "Accept:application/json" \
https://api.enterprise.apigee.com/v1/audits/o/apifactory/apiproducts?"startTime=1392258786968&endTime=1394677986968" \
-u myname:mypass
Query Parameters:
Name Description Default Required?
user Filters results by Apigee user's email address N/A No
operation Filters results by operation. Valid values are create, update, delete. N/A No
timeline Filters results by the specified time interval. Valid values are today, week, month. Today No
startTime The beginning time, in Unix epoch format, for which audit entries should be returned N/A No
endTime The end time, in Unix epoch format, for which audit entries should be returned N/A No
rows A limit on the total number of audit entries to be returned  N/A No
expand 'true' is the only valid value for this query parameter. When set to true, the audit records for all sub-resources are returned in the list of records. N/A No
Sample Response:
{
  "auditRecord" : [ {
    "operation" : "CREATE",
    "request" : "''apifactory''",
    "requestUri" : "/v1/o/apifactory/apiproducts",
    "responseCode" : "400",
    "timeStamp" : 1393517971158,
    "user" : "admin_user@company.com"
  }, {
    "operation" : "CREATE",
    "request" : "''apifactory''",
    "requestUri" : "/v1/o/apifactory/apiproducts",
    "responseCode" : "400",
    "timeStamp" : 1393517931524,
    "user" : "admin_user@company.com"
  }, {
    "operation" : "DELETE",
    "request" : "''apifactory''",
    "requestUri" : "/v1/o/apifactory/apiproducts",
    "responseCode" : "409",
    "timeStamp" : 1393528861053,
    "user" : "developer@company.com"
  }]
}
Response Payload Elements:
Name Description
auditRecord The audit record for an operation on the target resource
operation The operation (CREATE, UPDATE, or DELETE) logged for this target
request The target organization
requestURI The URI path of the request to the audit target
responseCode The HTTP response code returned for the operation from Apigee Edge to the requesting app
timeStamp Unix time when the action was logged by the auditing system
user The ID of the user who issued the API call in the audit record
Errors
<Error>
  <Code>audit.invalid_search_parameter</Code>
  <Message>Search parameter is not valid </Message>
  <Contexts/>
</Error>

 

Add new comment

Provide your email address if you wish to be contacted offline about your comment.
We will not display your email address as part of your comment.

We'd love your feedback and perspective! Please be as specific as possible.
Type the characters you see in this picture. (verify using audio)

Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.