Home
Version 3
Service Usage Events (experimental) API

Service Usage Events (experimental) API

List Service Usage Events

GET /v2/service_usage_events

Events are sorted by internal database IDs. This order may differ from created_at. Events close to the current time should not be processed because other events may still have open transactions that will change their order in the results.

Fields

Name Description Default Valid Values Example Values

Parameters

Name Description Valid Values Example Values
q Parameters used to filter the result set.
Format queries as <filter><op><value>
Valid ops: : >= <= < > IN
Valid filters: service_instance_type
  • q=filter:value
  • q=filter>value
  • q=filter IN a,b,c
page Page of results to fetch
results-per-page Number of results per page
order-direction Order of the results: asc (default) or desc
inline-relations-depth 0 - don't inline any relations and return URLs. Otherwise, inline to depth N.
orphan-relations 0 - de-duplicate object entries in response
exclude-relations comma-delimited list of relations to drop from response
include-relations comma-delimited list of the only relations to include in response
after_guid Restrict results to Service Usage Events after the one with the given guid

Request

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI1OSIsImVtYWlsIjoiZW1haWwtMjAzQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MTc0NjIzNjZ9.K3zHJKDK2Kg5chvlux69WnQztpGC_NZ0qykKr8UYI58
Host: example.org
Cookie: 

Route

GET /v2/service_usage_events?results-per-page=1&after_guid=994dd204-508f-4aa0-8e1b-974b3f1e658a

Query Parameters

results-per-page: 1
after_guid: 994dd204-508f-4aa0-8e1b-974b3f1e658a

cURL

curl "https://api.[your-domain.com]/v2/service_usage_events?results-per-page=1&after_guid=994dd204-508f-4aa0-8e1b-974b3f1e658a" -X GET \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI1OSIsImVtYWlsIjoiZW1haWwtMjAzQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MTc0NjIzNjZ9.K3zHJKDK2Kg5chvlux69WnQztpGC_NZ0qykKr8UYI58" \
	-H "Host: example.org" \
	-H "Cookie: "

Response

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: f15366aa-ed91-464c-998c-e4334a65da1b
Content-Length: 1055
X-Content-Type-Options: nosniff

Status

200 OK

Body

{
  "total_results": 2,
  "total_pages": 2,
  "prev_url": null,
  "next_url": "/v2/service_usage_events?after_guid=994dd204-508f-4aa0-8e1b-974b3f1e658a&order-direction=asc&page=2&results-per-page=1",
  "resources": [
    {
      "metadata": {
        "guid": "0a795aa0-719b-4aa7-ba02-b4e57451169c",
        "url": "/v2/service_usage_events/0a795aa0-719b-4aa7-ba02-b4e57451169c",
        "created_at": "2014-11-24T19:32:46+00:00"
      },
      "entity": {
        "state": "CREATED",
        "org_guid": "guid-85a204e0-dd9d-4c9d-9eaa-29a059a012ba",
        "space_guid": "guid-a522d97f-82f0-4aaf-9b61-8e7b6a466ff1",
        "space_name": "name-935",
        "service_instance_guid": "guid-ac4ac9bc-7c11-49db-86bf-7d79c3988209",
        "service_instance_name": "name-936",
        "service_instance_type": "type-2",
        "service_plan_guid": "guid-698a16ee-c9b6-4c7f-bc82-0fb1bbcd924a",
        "service_plan_name": "name-937",
        "service_guid": "guid-3955fcbe-940d-47d8-99cd-48251a77034f",
        "service_label": "label-55"
      }
    }
  ]
}