/activate_candidate
/accounts/activate_candidate
Target audience: Developers
Introduction¶
This endpoint activates an account candidate if the supplied parameters can be connected to an existing candidate in the subscription system.
URI¶
Environment | URI |
---|---|
Stage | https://payway-api.stage.adeprimo.se/external/api/v1/account/activate_candidate |
Production | https://backend.worldoftulo.com/external/api/v1/account/activate_candidate |
Requirements¶
Identity | Scope |
---|---|
No | /external/account/w |
Parameters¶
Field | Required | Type | Description |
---|---|---|---|
account_candidate_id | Required | String | The unique id connected to the created account candidate in Get Account Candidate. Size range ..24 Allowed values: "/^[a-f\d]{24}$/i" |
Required | String | The account's e-mail address. Will be used as username for login purposes. This value must be unique. Size range: ..1024 Allowed values: "/\A[\w+-.]+@[a-z\d-]+(.[a-z]+)*.[a-z]+\z/i" |
|
password | Required | String | The account's password. Size range: 6..1024 |
first_name | Optional | String | The account's first name. Size range: ..1024 |
last_name | Optional | String | The account's last name. Size range: ..1024 |
mobile_phone_number | Optional | String | The account's mobile phone number. Size range: 10..12 Allowed values: "/^[+,0]?[0-9]{10,12}$/" |
social_security_number | Optional | String | The account's social security number. This value must be unique. Allowed values: "dddddd-dddd" |
company_registration_number | Optional | String | The account's company registration number. Allowed values: "dddddd-dddd" |
account_origin | Optional | String | The origin of the account. E.g. the newspaper title. Size range: ..1024 |
customer_number | Optional | String | The customer number for the account candidate. If this parameter is used it's value must be the same as the found accound candidate. Size range: ..10 Allowed values: "/^[a-zA-Z-_0-9]+$/" |
birth_date | Optional | String | The account's birth date. Size range: 10..12 Allowed values: "/^+?[0-9]{10,12}$/" |
alias | Optional | String | The account's alias. Size range: ..50 |
marketing_permissions | Optional | String | A comma-separated string with accepted id's for the account. Size range: ..1024 |
Curl Example¶
Minimal¶
1 2 3 4 5 6 7 8 9 10 | curl --request POST \ --url https://payway-api.stage.adeprimo.se/external/api/v1/account/activate_candidate \ --header 'accept: application/json' \ --header 'authorization: Bearer token' \ --header 'content-type: application/json' \ --data '{ "account_candidate_id": "xxxxxxxxxxx", "email": "test@example.com", "password": "Df7Vdd8!!vnM" }' |
Complete¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | curl --request POST \ --url https://payway-api.stage.adeprimo.se/external/api/v1/account/activate_candidate \ --header 'accept: application/json' \ --header 'authorization: Bearer token' \ --header 'content-type: application/json' \ --data '{ "account_candidate_id": "xxxxxxxxxxx", "email": "test@example.com", "password": "Df7Vdd8!!vnM", "first_name": "Ove", "last_name": "Ovesson", "mobile_phone_number": "0701234567", "social_security_number": "620817-9256", "company_registration_number": "556468-3984", "customer_number": "xxxxxx", "account_origin": "ADEPRIMO", "birth_date": "1512311234", "alias": "Oves Alias", "marketing_permissions": "1234567890,0987654321" }' |
Response¶
Field | Description |
---|---|
id | The id of the created account. |
Example Response¶
1 2 3 4 | HTTP 201 Created { "id": "56e1741a6fc9365306000002" } |
Errors¶
Example error response¶
1 2 3 4 5 6 | HTTP 409 Conflict { "code": "already_exists", "field": "customer_number/ssn", "message": "already exists with email" } |
HTTP 400 Bad Request¶
Name | Type | Description |
---|---|---|
invalid_parameter | Object | Validation error on any of the fields in the posted json |
json_parser_error | Object | The request body could not be parsed as valid json |
invalid_content_type_error | Object | The requests Content-Type header isn't set to application/json |
unknown_parameter | Object | One or more of the fields in the posted json was not recognized |
HTTP 404 Not Found¶
Name | Type | Description |
---|---|---|
not_found | Object | The package could not be found |
HTTP 409 Conflict¶
Name | Type | Description |
---|---|---|
already_exists | Object | Indicates that a value that must be unique and already exists have been used. IE a duplicate customer_number or social_security_number. |
HTTP 500 Internal Server Error¶
Name | Type | Description |
---|---|---|
internal_server_error | Object | Something unexpected happened server side |