Authentication - Link
This endpoint can be used to retrieve a unique URL which enables the end-user to login to GoedGeplaatst without the need to enter their credentials.
Reference
POST /auth/link/generate/
Generate a unique authentication-link. All previous links will be revoked.
The link will expire after 10 minutes and/or after it has been clicked on.
POST /auth/link/validate/
Validates an access token in order to (dis)-allow a user to login to GoedGeplaatst without supplying credentials.
Fields
| field | type | constraints | Req | W | U |
|---|---|---|---|---|---|
| userId | int | The userId | Yes | No | No |
| accesstoken | string | The access token | Yes | No | No |
| validUntil | datetime | Expiration-date of the authentication-link. | No | No | No |
| url | string | The complete URL containing the access token to use for authentication | No | No | No |
| ip | string | Max 39 charactersIP of the end-user for logging purposes | No | No | No |
Example Generating Authentication Link
Request
POST /rest/v1/auth/link/generate HTTP/2
{
"userId": 12311
}
Response
{
"result": true,
"errors": [],
"data": {
"userId": 12311,
"accesstoken": "0..d9",
"validUntil": "2021-07-15 13:13:06",
"url": "http://www.goedgeplaatst.local/authlink/?userId=12311&accesstoken=0..d9"
}
}
Example Validating Authentication Link
Request
POST /rest/v1/auth/link/validate HTTP/2
{
"userId": 12311,
"accesstoken": "0..d9",
}
Response
{
"result": true,
"errors": [],
"data": {
"user": {
"userId": 12311,
"clientId": 0,
"externalUserId": 0,
"contacts": {
"numberOfContacts": 8,
"numberOfActiveContacts": 0,
"contacts": [
{
"userId": 12311,
"contactId": 0,
"active": false,
"name": "",
"address": "",
"houseNumber": "",
"postalCode": "1.....J",
"city": "t..t",
"county": "DR",
"country": "NL",
"phone": "",
"website": null,
"skype": ""
},
{
"userId": 12311,
"contactId": 1,
"active": false,
"name": "Be........am",
"address": "S........m",
"houseNumber": "",
"postalCode": "2.....A",
"city": "Z........r",
"county": "ZH",
"country": "NL",
"phone": "07.......67",
"website": "www.t....nl",
"skype": ""
},
{
"userId": 12311,
"contactId": 2,
"active": false,
"name": "Be........am",
"address": "S........m",
"houseNumber": "",
"postalCode": "2.....A",
"city": "Z........r",
"county": "ZH",
"country": "NL",
"phone": "07.......67",
"website": "www.t....nl",
"skype": ""
},
{
"userId": 12311,
"contactId": 3,
"active": false,
"name": "Be........am",
"address": "S........m",
"houseNumber": "",
"postalCode": "2.....A",
"city": "Z........r",
"county": "ZH",
"country": "NL",
"phone": "07.......67",
"website": "www.t....nl",
"skype": ""
},
{
"userId": 12311,
"contactId": 4,
"active": false,
"name": "Be........am",
"address": "S........m",
"houseNumber": "",
"postalCode": "2.....A",
"city": "Z........r",
"county": "ZH",
"country": "NL",
"phone": "07.......67",
"website": "www.t....nl",
"skype": ""
},
{
"userId": 12311,
"contactId": 5,
"active": false,
"name": "Be........am",
"address": "S........m",
"houseNumber": "",
"postalCode": "2.....A",
"city": "Z........r",
"county": "ZH",
"country": "NL",
"phone": "07.......67",
"website": "www.t....nl",
"skype": ""
},
{
"userId": 12311,
"contactId": 6,
"active": false,
"name": "Be........am",
"address": "S........m",
"houseNumber": "",
"postalCode": "2.....A",
"city": "Z........r",
"county": "ZH",
"country": "NL",
"phone": "07.......67",
"website": "www.t....nl",
"skype": ""
},
{
"userId": 12311,
"contactId": 7,
"active": false,
"name": "Be........am",
"address": "S........m",
"houseNumber": "",
"postalCode": "2.....A",
"city": "Z........r",
"county": "ZH",
"country": "NL",
"phone": "07.......67",
"website": "www.t....nl",
"skype": ""
}
]
},
"companyName": "In.........................BV",
"firstName": "",
"lastName": "B.....r",
"gender": "",
"dateOfBirth": "",
"address": "K.......s",
"houseNumber": "",
"postalCode": "1.....J",
"city": "B.................k",
"county": "NH",
"country": "NL",
"email": "hb...........nl",
"website": "www.i...nl",
"phone": "02.......00",
"fax": "",
"cellular": "",
"subscriptions": {
"stock": true,
"shop": false
}
},
"settings": {
"userId": 12311,
"mainUserId": 0,
"walletUserId": 0,
"maxContacts": 14,
"status": "active",
"type": "supply",
"allowbids": true,
"showcontact": true,
"itemsPerPage": 25,
"groupId": 40,
"categoryId": 1538,
"attributes": [
{
"key": "condition",
"value": "nieuw"
},
{
"key": "delivery",
"value": "ophalen of verzenden"
}
],
"budgetNotifyLimit": 5000
}
}
}
or
{
"result": false,
"errors": [
"accesstoken has been revoked"
],
"data": []
}