API - Complete reference

The complete developer documentation for the Method Grid API

Response Format

The default Content-Type is 'application/json'.

In most cases a 200 response will have the following format

  {
"data": {
...
...
}
"meta": {
"count": 0,
"links": [
{
"rel": "",
"href": ""
},
...
...
]
}
}
 

The data attribute contains the data values related to the request.

The data attribute may contain other data attributes as required.

The meta attribute contains meta values related to the request.

In most cases, there will be a links attribute containing a list of valid urls that can be used. The client should avoid constructing its own urls and should only use those provided by the api as they may change in future versions.

If the data attribute represents an array (e.g. collection of grids) there will usually be a count attribute in the meta attribute with the number of items in the array.


Errors

The default Content-Type for errors is application/problem+json.

In most cases the response will have the following format

  {
"status": NNN,
"type": "",
"title": "",
"detail": "",
"instance": ""
"token": ""
}
 

Examples

401 Unauthorized

{
"status": 401,
"type": "???",
"title": "Invalid value for token.",
"detail": "api\\methodgrid\\com\\Http\\Exception\\UnauthorizedException",
"instance": "GET https://api.methodgrid.com/v1/"
}
 

Root Endpoint

GET /

Use this to check that authentication is working . An Authorization header is required. If authentication is successful, response status is 200 and response contains some basic meta data. In time the response could be extended to include meta data related to the authenticated user such as which api requests they are authorized to use.

Responses

Status: 200 OK
 
{
"links": [
{
"rel": "canonical",
"href": "https://api.methodgrid.com/v1/"
}
]
}
 

OPTIONS /

Responses

Status: 200 OK
 

Examples

200 OK

$ curl -v https://api.methodgrid.com/v1/ -H 'Authorization: Bearer {accessToken}'

$ curl -X OPTIONS -v https://api.methodgrid.com/v1/ -H 'Origin: {Origin}'
 

Is api available?

GET /ping

Use this to check that api is available.

No Authorization header is required.

Responses

Status: 200 OK    
 
{
"pong": "2020-02-25 13:29:27"
}
 

Examples

200 OK

$ curl -v https://api.methodgrid.com/v1/ping
 

Authentication

Revoke access token (logout)

DELETE /authenticate

Use this to revoke a refreshToken, usually requested when a user logs out of client application.

Note that the access token will remain valid until it reaches its expiry time but it will not be able to be refreshed.

Responses

Status: 204 No content
 
Status: 401 Unauthorized
 

Examples

204 No Content

$ curl -X DELETE -v https://api.methodgrid.com/v1/authenticate -H 'Authorization: Bearer {accessToken}'
 

Get access token using client_id/client_secret credentials

POST /authenticate

No Authorization header is required

If credentials are valid, will return new accessToken and refreshToken.

Parameters

{
client_id
client_secret
}
 

Responses

Status: 200 OK    
 
{
"accessToken": "accessToken",
"refreshToken": "refreshToken"
}
 

accessToken expires after 1 hour.

refreshToken expires after 7 days.

Status: 400 Bad Request    
 
{
"status": 400,
"type": "???",
"title": "Missing parameters",
"detail": "api\\methodgrid\\com\\Http\\Exception\\BadRequestException: Expecting either client_id/client_secret, refreshToken",
"instance": ""
}
 
Status: 401 Unauthorized
 
{
"status": 401,
"type": "???",
"title": "Invalid credentials.",
"detail": "api\\methodgrid\\com\\Http\\Exception\\UnauthorizedException: The supplied credentials are incorrect",
"instance": "POST https://api.methodgrid.com/v1/authenticate"
}
 

Examples

200 OK

$ curl -X POST -v https://api.methodgrid.com/v1/authenticate -d 'client_id={client_id}' -d 'client_secret={client_secret}'
 

400 Bad Request

$ curl -X POST -v https://api.methodgrid.com/v1/authenticate
 

401 Unauthorized

$ curl -X POST -v https://api.methodgrid.com/v1/authenticate -d 'client_id=invalid' -d 'client_secret=invalid'
 

Get access token using refresh token

POST /authenticate

Authorization header is required and should contain the accessToken that corresponds to the given refreshToken.

If refreshToken is valid, will return new accessToken and refreshToken.

Parameters

{
refreshToken
}
 

Responses

Status: 200 OK
 
{
"accessToken": "accessToken",
"refreshToken": "refreshToken"
}
 

accessToken expires after 1 hour.

refreshToken expires after 7 days.

Status: 400 Bad Request
 
{
"status": 400,
"type": "???",
"title": "Missing parameters",
"detail": "api\\methodgrid\\com\\Http\\Exception\\BadRequestException: Expecting either client_id/client_secret, refreshToken",
"instance": ""
}
 
Status: 500 Internal Server Error
 
{
"status": 500,
"type": "App\\Domain\\Exception\\NotFoundException",
"title": "???",
"detail": "",
"instance": "???"
}
 

Examples

200 OK

$ curl -X POST -v https://api.methodgrid.com/v1/authenticate -H 'Authorization: Bearer {accessToken}' -d 'refreshToken={refreshToken}'
 

400 Bad Request

$ curl -X POST -v https://api.methodgrid.com/v1/authenticate
 

500 Internal Server Error

$   curl -X POST -v https://api.methodgrid.com/v1/authenticate -H 'Authorization: Bearer {accessToken}' -d 'refreshToken=invalid'
 

Me

Get basic details with links to sub-resources

GET /me

Authorization header is required.

Basic details of member.

Links to sub-resources (analytics, elements, folders, grids, settings, tasks).

Responses

Status: 200 OK
 
{
"data": {
"full-name": "full-name",
"id": id,
"identifier": "identifier"
},
"meta": {
"links": [
{
"rel": "analytics",
"href": "https://api.methodgrid.com/v1/me/analytics"
},
{
"rel": "elements",
"href": "https://api.methodgrid.com/v1/me/elements"
},
{
"rel": "folders",
"href": "https://api.methodgrid.com/v1/me/folders"
},
{
"rel": "grids",
"href": "https://api.methodgrid.com/v1/me/grids"
},
{
"rel": "self",
"href": "https://api.methodgrid.com/v1/me/"
},
{
"rel": "settings",
"href": "https://api.methodgrid.com/v1/me/settings"
},
{
"rel": "tasks",
"href": "https://api.methodgrid.com/v1/me/tasks"
}
]
}
}
 

Examples

200 OK

$ curl -v https://api.methodgrid.com/v1/me -H 'Authorization: Bearer {accessToken}'
 

OPTIONS /me

Get task details

GET /tasks/{taskIdentifier}

Authorization header is required.

Basic details of task.

Responses

Status: 200 OK
 
{
"data": {
"description": "description",
"identifier": "taskIdentifier"
},
"meta": {
"links": [
{
"rel": "comments",
"href": "https://api.methodgrid.com/v1/tasks/{taskIdentifier}/comments"
},
{
"rel": "self",
"href": "https://api.methodgrid.com/v1/tasks/{taskIdentifier}"
}
]
}
}
 

Examples

200 OK

$ curl -v https://api.methodgrid.com/v1/tasks/{taskIdentifier} -H 'Authorization: Bearer {accessToken}'
 

Dashboards

Get grids dashboard

GET /dashboards/grids

Authorization header is required.

CSV of grid data.

Responses

Status: 200 OK

Content-Type: text/csv; charset=utf-8
 
Folder,Grid,"Grid type","Grid state","Assigned to",Status,RAG,Flagged,Overdue,"End date","Total elements (includes information-only elements)","Elements % complete (excludes information-only elements)","Stage Gates % complete"
"Grid Library","New Grid",Non-master,Active,,"Not started",None,,Y,2023-01-01,1,0,0
 

Examples

200 OK

$ curl -v https://api.methodgrid.com/v1/dashboards/grids -H 'Authorization: Bearer {accessToken}'
 

Get elements dashboard

GET /dashboards/elements

Authorization header is required.

CSV of element data.

Responses

Status: 200 OK

Content-Type: text/csv; charset=utf-8
 
Element,Complete,"Assigned to","End date",Overdue,"Task % complete","On hold",RAG,Flagged,Grid,"Grid type","Grid state",Stage,Theme,Folder
"New element",N,,2023-01-01,Y,0,,None,,"New Grid",Non-master,Active,"Stage 1","Theme 1","Grid Library"
 

Examples

200 OK

$ curl -v https://api.methodgrid.com/v1/dashboards/elements -H 'Authorization: Bearer {accessToken}'
 

Get stage gate dashboard

GET /dashboards/stage-gates

Authorization header is required.

CSV of stage gate data.

Responses

Status: 200 OK

Content-Type: text/csv; charset=utf-8
 
Outcome,"Stage gate","Assigned to/Signed off by","End date",Overdue,"Signed off date","Stage gate tasks % complete","Stage gate tasks RAG Score",Stage,Grid,"Grid type","Grid state","Grid status",Folder
Pending,"Stage gate: Stage 1",,,N,,0,,"Stage 1","New Grid",Non-master,Active,"Not started","Grid Library"
 

Examples

200 OK

$ curl -v https://api.methodgrid.com/v1/dashboards/stage-gates -H 'Authorization: Bearer {accessToken}'
 

Get tasks dashboard

GET /dashboards/tasks

Authorization header is required.

CSV of task data.

Responses

Status: 200 OK

Content-Type: text/csv; charset=utf-8
 
Task,Type,"Assigned to","End date",Overdue,"Reminder date",Status,RAG,Flagged,Element,"Stage gate",Grid,"Grid type","Grid state",Stage,Theme,Folder
Task 1,"Element task",,2023-01-01,Y,,"Not started",None,,"New element",,"New Grid",Non-master,Active,"Stage 1","Theme 1","Grid Library"
 

Examples

200 OK

$ curl -v https://api.methodgrid.com/v1/dashboards/tasks -H 'Authorization: Bearer {accessToken}'