kustomer-client
    Preparing search index...

    Function createMedia

    • Create media Creates a new media upload document. This includes a temporary upload policy to allow a file upload through a POST request.

      Media uploads require a mutli-part POST request to the URL in the meta.upload.url property in the response object:

      • The request must include as standard form keys the key-value pairs located in the meta.upload.fields property.
      • The request must include the file as the last key under the name file.

      The following file name extensions are blocked and cannot be used as attachments:

      • .bin
      • .bat
      • .chm
      • .com
      • .cpl
      • .crt
      • .exe
      • .hlp
      • .hta
      • .inf
      • .ins
      • .isp
      • .jse
      • .lnk
      • .mdb
      • .msc
      • .msi
      • .msp
      • .mst
      • .pcd
      • .pif
      • .ps1
      • .reg
      • .scr
      • .sct
      • .shs
      • .vbe
      • .vba
      • .vbs
      • .wsf
      • .wsh
      • .wsl

      Type Parameters

      • ThrowOnError extends boolean = true

      Parameters

      Returns RequestResult<
          {
              data: {
                  attributes: {
                      contentLength: number;
                      contentType: string;
                      context: string;
                      createdAt: string;
                      name: string;
                      redacted: boolean;
                      updatedAt: string;
                      uploaded: boolean;
                  };
                  id: string;
                  links: { self: string };
                  relationships: {
                      org: { data: { id: string; type: string }; links: { self: string } };
                  };
                  type: string;
              };
              meta: {
                  provider: string;
                  upload: {
                      fields: {
                          acl: string;
                          bucket: string;
                          "Content-Type": string;
                          key: string;
                          Policy: string;
                          "X-Amz-Algorithm": string;
                          "X-Amz-Credential": string;
                          "X-Amz-Date": string;
                          "X-Amz-Meta-Attachment-Id": string;
                          "X-Amz-Signature": string;
                      };
                      url: string;
                  };
              };
          },
          unknown,
          ThrowOnError,
      >