REST requests for testing¶
This guide describes and explains several sample queries. These queries can be used to check the data exchange between your security server and the security server of another X-Road member. If the response is not an error message, the data exchange was successful and the communication between the two security servers worked as expected.
Note: Sample queries must be adapted to the information of your institution and data exchange partner.
Running a query¶
You can run the query from the security server command line with the following command:
For HTTP requests
curl "http://{your-ss-host}:8080/r1/{instance}/{partner-member-class}/{partner-member-code}/{partner-subsystem-code}/{service-code}/{endpoint}" -H "accept: application/json" -H "X-Road-Client:{instance}/{your-member-class}/{your-member-code}/{your-subsystem-code}" -H "X-Road-Id: $(uuidgen)"
curl "https://{your-ss-host}:8443/r1/{instance}/{partner-member-class}/{partner-member-code}/{partner-subsystem-code}/{service-code}/{endpoint}" -H "accept: application/json" -H "X-Road-Client:{instance}/{your-member-class}/{your-member-code}/{your-subsystem-code}" -H "X-Road-Id: $(uuidgen)" --cert {your-client-cert-file} --key {your-client-key-file} --insecure
Variable descriptions:¶
| Variable | Description |
|---|---|
| {your-ss-host} | The internal address of your security server to which you are sending a request from your information system. |
| {instance} | Either ISAADemo or AM (case sensitive). Must match security server environment. |
| {partner-member-class} | The member class value of the service provider's institution, either GOV, MUN, PUB, NGO or PVT |
| {partner-member-code} | The member code value of the service provider's institution. |
| {partner-subsystem-code} | The subsystem code value of the service provider subsystem that provides data services. Note: For the query to be successful, the service provider must have granted your subsystem access to its services. |
| {service-code} | The code of the service you want to query. |
| {endpoint} | Endpoint path within the service. |
| {your-member-class} | Your organization's member class value - GOV, MUN, PUB, NGO or PVT. |
| {your-member-code} | The member code value of your institution. |
| {your-subsystem-code} | The subsystem code of the subsystem you want to query. The subsystem must be in the "registered" status. |
Testing the Connection¶
ADEL operates a test service you can use to verify your Security Server is configured correctly before integrating with a real provider.
Provider details
| Field | Test env | Production env |
|---|---|---|
| Instance | ISAADemo | AM |
| Member Class | GOV | GOV |
| Member Name | demo-provider | ISA |
| Member Code | demo-provider | 53204255 |
| Subsystem Code | TEST | ADEL-ONBOARDING |
| Service Code | XROAD-TEST | connectivityCheck |
| Endpoint | hello | hello |
| Method | GET | GET |
Test curl command
Be sure to replace the placeholder variables in curly braces in the command with your actual data before running it.
For the test environment
curl -X GET "http://{your-ss-host}:8080/r1/ISAADemo/GOV/demo-provider/TEST/XROAD-TEST/hello" -H "X-Road-Client: ISAADemo/{your-member-class}/{your-member-code}/{your-subsystem-code}" -H "X-Road-Id: $(uuidgen)"
For the production environment
curl -X GET "https://{your-ss-host}:8443/r1/AM/GOV/53204255/ADEL-ONBOARDING/connectivityCheck/hello" -H "X-Road-Client: AM/{your-member-class}/{your-member-code}/{your-subsystem-code}" -H "X-Road-Id: $(uuidgen)" --cert {your-client-cert-file} --key {your-client-key-file} --insecure
A successful {"message":"Hello!"} response confirms your Security Server is correctly sending requests over X-Road.
Request access before testing
Contact ADEL support and provide your subsystem identifier so they can grant your subsystem access to the test service. Calls will be rejected until access is granted.