MithiDocs

VaultasticActiveStoreMailUpload API

About this API

VaultasticActiveStoreMailUpload API is used to upload mails with varying sizes, faster uploads, and processing. It is a two-part call to upload mail to VaultasticActiveStoreMailUpload API.

Resources

To build an SDK using the API in a language of your choice refer to this document

Calling the APIs

1. Send the initial request to get a pre-signed URL:

To initiate an upload, use https://vaultasticactivestoremailuploadapi.vaultastic.com URL with the POST method.

Create a POST request to the upload URI:

Method:

            POST https://vaultasticactivestoremailuploadapi.vaultastic.com

Headers:

            1. x-api-key: <Api Key provided>

            2. User-Agent: <SDK Version>

Success Response:

         If the initiation request succeeds, the response includes a 200 OK HTTP status code.

         In addition, it includes an Pre-Signed URL and fields in the JSON response data:

        {

            "url": "https://ind1-mithi-vv4-dc1-api-temp-mailstorage-s3.s3.amazonaws.com/",

            "fields": {

                "key": "w38q5qwhgj/2021/02/02/11/2971ddb3-1058-4af9-ba9d-c925e51afca7.eml",

                "x-amz-algorithm": "AWS4-HMAC-SHA256",

                "x-amz-credential": "ASIAUFC44OICB6OIONNC/20210202/ap-south-1/s3/aws4_request",

                "x-amz-date": "20210202T112803Z",

                "x-amz-security-token": "IQoJb3JpZ2luX2VjEOv//////////wEaCmFwLXNvdXRoLTEiSDBGAiEAo6Vt4YvJBO4T90tZL9Z8yXSIASgbNPV5Gr4jWxCWxgACIQCclEkEEREHrMDGbbvpQZ2dX4jyl4StVQdq/6ImmUGJxyr3AQjU//////////8BEAAaDDI4NTgxMDEyNzM2NCIMCww6OI2v6F0v8SqXKssBepPo/AbxdGtF3H5i0SPS1WxnJO217VfzZaSC8ewN61vEvs1rh6qOvVkAthlU1gWqObSYKHRq2XsVy+/Qhrv6wY/o8Ln24gnukstsBLdxHYIAdJAgNYj21R3HYRvmhTqyMrKrXcjo1MpMPMFrx1lvhVWqhyoSQn1pjT68tn+ezaNLBMNCvn8NwvTbj++pTUnunnk54tQ3rdIF9Fwzp+xNka5bOtx+CA5qDAtaqm62vYTHH41CvtBgnZOhSUhkdTgL2spHpz53Jvk/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k5DSU1Dd3c2T0kydjZGMHY4U3FYS3NzQmVwUG8vQWJ4ZEd0RjNINWkwU1BTMVd4bkpPMjE3VmZ6WmFTQzhld042MXZFdnMxcmg2cU92VmtBdGhsVTFnV3FPYlNZS0hScTJYc1Z5Ky9RaHJ2NndZL284TG4yNGdudWtzdHNCTGR4SFlJQWRKQWdOWWoyMVIzSFlSdm1oVHF5TXJLclhjam8xTXBNUE1GcngxbHZoVldxaHlvU1FuMXBqVDY4dG4rZXphTkxCTU5Ddm44Tnd2VGJqKytwVFVudW5uazU0dFEzcmRJRjlGd3pwK3hOa2E1Yk90eCtDQTVxREF0YXFtNjJ2WVRISDQxQ3Z0QmduWk9oU1Voa2RUZ0wyc3BIcHo1M0p2ay9Va0l3anR2a2dBWTYzd0d5emJUMU55d3FaZlFEbEZkWml2bHNCMUJCQmJRd0JGSkRBZWNZWHlIZlh5WGpQZTQzdkhmaEExNWExdy83MHhWVXMwQWorUFB2QTBwTG84UkJoU3VCM29FeDRhTXVEWGx1SXFLcHVtOWgvZ2JqbGRka3VqRE0vYXZEUHhOYWJDVFJGeWJncUI0aytvZ0hkQUdOOUVPczJaUjBrZjBiam5WQ0RweFVpY0luY1IzUkhUbG5NazVFekJIUzVxSXdoOTZTYjJMWVFmVUZoVFhvSm5tZURMSCtGZTdoMTN0UVpZczZZVFJPMTBWYkg1VE53dTZ4MEVnU3ptb2RZV1doZHdDamhjSncvOThFS2ZIVWYzWjFJYThabFBXL0YxR1pmYmQ2bGFHcGFuRTkifV19",

                "x-amz-signature": "cf60309b5a07cf78ff6c15f54d34e1ca6a4631773d13a97699c5fb8e1659fde7"

            }
        }

You should save the Pre-Signed URL so you can upload the file data. A Pre-Signed URL expires after 5 Minutes.

Error Response:

            If the required header of x-api-key is not provided:

                HTTP Status : 403

                {

                    "message": "Forbidden"

                }

2. Second request to upload the content:

 Create a processed mail using VaultasticActiveStoreMailUpload API-SDK and upload to Pre-Signed URL from Initial Request.

  Create a POST request to the Pre-Signed URL:

  Method:

            POST <pre-signed URL from response of Initial Request>

  Payload:

            Create a payload of type form-data with keys and value extracted from Response JSON "fields" from Initial Request and append another key file with processed mail as value.

            Example:

               "key": "w38q5qwhgj/2021/02/02/11/2971ddb3-1058-4af9-ba9d-c925e51afca7.eml",

                "x-amz-algorithm": "AWS4-HMAC-SHA256",

                "x-amz-credential": "ASIAUFC44OICB6OIONNC/20210202/ap-south-1/s3/aws4_request",

                "x-amz-date": "20210202T112803Z",

                "x-amz-security-token": "IQoJb3JpZ2luX2VjEOv//////////wEaCmFwLXNvdXRoLTEiSDBGAiEAo6Vt4YvJBO4T90tZL9Z8yXSIASgbNPV5Gr4jWxCWxgACIQCclEkEEREHrMDGbbvpQZ2dX4jyl4StVQdq/6ImmUGJxyr3AQjU//////////8BEAAaDDI4NTgxMDEyNzM2NCIMCww6OI2v6F0v8SqXKssBepPo/AbxdGtF3H5i0SPS1WxnJO217VfzZaSC8ewN61vEvs1rh6qOvVkAthlU1gWqObSYKHRq2XsVy+/Qhrv6wY/o8Ln24gnukstsBLdxHYIAdJAgNYj21R3HYRvmhTqyMrKrXcjo1MpMPMFrx1lvhVWqhyoSQn1pjT68tn+ezaNLBMNCvn8NwvTbj++pTUnunnk54tQ3rdIF9Fwzp+xNka5bOtx+CA5qDAtaqm62vYTHH41CvtBgnZOhSUhkdTgL2spHpz53Jvk/UkIwjtvkgAY63wGyzbT1NywqZfQDlFdZivlsB1BBBbQwBFJDAecYXyHfXyXjPe43vHfhA15a1w/70xVUs0Aj+PPvA0pLo8RBhSuB3oEx4aMuDXluIqKpum9h/gbjlddkujDM/avDPxNabCTRFybgqB4k+ogHdAGN9EOs2ZR0kf0bjnVCDpxUicIncR3RHTlnMk5EzBHS5qIwh96Sb2LYQfUFhTXoJnmeDLH+Fe7h13tQZYs6YTRO10VbH5TNwu6x0EgSzmodYWWhdwCjhcJw/98EKfHUf3Z1Ia8ZlPW/F1GZfbd6laGpanE9",

                "policy": "eyJleHBpcmF0aW9uIjogIjIwMjE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J2WVRISDQxQ3Z0QmduWk9oU1Voa2RUZ0wyc3BIcHo1M0p2ay9Va0l3anR2a2dBWTYzd0d5emJUMU55d3FaZlFEbEZkWml2bHNCMUJCQmJRd0JGSkRBZWNZWHlIZlh5WGpQZTQzdkhmaEExNWExdy83MHhWVXMwQWorUFB2QTBwTG84UkJoU3VCM29FeDRhTXVEWGx1SXFLcHVtOWgvZ2JqbGRka3VqRE0vYXZEUHhOYWJDVFJGeWJncUI0aytvZ0hkQUdOOUVPczJaUjBrZjBiam5WQ0RweFVpY0luY1IzUkhUbG5NazVFekJIUzVxSXdoOTZTYjJMWVFmVUZoVFhvSm5tZURMSCtGZTdoMTN0UVpZczZZVFJPMTBWYkg1VE53dTZ4MEVnU3ptb2RZV1doZHdDamhjSncvOThFS2ZIVWYzWjFJYThabFBXL0YxR1pmYmQ2bGFHcGFuRTkifV19",

                "x-amz-signature": "cf60309b5a07cf78ff6c15f54d34e1ca6a4631773d13a97699c5fb8e1659fde7"

                "file": "<Processed mail as String>"

  Success Response:

            If the upload request succeeds, the response includes a 204 No Content HTTP status code.

  Error Response:

            If the request is made past 5 minutes.

    HTTP Status : 400

           <?xml version="1.0" encoding="UTF-8"?>

   <Error>

         <Code>AccessDenied</Code>

         <Message>Invalid according to Policy: Policy expired.</Message>

         <RequestId>B3321ECB582BF425</RequestId>

         <HostId>WDU/zq1OqkcX9ry/AE4rG89u02Q0tq/C9roZq+o7ZdVrKqvDJCyC2v0Yn8PNf7YYrbqkVUg1sG0=</HostId>
  </Error>