To save a drawing as a .pdf file, run the following requests:
-
Get the SP_ID of the required drawing.
-
Get the unique identifier (Id value) of the drawing's PDF file by retrieving the file Uri. This request requires the drawing's SP_ID value as part of the input.
-
Download the drawing file to save the drawing as a .pdf file. This request requires the PDF file's unique identifier and file name as part of the input.
Get drawing's SP_ID
The SP_ID value and the drawing name DEMO_01 in the requests below are examples only. You can select a different drawing to retrieve.
-
Launch Postman.
-
To view all the available drawings in the plant, select the request 08.01 Get drawings and click Send.
GET
https://apiservername.domain.com/WebApi/SPID/V2/Sites('WEBAPISITE001')/Plants('PLANT001')/
Drawings/Com.Ingr.SPID.V2.WEBAPISITE001.PLANT001.Drawing/?$select=SP_ID,Name$count=trueA typical response appears as follows:
If you already know the name of the specific drawing you want to save as a .pdf file, select the request 08.02 Get specific drawing, enter the drawing name, and click Send.
GET
https://apiservername.domain.com/WebApi/SPID/V2/Sites('WEBAPISITE001')/Plants('PLANT001')/
Drawings/Com.Ingr.SPID.V2.WEBAPISITE001.PLANT001.Drawing/?$select=SP_ID,Name&$filter=Name eq 'DEMO_01' -
From the response, copy the drawing's SP_ID value.
Retrieve file unique identifier
-
Select the request 08.03 Retrieve file URI and paste the SP_ID value and the file name you obtained from the previous request's response into the syntax shown below.
POST
https://apiservername.domain.com/WebApi/SPID/V2/Sites('WEBAPISITE001')/Plants('PLANT001')/
Drawings('75A7E51BA85C40E8873708323B74FA7E')/Files('DEMO_01.pdf')/
Com.Ingr.Core.V1.RetrieveFileUri/In the request, the file name must include the .pdf file extension.
-
Click Send.
-
From the response, copy the PDF file's unique identifier (Id value).
Download drawing file
-
Select the request 08.08 Get file result.
-
For the Files parameter, paste the string obtained for the PDF file's FileId value (file name) from the response to the request 08.03 Retrieve file URI.
-
For the resultId parameter, paste the string obtained for the PDF file's unique identifier (Id value) from the response to the request 08.03 Retrieve file URI.
-
Click Send and Download.
The value of the string shown below is an example only.
GET
https://apiservername.domain.com/WebApi/SPID/V2/Sites('WEBAPISITE001')/Plants('PLANT001')/
Drawings('75A7E51BA85C40E8873708323B74FA7E')/Files('DEMO_01.pdf')/
Com.Ingr.Core.V1.GetRetrieveFileUriResultAsync(resultId='e96cb6aa-4622-4bcd-80e8-689b777ce97d') -
Save the file to the required location with the name of your choice, including a .pdf extension.