Here you can find some examples of how to quickly start using the API from Curl and Java.
› Get the main anchor point
curl -i -X GET 'https://dev.hrider.net/api/v1' -H 'authorization: yourAuthAPIKey'
› Get all companies of the account.
curl -i -X GET 'https://dev.hrider.net/api/v1/companies' -H 'authorization: yourAuthAPIKey'
› Get the data of the company with the ID 12345
curl -i -X GET 'https://dev.hrider.net/api/v1/companies/12345' -H 'authorization: yourAuthAPIKey'
› Create a new company
curl -i -X POST 'https://dev.hrider.net/api/v1/companies' \
-H "Content-Type: application/json" \
-H 'authorization: yourAuthAPIKey' \
--data-binary @companyData.json
The companyData.json file contains the data of the company to create. For example:
{
"name":"NEMO",
"limit":100,
"address":"Atlantic Sea 17",
"taxIdNumber":"B12345678",
"language":"en"
}
› Obtain the employees list of the company with ID 12345, from 20 to 20 employees per page
curl -i -X GET 'https://dev.hrider.net/api/v1/companies/12345/employees?pageSize=20' \
-H 'authorization: yourAuthAPIKey'
› Assign to an administrator 2 companies with the IDs 123 and 456
curl -L -i -k -X PUT 'https://localhost:9191/api/api/v1/administrators/6562/companies' \
-H 'Content-Type: text/uri-list' \
--data-binary '@companies.uris' \
-H 'authorization: bearer oC0aGOzvwLSHJaDQ5kJv2bavrtmjkkYRAnb8BVoN'
The
companies.uris file is a text file with the
content type
text/uri-list, that includes an URI per line
with each one of the companies that we want to assign to the administrator:
https://dev.hrider.net/api/v1/companies/123
https://dev.hrider.net/api/v1/companies/456
If needed, the system also accepts abbreviated URIs of the type:
/companies/123
/companies/456
› Create an employee
curl -i -X POST 'https://dev.hrider.net/api/v1/employees' \
-H "Content-Type: application/json" \
-H 'authorization: yourAuthAPIKey' \
--data-binary @employeeData.json
The employeeData.json file contains the data of the employee to create. For example:
{
"address": "47 W 17TH ST, NEW YORK",
"birthDate": "1990-02-17T00:00Z",
"city": "NEW YORK",
"code": "EMP001",
"country": "USA",
"email": "[email protected]",
"externalId": "123",
"firstName": "JOHN",
"gender": "male",
"hireDate": "2014-07-27T00:00Z",
"lastName": "OWEN",
"nationalId": "11111111R"
}
› Set the photo of an employee
curl -i -X POST 'https://dev.hrider.net/api/v1/companies/12345/employees/1234/photo' \
-H 'authorization: bearer oC0aGOzvwLSHJaDQ5kJv2bavrtmjkkYRAnb8BVoN' \
-F 'data=@./files/photo.png' /dev/stdout
› Get an employee
curl -i -X GET 'https://dev.hrider.net/api/v1/companies/12345/employees/1234' \
-H 'authorization: yourAuthAPIKey'
› Assign a job position to an employee. Being
567 the ID of the job, and 1234 the ID of the employee
curl -i -X PUT 'https://dev.hrider.net/api/v1/companies/12345/employees/1234/position' \
-H 'authorization: yourAuthAPIKey' \
-d 'https://dev.hrider.net/api/v1/companies/12345/departments/777/positions/567'
› Assign subordinates to an employee. Being
111 and 222 the IDs of the subordinates
curl -i -X PUT 'https://dev.hrider.net/api/v1/companies/12345/employees/1234/subordinates' \
-H 'authorization: yourAuthAPIKey' \
--data-binary @subordinatesData.txt
The subordinatesData.json file contains the URIs of the employees to set as subordinates:
https://dev.hrider.net/api/v1/companies/12345/employes/1111
https://dev.hrider.net/api/v1/companies/12345/employes/2222