User profile API

An Access Token is required to authorize all API requests, as explained at the following link:

get Access Token

GET USER PROFILE

Get user profile and active certificates.

REST service specs:

Method: GET
URL: {viafirma_fortress_url}/api/v1/user/{user_code}

Security:

Authorization: Bearer {access_token}

Where:

Sample Request

Method: GET
URL: https://fortress.viafirma.com/fortress/api/v1/user/11111111H

Security Header: Authorization: Bearer 0b79bab50daca910b000d4f1a2b675d604257e42

Sample Response

Response in application/json format:

{
  "code": "11111111H",
  "name": "JHON DOE",
  "email": "[email protected]",
  "mobile": "+34666666666",
  "lastAccess": 1501590523833,
  "role": "ROLE_USER",
  "certificates": [
    {
      "code": "226ffa94-1f0f-4c43-98aa-c7c8e4ccf657",
      "name": "Sample Certificate 01",
      "description": "Lorem ipsum dolor sit amet",
      "dateIssued": 1492432672000,
      "dateExpired": 1555504674000,
      "serialNumber": "1250978750360690486",
      "issuer": "Certificate Authority info",
      "subject": "SERIALNUMBER=11111111H, GIVENNAME=JHON, SURNAME=DOE, C=ES"
    },
    {
      "code": "014e684e-4751-4850-853c-c90802385a78",
      "name": "Sample Certificate 02",
      "description": "Lorem ipsum dolor sit amet",
      "dateIssued": 1492432671000,
      "dateExpired": 1555504674000,
      "serialNumber": "1250978750360690486",
      "issuer": "Certificate Authority info",
      "subject": "SERIALNUMBER=11111111H, GIVENNAME=JHON, SURNAME=DOE, C=ES"
    }
  ]
}

Where:

Param Type Desc
code string Usercode
name string fullname
email string email
mobile string mobile number with country prefix, Ex. +34600100200
lastAccess long datetime of last login
role string role
certificates array list of digital certificates

API Errors

Errors are returned using application/json format:

{
  "error": "error_code",
  "error_description": "error_description"
}

Where:

Param Type Desc
error string Error code
error_description string Error description

Errors:

Error code Error
invalid_token invalid access_token (HTTP Status: 401)
user_not_found incorrect or inactive user (HTTP Status: 404)

GET USER STATUS

This service is used to retrieve information about functional operations that are allowed for a user (for instance, if user can sign, has any active digital certificate, etc.).

REST service specs:

Method: GET
URL: {viafirma_fortress_url}/api/v1/user/{user_code}/status

Security:

Authorization: Bearer {access_token}

Where:

Note: a user is identified in the platform by a unique code such as id-citizen, email, passport-id, etc.

Sample Request

Method: GET
URL: https://fortress.viafirma.com/fortress/api/v1/user/11111111H/status

Security Header: Authorization: Bearer 0b79bab50daca910b000d4f1a2b675d604257e42

Sample response

Response in application/json format:

{
  "sign": true,
  "auth": true
}

Where:

Param Type Desc
sign boolean true if user is allowed to sign with certificate
auth boolean true if user is allowed to authenticate with certificate

API Errors

Errors are returned using application/json format:

{
  "error": "error_code",
  "error_description": "error_description"
}

Where:

Param Type Desc
error string Error code
error_description string Error description

Errors:

Error code Error
invalid_token invalid access_token (HTTP Status: 401)
user_not_found incorrect or inactive user (HTTP Status: 404)

results matching ""

    No results matching ""