Skip to content

API Documentation for Pacdots

Jeffrey Leung edited this page Sep 3, 2017 · 1 revision

Get Pacdot Count

Note: Before the game begins, all Pacdots will be initialized and uneaten.

Description

Retrieves the following statistics:

  • Total number of Pacdots
  • Number of Pacdots which have been eaten
  • Number of Pacdots which have not been eaten
  • Number of Powerdots which have not been eaten

A Powerdot is classified as a type of Pacdot.

Request

Method

GET

Mapping

/pacdots/count

Response

Codes

HTTP Status Code Meanings
200 OK Retrieved Pacdot counts succesfully
500 Internal Server Error An error occurred which could not be resolved

JSON body

{
	"total" : 30,
	"eaten" : 23,
	"uneaten" : 7,
	"uneatenPowerdots" : 1
}

Example cURL call

Get Uneaten Pacdots

Description

Retrieves the locations of all uneaten Pacdots and whether they are a Powerdot.

Request

Method

GET

Mapping

/pacdots/uneaten

Response

Codes

HTTP Status Code Meanings
200 OK Retrieved all uneaten Pacdots succesfully
500 Internal Server Error An error occurred which could not be resolved

JSON body

[
	{
		"location" : {
			"latitude" : 999.999,
			"longitude" : 888.888
		},
		"powerdot" : false
	},
	{
		"location" : {
			"latitude" : 123.456
			"longitude" : 654.321
		},
		"powerdot" : true
	}
]

Example cURL call

Get All Pacdots

Description

Retrieves the locations of all Pacdots, whether they have been eaten, and whether they are a Powerdot.

Request

Method

GET

Mapping

/pacdots

Response

Codes

HTTP Status Code Meanings
200 OK Retrieved all Pacdots succesfully
500 Internal Server Error An error occurred which could not be resolved

JSON body

[
	{
		"location" : {
			"latitude" : 999.999,
			"longitude" : 888.888
		},
		"eaten" : true,
		"powerdot" : false
	},
	{
		"location" : {
			"latitude" : 123.456,
			"longitude" : 654.321
		},
		"eaten" : false,
		"powerdot" : true
	}
]

Example cURL call