Restore an archived site
const url = 'https://api2.recruso.co.uk/v1/clients/1/sites/1/restore';const options = { method: 'POST', headers: {Authorization: '<Authorization>', 'Content-Type': 'application/json'}, body: '{"clientId":137,"id":512}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api2.recruso.co.uk/v1/clients/1/sites/1/restore \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: application/json' \ --data '{ "clientId": 137, "id": 512 }'Restores a site that was archived with DeleteSite, returning it to the client’s active sites with its address and history intact.
Only an archived site can be restored. An active site id, a site belonging to another client, and a site from another agency all return 404.
If the client has since gained an active site with the same name, the restore returns 400 — rename the active site first, because two active sites of one client cannot share a name.
The request body is empty; the client and site come from the route. On success the restored site is returned.
Access. Requires a client-credentials access token. Tokens issued through the interactive user login are rejected.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The clientId path parameter
The id path parameter
Request Bodyrequired
Section titled “Request Bodyrequired”Identifies the site to restore. Both values come from the route; the body is empty.
object
The client this site belongs to.
Example
137The site to restore. Taken from the route.
Example
512Responses
Section titled “Responses”OK
A site as it stands after being restored.
object
The site’s unique identifier, assigned by Recruso.
The client this site belongs to.
The site’s name. Required, up to 70 characters, and unique among the client’s active sites.
Free-text notes about the site. Up to 550 characters.
First line of the site address. Up to 150 characters.
Second line of the site address. Up to 50 characters.
Town or city of the site address.
County of the site address.
Country of the site address.
Postcode of the site address.
The site’s main telephone number.
A second telephone number for the site.
The site’s fax number.
The site’s main email address.
How invoices for this site are delivered, as an id from the invoice methods vocabulary.
Whether invoices for this site use the site address rather than the client’s invoice address.
Whether invoices for this site are sent to the site email rather than the client’s invoice email.
The branch this site is managed under.
The address timesheets for this site are sent to.
Example
{ "siteId": 512, "clientId": 137, "siteName": "Trafford Park DC", "memo": "Gatehouse sign-in required; ask for the shift supervisor.", "address1": "Northgate House", "address2": "22 Ashburton Road West", "town": "Trafford Park", "county": "Greater Manchester", "country": "United Kingdom", "postCode": "M17 1RU", "telephone1": "0161 872 4410", "telephone2": "0161 872 4411", "fax": "0161 872 4412", "email": "trafford@example-northgate.co.uk", "invoiceMethodId": 1, "useSiteAddressForInvoice": true, "useSiteEmailForInvoice": false, "branchId": 4, "timesheetEmail": "timesheets@example-northgate.co.uk"}Bad Request
object
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}Unauthorized
object
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}Forbidden
object
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}Not Found
object
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}
