pwrd by

Registration

The registration API allows clients to register new relations in the Procurios CRM. Relations have only a few default fields; most fields are dynamically configured. Not all of those fields are always exposed. For different situations, different combinations of fields may be useful. These configurations are called registration sets and all calls to the registration api must go through one of these sets. Call the schema method in order to figure out which fields are available.

Several different registration sets may be available to you, depending on the allowed scopes and requested scopes. The methods below use example values such as 42, 99 and username42. You can request the set of registration sets that are available to you and use the id of one of the sets for further API calls.

Accept header for requests to Registration

application/vnd.procurios.profile+json; version=1

Registration set

GET/l/profile_api/registrationset

Get the registration sets that are available to your access token

Request

Body

Response

json Status: 200
{
    "registrationSet": [
        {
            "id": 42,
            "title": "Demo registration set"
        }
    ]
}

Schema

GET/l/profile_api/registrationset/42/schema

Get the current schema for the API for the requested registration set. The exact fields in the response will change with the configuration of the registration set.

Request

Body

Response

json Status: 200
{
    "$schema": "http:\\\/\\\/json-schema.org\\\/draft-07\\\/schema#",
    "title": "Demo registration set",
    "type": "object",
    "properties": {
        "first_name": {
            "title": "First name",
            "type": "string"
        },
        "insertion": {
            "title": "Insertion",
            "type": "string"
        },
        "name": {
            "title": "Name",
            "type": "string"
        },
        "birth_date": {
            "title": "Birth date",
            "type": "date"
        },
        "address": {
            "title": "Address",
            "type": "object",
            "properties": {
                "street": {
                    "type": "string",
                    "title": "Straat"
                },
                "number": {
                    "type": "integer",
                    "title": "Nummer"
                },
                "number_add": {
                    "type": "string",
                    "title": "Toevoeging"
                },
                "postcode": {
                    "type": "string",
                    "title": "Postcode"
                },
                "town": {
                    "type": "string",
                    "title": "Plaats"
                },
                "country": {
                    "type": "string",
                    "minimum": 2,
                    "maximum": 2,
                    "title": "Land"
                }
            }
        },
        "action_code": {
            "title": "Entered via action",
            "type": "integer"
        }
    },
    "required": [
        "name",
        "address"
    ]
}

Registration

POST/l/profile_api/registrationset/42/registration

Create a new registration

Request

Body
{
    "name": "Test name",
    "address": [
        "Fortweg",
        9,
        "",
        "3992LX",
        "Houten",
        "NL"
    ]
}

Response

json Status: 200
{
    "registrationId": 123
}

Registration

GET/l/profile_api/registrationset/42/registration/99

Get a single registration

The registration is not yet complete and a relationId is not yet available

Request

Body

Response

Status: 404

The registration is complete and the relationId is available

Request

Body

Response

json Status: 200
{
    "registrationId": 99,
    "relationId": 997234
}

Validate

POST/l/profile_api/registrationset/42/validate

Validate your call without causing changes. Intended for forms with multiple pages.

Request

Body
{
    "name": "Test name",
    "address": [
        "Fortweg",
        9,
        "",
        "3992LX",
        "Houten",
        "NL"
    ]
}

Response

Status: 200

Request

Body
{
    "name": "Test name"
}

Response

json Status: 400
{
    "page": 1,
    "errors": {
        "address": "Dit veld is verplicht"
    }
}

Is username available

GET/l/profile_api/isusernameavailable/username42

Checks whether a username is available

Request

Body

Response

json Status: 200
{
    "isAvailable": true
}