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.

SEGMENT

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.

Create a Segment

 

This method is used to create a segment.   Segments may only be created via this method on draft floors.

Method

POST

URL

http://map-api.phunware.com/v1.1/segments

Headers

X-Auth (see Security)

Request Body

Required parameters are underlined.

Parameter

Value

Description

startPointId

integer

The identifier of the starting point of the segment.

endPointId

integer

The identifier of the ending point of the segment

floorId

integer

The identifier of the floor that the start and end points are on.

{
    "startPointId": <integer>,
    "endPointId": <integer>,
    "floorId": <integer>
}

Example Request

POST the following request body to: http://map-api.phunware.com/v1.1/segments

{
    "startPointId": 78757,
    "endPointId": 78758,
    "floorId": 17
}

Response

A successful response will have a 200 status code and a body containing the newly created segment's ID:

{
    "data": 
	{
        "id": <integer>
    }
}

See Mapping API Response Handling for error payloads.

Example Response

Example body of successful response:

{
    "data": 
	{
        "id": 512
    }
}

ON THIS PAGE

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.

Retrieve a Segment

 

This method is used to retrieve a segment by segment ID.

Method

GET

URL

http://map-api.phunware.com/v1.1/segments/[id]

Headers

X-Auth (see Security)

Query Parameters

Required parameters are underlined.

Parameter

Value

Description

draftStatus

string

Either "LIVE" or "DRAFT". Defaults to "LIVE".

Example Request

GET
http://map-api.phunware.com/v1.1/segments/512

Response

A successful response will have a 200 status code and a body containing an object with segment data:

{
    "id": <integer>,
    "startPointId": <integer>,
    "endPointId": <integer>,
    "floorId": <integer>,
    "externalId": <integer>
}

See Mapping API Response Handling for error payloads.

Example Response

Example body of a successful response:

{
    "id": 512,
    "startPointId": 78757,
    "endPointId": 78758,
    "floorId": 17,
    "externalId": 512
}

ON THIS PAGE

 

 

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.

Retrieve a Collection of Segments

 

This method is used to retrieve an array of segments that satisfy search criteria.

Method

GET

URL

http://map-api.phunware.com/v1.1/segments

Headers

X-Auth (see Security)

Query Parameters

Required parameters are underlined.

Parameter

Value

Description

floorId

integer

Identifier of the floor.

limit

integer

Specifies the number of results to return. This is useful for pagination.

Default value: 10

Maximum value: 100

offset

integer

Specifies the number of results to offset. This is useful for pagination.

Default value: 0

draftStatusstringEither "LIVE" or "DRAFT". Defaults to "LIVE".

Example Query Fragment

{
	"floorId": 17
}  

URL-encoded, minified fragment:

%7B%22floorId%22%3A17%7D  

Example Request 

GET
http://map-api.phunware.com/v1.1/segments?%7B%22floorId%22%3A17%7D 

Response

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

{
    "data": 
	[
        {
            "id": <integer>,
            "startPointId": <integer>,
            "endPointId": <integer>,
            "floorId": <integer>,
            "createdAt": <string>,
            "updatedAt": <string>,
            "externalId": <integer>
        },
        {
            "id": <integer>,
            "startPointId": <integer>,
            "endPointId": <integer>,
            "floorId": <integer>,
            "createdAt": <string>,
            "updatedAt": <string>,
            "externalId": <integer>
        },
        ...
    ],
    "pagination": 
	{
        "results": <object>,
        "pages": <object>
    }
}

See Mapping API Response Handling for error payloads. 

Example Response

Example body of a successful response:

{
    "data": 
	[
        {
            "id": 512,
            "startPointId": 78757,
            "endPointId": 78758,
            "floorId": 17,
            "createdAt": "2014-04-09T19:16:31Z",
            "updatedAt": "2014-04-09T19:16:31Z",
            "externalId": 512
        },
        {
            "id": 521,
            "startPointId": 57787,
            "endPointId": 57788,
            "floorId": 17,
            "createdAt": "2014-04-09T19:16:31Z",
            "updatedAt": "2014-04-09T19:16:31Z",
            "externalId": 521
        }
    ],
    "pagination": 
	{
        "results": 
		{
            "from": 1,
            "to": 2,
            "total": 2
        },
        "pages": 
		{
            "current": 1,
            "prev": null,
            "next": null,
            "total": 2
        }
    }
}

ON THIS PAGE

 

 

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.

Retrieve a Count of Segments

 

This method is used to retrieve the number of segments that match search criteria.

Method

GET

URL

http://map-api.phunware.com/v1.1/segments/count

Headers

X-Auth (see Security)

Query Parameters

Required parameters are underlined.

Parameter

Value

Description

floorId

integer

Identifier of the floor to get segments for.

isActive

boolean

If omitted, get count of segments whose endpoints are either active or inactive.

If true, get count of segments whose endpoints are active.

If false, get count of segments whose endpoints are inactive.

 

draftStatusstringEither "LIVE" or "DRAFT". Defaults to "LIVE".

Example Query Fragment

{
	"floorId": 17
}  

URL-encoded, minified fragment:

%7B%22floorId%22%3A17%7D 

Example Request 

GET
http://map-api.phunware.com/v1.1/segments/count?%7B%22floorId%22%3A17%7D 

Response

A successful response will have a 200 status code and a body like the below:

{
    "data": 
	{
        "count": <integer>
    }
}

See Mapping API Response Handling for error payloads.

Example Response

Example body of a successful response:

{
    "data": 
	{
        "count": 2
    }
} 

ON THIS PAGE

 

 

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.

Update a Segment

 

This method is used to update a segment.   Only draft segments (i.e. segments that belong to a draft floor) may be modified via this method.

Method

PUT

URL

http://map-api.phunware.com/v1.1/segments/[id]

Headers

X-Auth (see Security)

Request Body

See Mapping API Architecture > PUT Methods & Partial Updates.

Parameter

Value

Description

startPointId

integer

The identifier of the starting point of the segment.

endPointId

integer

The identifier of the ending point of the segment

floorId

integer

The identifier of the floor that the start and end points are on.

{
	"startPointId": <integer>,
	"endPointId": <integer>,
	"floorId": <integer> 
}

Example Request

PUT the following request body to: http://map-api.phunware.com/v1.1/segments/512

{
	"startPointId": 78757,
	"endPointId": 78775,
	"floorId": 17 
}

Response

A success response will return a 204 status code with no data in the body of the response. See Mapping API Response Handling for error payloads.

ON THIS PAGE

 

 

 

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.

Delete a Segment

 

This method is used to delete a segment.   Only draft segments (i.e. segments that belong to a draft floor) may be modified via this method.

Method

DELETE

URL

http://map-api.phunware.com/v1.1/segments/[id]

Headers

X-Auth (see Security)

Request Parameters

None

Example Request

DELETE
http://map-api.phunware.com/v1.1/segments/512

Response

A success response will return a 204 status code with no data in the body of the response. See Mapping API Response Handling for error payloads.

ON THIS PAGE

 

 

 

 

 

A segment is a collection of two points that have been connected. 

Segments are used to calculate routes. A route between a start point and an end point can only be created if there exists a collection of segments from the start point, through zero or more intermediate points, to the end point.

{
    "id": <integer>,
    "startPointId": <integer>,
    "endPointId": <integer>,
    "floorId": <integer>,
    "id": <integer>
}
  • No labels