Skip to end of metadata
Go to start of metadata

This documentation is no longer actively supported and may be out of date. Going forward, please visit and bookmark our new site (https://docs.phunware.com/) for up-to-date documentation.

Venue Audit History

 

Any resource (Venue, Campus, Building, Floor, Point, Segment, Resource, etc) that is added, modified, or deleted via the Mapping API should now generate an audit record in the database.  In order to record user ID and username information in the audit history, the following request headers and appropriate values must be passed in each such request:

"userId"

"username"

These  audit history records can be retrieved via the following endpoint:

Method

GET

URL

http://map-api.phunware.com/v1.1/venues/history

Headers

X-Auth (see Security)

userId - string

username - string

Query Parameters

Any combination of orgId, isActive and/or clientId is accepted, but at least one must be present or the request is considered a bad request.

Parameter

Value

Description

venueGuid

string

The unique identifier for the venue.

sinceLastPublish

Boolean

If "true", only the audit history for since the last "publish" operation will be retrieved. If "false" or not specified, all venue history will be retrieved for that venue. It is a bad request error to have both "sinceLastPublish" and "publishesOnly" set to true since they would be in conflict with each other.

publishesOnly

Boolean

If "true", only publish operations will be retrieved. It is a bad request error to have both "sinceLastPublish" and "publishesOnly" set to true since they would be in conflict with each other.

publishIdinteger

If set, only the audit history for a particular publish operation will be retrieved. If a "publishId" is given, then both "sinceLastPublish" and "publishesOnly" must be false or omitted; otherwise it is a bad request error since the query parameters would be in conflict with each other.

Example Query Fragment

{"venueGuid":"f8a2f66c-84e4-4e27-a811-42db9cae8e9a","sinceLastPublish":false}

URL-encoded, minified fragment:

%7B%22venueGuid%22%3A%22f8a2f66c-84e4-4e27-a811-42db9cae8e9a%22%2C%22sinceLastPublish%22%3Afalse%7D

Example Request 

GET
http://map-api.phunware.com/v1.1/venues?%7B%22venueGuid%22%3A%22f8a2f66c-84e4-4e27-a811-42db9cae8e9a%22%2C%22sinceLastPublish%22%3Afalse%7D 

Response

A successful response will have a 200 status code and a body containing an array of audit history records that satisfy the query parameters:

{
    "data": 
	[
        {
          "id": <integer>,
          "userId": <string>,
          "username": <string>,
          "description": <string>,
          "venueGuid": <string>,
          "type": <string>,
          "crud": <string>,
          "elementId": <string>,
          "createdAt": <string>,
          "campusName": <string>,
          "campusId": <integer>,
          "buildingName": <string>,
          "buildingId": <integer>,
          "floorName": <string>,
          "floorId": <integer>
        },
        ...
    ]
}

See Mapping API Response Handling for error payloads. 

Example Response

Example body of a successful response:

{
    "data": 
	[
        {
          "id": 1064,
          "userId": "127",
          "username": "tferguson@abc123.com",
          "description": " added new Venue",
          "venueGuid": "f8a2f66c-84e4-4e27-a811-42db9cae8e9a",
          "type": "Venue",
          "crud": "C",
          "elementId": "f8a2f66c-84e4-4e27-a811-42db9cae8e9a",
          "createdAt": "2015-06-25T07:31:28Z",
          "campusName": null,
          "campusId": 0,
          "buildingName": null,
          "buildingId": 0,
          "floorName": null,
          "floorId": 0
        },
        {
          "id": 1065,
          "userId": "127",
          "username": "tferguson@abc123.com",
          "description": "No changes made",
          "venueGuid": "f8a2f66c-84e4-4e27-a811-42db9cae8e9a",
          "type": "Venue",
          "crud": "U",
          "elementId": "f8a2f66c-84e4-4e27-a811-42db9cae8e9a",
          "createdAt": "2015-06-25T07:31:29Z",
          "campusName": null,
          "campusId": 0,
          "buildingName": null,
          "buildingId": 0,
          "floorName": null,
          "floorId": 0
        }
    ]
}
  • No labels