Introduction
Use these endpoints to run a diagnostic test on a service.
Request Lifecycle
Running a diagnostic test is a two step process as follows:
-
Create a request, by sending a POST request to
/api/connect/services/diagnostic-tests/request
with the body of the request containing the service id, and the diagnostic test. The response’shttp status
will be201
with a blank response body. There will be aLocation
response header with a URL. This URL is where the request outcome can be obtained. -
Make a GET request to the URL returned in 1. to retrieve the outcome of the diagnostic test. While the test is in progress, the response’s
http status
will be202
. When the test has completed, a200
is returned, with the results in the body. If the test could not be completed, a422
will be returned, with the body containing details on why it failed in the standard error format.
Request Specifications
Version | Header | Changes |
---|---|---|
1 (Deprecated) |
X-API-VERSION=1 |
Initial Version |
2 (Deprecated) |
X-API-VERSION=2 |
No change |
3 |
X-API-VERSION=3 |
No change |
4 |
X-API-VERSION=4 |
No change |
5 |
X-API-VERSION=5 |
No change |
6 |
X-API-VERSION=6 |
No Change |
7 |
X-API-VERSION=7 |
No Change |
API Version 1, 2, 3, 4, 5, 6 and 7
POST Request
Verb |
POST |
URI |
/api/connect/services/diagnostic-tests/request |
Name | Description |
---|---|
|
The OAuth bearer access token |
|
The version of the endpoint you are accessing |
Path | Type | Description | Required |
---|---|---|---|
|
|
The id of the service. |
Required |
|
|
The diagnostic test. |
Required |
POST Response
Status Code | Meaning |
---|---|
201 |
The request was created successfully |
401 |
Bearer token is missing or invalid |
404 |
You do not have permission to perform this task or The id of the service resource provided does not exist |
422 |
There are validation errors on the request you made. Check the response body to see what fields had issues. |
500 |
There was an unexpected error processing the request |
502 |
There was an unexpected error with one or more of the upstream services |
Name | Description |
---|---|
|
The URL to check the outcome of the diagnostic test request |
GET Request
Note
|
The URI will be given to you in the Location header of the POST request of the Service Diagnostic Test request. |
Verb |
GET |
URI |
/api/connect/services/diagnostic-tests/requests/{id} |
Path Variable |
Purpose |
|
The id to poll to check the outcome of the diagnostic test request |
Name | Description |
---|---|
|
The OAuth bearer access token |
|
The version of the endpoint you are accessing |
GET Response
Status Code | Meaning |
---|---|
200 |
The request is complete. The body contains the result of the diagnostic test |
202 |
The request is in progress |
401 |
Bearer token is missing or invalid |
404 |
You do not have permission to perform this task or The id of the diagnostic-test-request resource provided does not exist |
422 |
The test did not complete. Check the response body to see why |
500 |
There was an unexpected error processing the request |
Path | Type | Description |
---|---|---|
|
|
service id |
|
|
diagnostic test |
|
|
requested on |
|
|
diagnostic test result |
|
|
|
|
|
Status name |
|
|
|
|
|
When status was entered. |
|
|
diagnostic test |
|
|
Results of the diagnostic test. Varies depending on type of test. |
|
|
Indicates whether the test is in a finalised state. |
|
|
More details on the different test results can be found here.
API Version 1, 2, 3, 4, 5, 6 and 7 - Examples
Successful Request
A service diagnostic test request is created by sending a POST request to /api/connect/services/diagnostic-tests/request.
POST /api/connect/services/diagnostic-tests/request HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer **token**
X-API-VERSION: 7
Content-Length: 54
Host: 360-api.superloop.com
{
"serviceId" : 12345,
"testType" : "port-reset"
}
If all required fields were given, then the response to the request will have:
-
a http status of 201
-
a
Location
header with the URI to check the diagnostic test result.
HTTP/1.1 201 Created
Location: /api/connect/services/diagnostic-tests/requests/557
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Once you have the URI from the Location
header, poll that URI every so often by making a GET request.
While the diagnostic test is in progress, the GET request’s response will have a http status
of 202
.
Keep polling the URL until it finishes.
Once the test has completed successfully, the GET request’s response will have a http status
of 200
and the body of the response will contain the result.
Note
|
Please keep the polling to a sensible rate. |
GET /api/connect/services/diagnostic-tests/requests/557 HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer **token**
X-API-VERSION: 7
Host: 360-api.superloop.com
HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 857
{
"serviceId" : 12345,
"testType" : "port-reset",
"createdOn" : "2025-03-11T22:28:04Z",
"result" : {
"id" : "67d802c5-e7d3-42ff-b827-2d1e889a1183",
"status" : [ {
"name" : "completed",
"reason" : null,
"created_at" : "2020-12-14 09:08:30"
}, {
"name" : "accepted",
"reason" : null,
"created_at" : "2020-12-14 09:08:27"
}, {
"name" : "in-progress",
"reason" : null,
"created_at" : "2020-12-14 09:08:27"
}, {
"name" : "pending",
"reason" : null,
"created_at" : "2020-12-14 09:08:18"
} ],
"type" : "port-reset",
"result" : {
"nbn_test_id" : "WRI904950000000",
"result" : "Passed",
"start" : "2020-12-14 09:08:23",
"end" : "2020-12-14 09:08:27"
},
"is_active" : false,
"requested_at" : "2020-12-14 09:08:18"
}
}
Diagnostic Test In Progress
While the diagnostic test is in progress, a http status
of 202
is returned.
HTTP/1.1 202 Accepted
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Diagnostic Test Did Not Complete
If the diagnostic test could not be completed, a http status
of 422
is returned and the body of the
response will list the problem.
This example is of a service diagnostic test request that timed out.
HTTP/1.1 422 Unprocessable Entity
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 442
{
"httpStatusCode" : 422,
"type" : "client.validation",
"code" : "validation",
"message" : "Validation error",
"apiSubErrors" : [ {
"code" : "constraints.service-diagnostic-test-request.timed-out",
"message" : "The Service Diagnostic Test Request has timed out",
"object" : "ServiceDiagnosticTestResource",
"field" : "status",
"rejectedValue" : "TIMEOUT"
} ],
"timestamp" : "2025-03-11T22:28:06.175526248Z"
}
This example is of a service diagnostic test request that has an error.
HTTP/1.1 422 Unprocessable Entity
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 444
{
"httpStatusCode" : 422,
"type" : "client.validation",
"code" : "validation",
"message" : "Validation error",
"apiSubErrors" : [ {
"code" : "constraints.service-diagnostic-test-request.in-error",
"message" : "The Service Diagnostic Test Request has errored",
"object" : "ServiceDiagnosticTestResource",
"field" : "status",
"rejectedValue" : "ERROR_OCCURRED"
} ],
"timestamp" : "2025-03-11T22:28:02.6885025Z"
}
Upstream Service Unavailable
If one of the services that Connect API uses for running diagnostic tests is down or unreachable,
Connect API will return a http status
of 502
.
HTTP/1.1 502 Bad Gateway
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 249
{
"httpStatusCode" : 502,
"type" : "remote.call",
"code" : "remote.call.error",
"message" : "There was an unexpected error with one or more of the upstream services",
"apiSubErrors" : [ ],
"timestamp" : "2025-03-11T22:28:03.813959539Z"
}