API: User
GET /api/v3/user/me
Request parameter:
No Request parameter
Response data:
Parameter | Type | Description |
---|---|---|
contact | array | An array containing API: Contact information |
contact[id] | integer | Contact-ID of the user |
contact[type] | integer | 1=Company / 2=Person |
contact[name1] | string | Lastname / Company name of the user |
contact[name2] | string | Firstname / Company addition of the user |
contact[mail] | string|null | Email address of the user |
contact[letter_text] | string | Letter text of the user |
contact[language] | "de"|"fr"|"it"|"en"|null | Language of the user |
contact[avatar] | string|null | A base64 encoded contact avatar |
login | array | An array containing login information |
login[id] | integer | Login-ID of the user |
login[username] | string | Username of the user |
login[2fa] | boolean | Indicator if 2FA is active |
login[is_admin] | boolean | Indicator if the user is an "admin" |
login[is_sharer] | boolean | Indicator if the user is a sharer, if so contacts that are not leds, not deleted or archived and have contact.id as sharer set up , will be included in login permission list |
sharer_id | integer|null | Contact-ID of the sharer |
point_of_contact | array | Client login point of contact API: User |
point_of_contact[id] | int|null | Point of contact id (BS: User id) |
point_of_contact[first_name] | string|null | First name |
point_of_contact[last_name] | string|null | Last name |
point_of_contact[phone] | string|null | Phone number |
point_of_contact[phone_mobile] | string|null | Mobile phone number |
point_of_contact[email] | string|null | Email adress |
point_of_contact[avatar] | string|null | A base64 encoded user avatar |
point_of_contact[name] | string|null | Name |
point_of_contact[type] | id | Type of point of contact (0=Client Advisor, 1=Manager, 2=Consultant) |
Response (Error):
Parameter | Type | Description |
---|---|---|
code | integer | An error code |
error | string | A message containing some information about the error |
Request
curl -X GET https://public.brokerstar.biz/api/v3/user/me --header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJpYXQiOjE2NTg[...]cm5hbWUiOiJkZW1vLWRlIn0.VTVp[...]cqIg'
Response (Success)
200 OK { "data": { "contact": { "id": 31, "type": 2, "name1": "Abels", "name2": "Conrad", "mail": "conrad@mustermann.ch", "letter_text": "Sehr geehrter Herr Abels", "language": "de", "avatar": null }, "login": { "id": 2, "username": "demo-de", "2fa": false, "is_admin": false, "is_sharer": false }, "sharer_id": null, "point_of_contact": { "id": 7, "first_name": "Akali", "last_name": "Baba", "phone": "+22 12312312112", "phone_mobile": "+22 321312311", "email": "akali.baba@gmail.com", "avatar": "data:image/gif;base64,/9j/4AAQSk...S4wICh1c2..", "name": "Akali Baba", "type": 0 }, } }
Response (Error)
401 Unauthorized { "code": 401 "message": "Invalid JWT Token" }
POST /api/v3/user/me
Request parameter:
Parameter | Mandatory | In Type | Description |
---|---|---|---|
login | no | string(80) | New login (unique) |
no | string(255) | New email |
Response data:
Metadata: object.
Parameter | Type | Description |
---|---|---|
message | string | Response message |
code | int | Response status code (same as in http code) |
Response (Error):
Parameter | Type | Description |
---|---|---|
code | integer | An error code |
error | string | A message containing some information about the error |
errors | array | List of errors devided by field in associative array {field_name:error message} |
Request
curl -X GET https://public.brokerstar.biz/api/v3/user/me -d '{ "login": "mat", "email": "mat@wmc.ch", }' --header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJpYXQiOjE2NTg[...]cm5hbWUiOiJkZW1vLWRlIn0.VTVp[...]cqIg'
Response (Success)
200 OK { "message": "Login data changed" }
Response (Error)
400 Bad request { "code": 400, "errors": "Invalid input data", "errors"" { "login": "Login is already in use, please select other login" } }
Or one of
- API: _ Default behavior #Authentication defaults
- API: _ Default behavior #Item *validation
POST /api/v3/user/change-password
Request parameter:
Parameter | Mandatory | In Type | Description |
---|---|---|---|
current_password | yes | string(80) | Current user password |
password | yes | string(80) | New requested user password (min 5 charts) |
Response data:
Metadata: object.
Parameter | Type | Description |
---|---|---|
message | string | Response message |
code | int | Response status code (same as in http code) |
Response (Error):
Parameter | Type | Description |
---|---|---|
code | integer | An error code |
error | string | A message containing some information about the error |
errors | array | List of errors devided by field in associative array {field_name:error message} |
Request
curl -X GET https://public.brokerstar.biz/api/v3/user/change-password -d '{ "current_password": "god", "password": "IL0V3#Secur!tySoIGotSerious6A**word", }' --header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJpYXQiOjE2NTg[...]cm5hbWUiOiJkZW1vLWRlIn0.VTVp[...]cqIg'
Response (Success)
200 OK { "message": "Password changed" }
Response (Error)
401 Unauthorized { "code": 401 "message": "Invalid password" }
Or one of
- API: _ Default behavior #Authentication defaults
- API: _ Default behavior #Item *validation
POST /api/v3/user/reset-password
Request parameter:
Parameter | Mandatory | In Type | Description | Changes |
---|---|---|---|---|
| string(100) | Contact mail address | ||
login | string(5->80) | Contact login | ||
code | no | string(1) | Set Value to "1" if only a code should be send to the user, else ommit this parameter | |
client_url | no | string | Base url for reset password link | |
|
Response data:
Parameter | Type | Description |
---|---|---|
message | string | Response message |
status | int | Response status code (same as in http code) |
Response (Error):
Parameter | Type | Description |
---|---|---|
code | integer | An error code |
error | string | A message containing some information about the error |
errors | array | List of errors devided by field in associative array {field_name:error message} |
Request
curl -X GET https://public.brokerstar.biz/api/v3/user/reset-password -d '{{ "login":"my-user-name" }'
Response (Success)
200 OK { "message": "Password change email was send to contact@my-mail.com", "status": 200 }
Response (Error)
404 Not found { "code": 404 "message": "User with mail/login not found" }
Response (Error)
424 Failed dependency { "code": 424 "message": "Login has no mail set up, will not send email" }
Response (Error)
400 Bad request { "code": 400 "message": "To reset password You need to provide login or mail argument" }
Or one of
- API: _ Default behavior #Item *validation
POST /api/v3/user/confirm-reset-password
Request parameter:
Parameter | Mandatory | In Type | Description |
---|---|---|---|
| string(100) | Contact mail address | |
login | string(5->80) | Contact login | |
code | yes | string(5->80) | Verification code |
password | yes | string | The new user password |
Response data:
Parameter | Type | Description |
---|---|---|
code | int | Response code |
message | string | Response message |
Response (Error):
Parameter | Type | Description |
---|---|---|
code | integer | An error code |
error | string | A message containing some information about the error |
errors | array | List of errors devided by field in associative array {field_name:error message} |
Request
curl -X GET https://public.brokerstar.biz/api/v3/user/confirm-reset-password -d '{{ "login":"my-user-name", "code":"A12-B23C-5E6", "password":"Ch4nge_me!" }'
Response (Success)
200 OK { "code": 200 "message": "Password changed" }
Response (Error)
404 Not found { "code": 404 "message": "User with mail/login not found" }
Response (Error)
400 Bad request { "code": 400 "message": "Incorrect code" }
Response (Error)
400 Bad request { "code": 400 "message": "Expired code (2021-11-12 12:30:11), please re-send email with new code" }
Or one of
- API: _ Default behavior #Item *validation
POST /api/v3/user/register
Request parameter:
Parameter | Mandatory | In Type | Description |
---|---|---|---|
API: Contact : All fields from single contact | |||
name_1 | yes | string(255) | Company name or personal contact first name |
name_2 | yes | string(255) | Company addiction or personal contact last name |
yes | string(100) | Contact mail address | |
contact_type | yes | int(1|2) | Company=1,Personal=2 |
birthday | yes (for contact_type=2) | string(date) | Contact(person) b-day date |
formation_date | no | string(date) | Contact (company) establish date |
login | yes | string(5->80) | Contact login |
password | yes | string(5->80) | Contact password |
invitation_code | no | string(2->40) | If set will try to set an intermediary based on the invitation code.` |
user | no | int | Id of Client Advisor (default 1) |
address | no | string(255) | Contact address |
post_code | no | string(30) | Contact postcode |
city | no | string(50) | Contact city |
mobile | no | string(100) | Contact mobile number |
contact_group | yes | string | String IDs comma separated (ex: "1,2,3") |
country | no | int | Contact country (default 1:Switzerland) |
language | no | int | Contact language (default 1:German) |
Additional setup | |||
_sendMail | no | bool | Default = false, If true - if success maill will be send to contact and to related advisors. |
Response data:
Parameter | Type | Description |
---|---|---|
data | array | Response message |
data[id] | int | Id of created contact |
status | int | Response status code (same as in http code) |
Response (Error):
Parameter | Type | Description |
---|---|---|
code | integer | An error code |
error | string | A message containing some information about the error |
errors | array | List of errors devided by field in associative array {field_name:error message} |
Request
curl -X GET https://public.brokerstar.biz/api/v3/user/register -d '{ "name_1":"Name", "name_2":"Surname", "birthday":"1984-07-07", "contact_type":1, "login": "username", "password": "0j124kas<Asd_)AI", "user": 2 "address":"Baslerstrasse 1", "post_code":"4055", "city":"Basel", "mobile":"077 123 54 86", "mail":"gugus@test.ch", "contact_group":"3,4" }'
Response (Success)
200 OK { "data": { "id": 17685 }, "status": 200 }
Response (Error)
400 Bad Request { "error": "Contact already exist in db", "code": 400 }
Response (Error)
400 Bad Request { "error": "Please select different login name", "code": 400 }