This is an old revision of the document!


JSON API Endpoints

This section lists the different API endpoints you can use to access or update Protogrid data. The respective http method is defined as [METHOD] following the endpoint in this documentation.

Response

Every request to such an API endpoint returns a JSON object. The returned JSON object always contains an error and a result object. If the request was successful, the result object contains the requested or updated data. When the request fails, the errors object contains the error messages which occurred when trying to execute the request.

Example successful response
{
	"errors": [], 
	"protogrid_environment_version": "1.3.9",
	"result":{
		"key": {…},
		"key": […],
		"key": "data"
	}
}
Example failure response
{
	“errors”: [
		{ … },
		{ … }
	], 
	"protogrid_environment_version": "1.3.9",
	“result”: {}
}

End Points

The Protogrid JSON API offers the following API endpoints:

/api/v2/apps

[GET] Returns a list of all applications to which the authenticated user has access.

Example request:

 https://example.protogrid.com/api/v2/apps

Example response:

{
	"errors": [], 
	"protogrid_environment_version": "1.3.9",
	"result":[
		{
			"app_id": "app_example_id", 
			"description": "Example App", 
			"logo_url": "", 
			"theme_color": "blue-dark", 
			"title": "Example App ", 
			"url": "/example", 
			"url_name": "example"
		},
		{
			"app_id": "appID",
			"description": "Your awesome app",
			…
		},
		…
	]
}
/api/v2/apps/<app_name>

[GET] Returns basic information about one application.

Example request:

 https://example.protogrid.com/api/v2/apps/example 

Example response:

{ 
	"errors": [],
	"protogrid_environment_version": "1.3.9",
	"result": { 
		"app_id": "appID",
		"description": "Example App",
		"logo_url": "",
		"theme_color": "blue-dark",
		"title": "Example App ", 
		"url": "/example",
		"url_name": "example"
	}
}
/api/v2/apps/<app_name>/views

[GET] Returns a list of all view names in this application. Details on what views are supported, see all available views. Example request:

 https://example.protogrid.com/api/v2/apps/example/views 

Example response:

{
	"errors": [],
	"protogrid_environment_version": "1.3.9",
	"result": {
		"views": [
			{"view_name": "examples_by_id"},
			{…}
		]
	}
}
Print/export