Skip to main content
Skip table of contents

Playbook: Rest API creation

This article covers the following topics

  • Setting up Rest API

Setting up Rest API

IIS for at finde Rest API til at kunne lokalisere JSON filen. I dette tilfælde C:\Deployment\Link\Link.RestApi - hvis den er sat op i forvejen på et andet miljø

Open up ‘Manage computer certificates’ and expand ‘Personal’ and click on 'Certificates'

If a Rest API isn’t set up on another environment, it has to be filled out manually. The JSON file is located in C:\Deployment\Link\Link.RestApi normally. If it’s already created on another environment, you can copy the JSON file and edit it to fit the new environment.

From: Configuring Api security - use: New-SelfSignedCertificate -Subject "WEBSITENAMEGOESHERE" -KeySpec Signature -KeyAlgorithm RSA -KeyLength 2048 -HashAlgorithm SHA256 -CertStoreLocation 'cert:\LocalMachine\My' -NotBefore $(Get-Date) -NotAfter $((Get-Date).AddYears(10)) where WEBSITENAMEGOESHERE must reflect the new environment.

This will create the certificate used for Rest API. Refresh ‘Manage computer certificates’ that was opened earlier.

Double click on the cerfiticate and go to ‘Details'. We need the ‘Thumbprint’. Copy that

Insert this in the JSON file at "signingCertificateThumbprint" and "secondarySigningCertificateThumbprint"

Now we need to install the Rest API site in Link

Go to C:\Deployment\Link\Link.RestApi\2.12.8110.36718 and run the .bat file. Use ‘Run as admin’

It will ask for a password. The password you need is for the service user which can be found in the json file. Info is probably in KeePass. Log in with your adm- account if you cannot find the relevant user info in KeePass

No need to check the log file when it’s done. Hit any key other than 'Y'

Go back to IIS

Refresh ‘Sites’ and click on the newly created api-link. Click on ‘Browse api-link.XXX.XXX on *:80’. If it doesn’t work, we will create a localhost to check if that works

Click ‘Bindings…’ and click ‘Add’

Add a * to Host name and remove it again. Change Port to 8081 and click ‘OK’

Close

Click on ‘Browse *:8081 (http)’ on the right side, the one you just created. It should show this:

If it does, it means that the api-link needs to have a DNS created which most likely is at the customer.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.