Skip to main content

Attachments-v1 1.0.0

Helper

1. Authenticate

Text (formatted, long)

Prerequisites


  1. You should have registered in our developer portal. Check this link about how to register an Account.
  2. You should request access to the playground, sandbox and production environment using our Support page. Here is the link to support page to request access to our environments.
  3. You should have an App created in your account to get the client id and client secret. Check this link about how to create an App.

Note : The time data attribute on APIs follows a 24-hour clock starting at 00:00 and ending at 23:59.

 

Authentication


The bearer token obtained after successful authentication should be passed as credential when calling this API for authentication. Check the Access Token API link for instructions on how to generate your bearer token.

 

 

Read the Get Started documentation if you are unaware of your client credentials.

 

2. Get Information

Text (formatted, long)

Get Account Information


Master account Id and account Id need to be passed in the header for this API call. This is needed to indicate your legal entity.
Refer to the Accounts API for instructions on how to retrieve your account information. You may skip this step if you already know your master account Id and account Id.

3. Add Attachments

Add Attachments


The method can be used to upload an attachment to an existing work order. Multiple attachments can be uploaded to a work order as long as the status of the order is not closed or cancelled.

Method POST
End point /v1/attachments
Headers Authorization, Master-Account-Id, Account-Id
Query Parameters requestId, file_name
Body file

 

Sample Curl Request

curl --location --request POST 'https://api.digitalrealty.com/v1/attachments?requestId=<ticketId>&file_name=report.pdf' \
--header 'Master-Account-Id: <Master-Account-Id>' \
--header 'Account-Id: <Account-Id>' \
--header 'Authorization: Bearer <access_token>' \
--form 'file="report.pdf"'

 

Headers

Field Name Mandatory Type Description
Master-Account-Id true string Customer master account identifier.
Account-Id true string Customer account identifier.
Authorization true string Token-based authentication.

 

Query Parameters

Field Name Mandatory Type Description
requestId true string(20) Identifier of the service ticket.
file_name true string(100) Name of the attachment file.

 

Body

Field Name Mandatory Type Description
file true string($binary) The file to be attached.

Sample Request Body for uploading an attachment.

sample request body for attchmenst

Sample JSON Response

{
    "id": "1dd5a60d8721b1d07dc5cbf6cebb3500",
    "contentType": "multipart/form-data",
    "filename": "img7871.pdf",
    "hash": "824977b89493f306f14de4b325b3aa0778689032f6c9c2487535cd6741757dd2",
    "createdBy": "fsl_test17082023 Testing17082023",
    "createdOn": "2023-09-26 12:29:09",
    "ticketId": "WO9271561"
}

 

Payload Description

Field Name Type Description
id string(32) Identifier of the attachment.
contentType string(enum) Indicates the request body format.

value: [multipart/form-data]
filename string(100) Name of the attachment file.
hash string(64) Hash code of the file.
createdBy string(40) Designates the user that initially generated the attachment.
createdOn string(date-time) Date on which the attachment was generated.

format: [yyyy-MM-dd HH:mm:ss] timezone: [UTC]
ticketId string(20) Identifier of the work order.

4. Retrieve Attachments

Retrieve Attachments


The method can be used to retrieve all attachments that are uploaded to a specific work order. 

 Method GET
End point /v1/attachments/{ticketId}
Headers Authorization, Master-Account-Id, Account-Id
Query Parameters n/a
Body n/a

 

Sample Curl Request

curl --location --request GET 'https://api.digitalrealty.com/v1/attachments/<ticketId>' \
--header 'Master-Account-Id: <Master-Account-Id>' \
--header 'Account-Id: <Account-Id>' \
--header 'Authorization: Bearer <access_token>'

 

Headers

Field Name Mandatory Type Description
Master-Account-Id true string Customer master account identifier.
Account-Id true string Customer account identifier.
Authorization true string Token-based authentication.

 

Query Parameters

n/a

Body

n/a

Sample JSON Response

[
    {
        "id": "7b1f9e0d87e1f510b4c999f73cbb35f7",
        "contentType": "multipart/form-data",
        "filename": "GP-3602.PNG",
        "hash": "54d6530912c6a818b6d14f192a4df7332b5a573cc310a108f6078676dcdab452",
        "createdBy": "fsl_test17082023 Testing17082023",
        "createdOn": "2023-09-26 11:59:51"
    }
]

 

Payload Description

Field Name Type Description
id string(32) Identifier of the attachment.
contentType  string(enum) Indicates the request body format.

value: [multipart/form-data]
filename string(100) Name of the attachment file.
hash string(64) Hash code of the file.
createdBy string(40) Designates the user that initially generated the attachment.
createdOn string(date-time) Date on which the attachment was generated.

format: [yyyy-MM-dd HH:mm:ss] timezone: [UTC]

Download a File


The method can be used to download the file that is attached to a specific work order.  

 Method GET
End point /v1/attachments/{ticketId}/file/{id}
Headers Authorization, Master-Account-Id, Account-Id
Query Parameters n/a
Body n/a

 

Sample Curl Request

curl --location --request GET 'https://api.digitalrealty.com/v1/attachments/<ticketId>/file/<id>' \
--header 'Master-Account-Id: <Master-Account-Id>' \
--header 'Account-Id: <Account-Id>' \
--header 'Authorization: Bearer <access_token>'

 

Headers

Field Name Mandatory Type Description
Master-Account-Id true string Customer master account identifier.
Account-Id true string Customer account identifier.
Authorization true string Token-based authentication.

 

Query Parameters

n/a

Body

n/a

Sample JSON Response

string($binary)

 

Payload Description

Field Name Type Description
n/a string($binary) The binary of the attached file.

Response Codes

Text (formatted, long)

Please check the Response Codes overview in case of any issues.


Need Help?

Have not found what you are looking for, please do not hesitate to reach out to us!

globe