2.0.2 • Published 4 years ago

@romulovalez/da-applicant-test v2.0.2

Weekly downloads
20
License
MIT
Repository
-
Last release
4 years ago

🚀 Installation

yarn add styled-components @romulovalez/da-applicant-test
npm install styled-components @romulovalez/da-applicant-test

In order to use it you will need to have access to the D'Anchiano API.

🖲 Usage

import React from 'react'
import ApplicantTest from '@romulovalez/da-applicant-test'

const Example = () => (
  <ApplicantTest
    baseUrl="https://dev.danchiano.com"
    token="57f3fd937c4e0814ffa68c1a67f2e53d" />
)

🧬 Properties

PropertyTypeDescription
baseUrlStringD'Anchiano base url
tokenStringApplicant access token

🔑 Get applicant token

GET {baseUrl}/api/v1/users/{applicantId}/token
header = {
	'Authorization': 'Bearer {portalToken}',
	'Accept-Language': {lang},
}
PropertyTypeDescription
portalTokenStringPortal access token (get it here)
langStringISO 639-1 Language code

This token will allow you to start an applicant's session on the frontend. If it does not exist or if it is expired it generates a new token. It expires after 24 hours.

You can force the generation of a new token by adding ?refresh to the request.

🛠 Endpoints

If you want to make your own frontend this are the endpoints used:

Answer the question 'people-in-charge'

POST {baseUrl}/api/v2/applicant/people-in-charge?token={token}
PropertyTypeDescription
valueboolpeople at charge value

Get the current question of the test

GET {baseUrl}/api/v2/applicant/questions?token={token}

Answer the current question

POST {baseUrl}/api/v2/applicant/answer/{answerId}?token={token}
PropertyTypeDescription
answerValueStringanswer (a,b)

Update the time elapsed in the test

PATCH {baseUrl}/api/v2/applicant/test-timer?token={token}
PropertyTypeDescription
timerNumbertime in seconds

📝 License

MIT

2.0.2

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.0.6

4 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago