Registration Authority

The RA is the entity that manages every digital certificate inside a PKI infrastructure.

The operations available for this endpoint are these:

Verb Endpoint Action
POST /registrationauthorities/ Create a new registration authority
GET /registrationauthorities/ Get the list of registration authorities
GET /registrationauthorities/{id}/ Retrieve info about a specific regitration authority
PUT /registrationauthorities/{id}/ Update the info about a registration authority

Create a new Registration Authority

Endpoint:

            /api/v1/registrationauthorities/
Method:
POST

The parameters that can be associated to a RA are these:

Body Parameters:
Parameter Description Required
name The RA name Yes
parent The RA parent unique id Yes
enabled_from The date when the RA will be enabled from (the format is YYYY-MM-DD) Yes
enabled_until The date when the RA will be no longer enabled (the format is YYYY-MM-DD) No
organization_tax_number The tax number of the organization Yes
organization_name The organization name Yes
responsible_name The RA responsible name Yes
responsible_first_surname The RA responsible first surname Yes
responsible_second_surname The RA responsible first surname No
responsible_serial The RA responsible serial Yes
email A valid email address Yes
fix_phone_number A phone number Yes
mobile_phone_number A mobile phone number No
address The city address No
city The city where the RA is located No
postal_code The postal code of the city where the RA is located No
province The province of the city where the RA is located No
url A web url of the RA No
country The country where the RA is located Yes
Response

In case the creation request is successful, the server reply with a JSON containing the info about the RA just created and as status code 201 - Created.

Example

Here is displayed a simple request, sent with curl, for the creation of a new Registration authority and the successful response returned by the server.

params.json:


            {
                "name": "A new RA",
                "enabled_from": "2019-01-01",
                "organization_tax_number": "43242414213",
                "organization_name": "TEST",
                "responsible_name": "RESP",
                "responsible_first_surname": "TEST",
                "responsible_serial": "1234567890",
                "email": "email@example.com",
                "fix_phone_number": "391234567890",
                "country": "IT",
                "parent": "1"
            }

command:


            curl -d @params.json -H "Content-Type: application/json" -X POST https://api.uanataca.com/api/v1/registrationauthorities/
            

response:


            {
                "pk": 42,
                "name": "A new RA",
                "parent": 1,
                "operators": [],
                "enabled_from": "2019-01-01",
                "enabled_until": null,
                "organization_tax_number": "43242414213",
                "organization_name": "TEST",
                "responsible_name": "RESP",
                "responsible_first_surname": "TEST",
                "responsible_second_surname": null,
                "responsible_serial": "1234567890",
                "email": "email@example.com",
                "fix_phone_number": "391234567890",
                "mobile_phone_number": null,
                "city": null,
                "postal_code": null,
                "province": null,
                "url": null,
                "country": "IT"
            }

Listing Registration Authorities

It's possible to get the list of registration authorities associated to our user.

Endpoint:
/api/v1/registrationauthorities/
Method:
GET
Response

The response status code is 200 for success, and the body is a JSON with the list of RAs.

Example

The response is a JSON structured like the one showed on the side. The key "results" is the list containing the registration authorities and their operators.


            curl -X GET https://api.uanataca.com/api/v1/registrationauthorities/
            

            {
                "count": 40,
                "next": "https://api.uanataca.com/api/v1/registrationauthorities/?page=2",
                "previous": null,
                "results": [
                    {
                        "pk": 1,
                        "name": "Uanataca Authority",
                        "parent": null,
                        "operators": [
                            {
                                "pk": 13,
                                "permission_profile": 6,
                                "registration_authority": 1,
                                "request": 441
                            },
                            {
                                "pk": 1,
                                "permission_profile": 1,
                                "registration_authority": 1,
                                "request": 1
                            },
                            {
                                "pk": 8,
                                "permission_profile": 1,
                                "registration_authority": 1,
                                "request": 89
                            }
                        ]
                    },
                    ...
                ]
            }

Get info about a Registration Authority

It's also useful to get info about only one RA.

Endpoint:
/api/v1/registrationauthorities/{id}/
Method:
GET
Path Parameters:
Param Description
id The id of the registration authority
Response

The response body is the details about the RA in JSON format.

Example

Querying the endpoint with a GET request, will return the info about the RA specified.


            curl -X GET https://api.uanataca.com/api/v1/registrationautorities/40/
            

            {
                "pk": 40,
                "name": "A new RA",
                "parent": 1,
                "operators": []
            }

Update the RA info

The update of the info is possible with a PUT request passing the params that we want to update.

Endpoint:
/api/v1/registrationauthorities/{id}/
Method:
PUT
Path Parameters:
Param Description
id The id of the registration authority
Response

The successful response of this endpoint is the complete list of the info about the RA updated.

Example

The params.json contains the field that will be updated (the parent key is always required).


            {
                "name": "Just a NEW RA",
                "parent": "1"
            }

            curl -d @params.json -X PUT https://api.uanataca.com/api/v1/registrationauthorities/40/
            

            {
                "pk": 40,
                "name": "Just a NEW RA",
                "parent": 1,
                "operators": []
            }