Skip to content

Latest commit

 

History

History
209 lines (150 loc) · 34.4 KB

README.md

File metadata and controls

209 lines (150 loc) · 34.4 KB

Files

(files())

Overview

Available Operations

  • upload - Upload a file and link it to the specified Moov account.

The maximum file size is 20MB. Each account is allowed a maximum of 50 files. Acceptable file types include csv, jpg, pdf, and png.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/files.write scope.

  • list - List all the files associated with a particular Moov account.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/files.read scope.

  • get - Retrieve file details associated with a specific Moov account.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/files.read scope.

upload

Upload a file and link it to the specified Moov account.

The maximum file size is 20MB. Each account is allowed a maximum of 50 files. Acceptable file types include csv, jpg, pdf, and png.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/files.write scope.

Example Usage

package hello.world;

import io.moov.sdk.Moov;
import io.moov.sdk.models.components.*;
import io.moov.sdk.models.errors.FileValidationError;
import io.moov.sdk.models.errors.GenericError;
import io.moov.sdk.models.operations.UploadFileResponse;
import java.lang.Exception;
import java.nio.charset.StandardCharsets;

public class Application {

    public static void main(String[] args) throws GenericError, FileValidationError, Exception {

        Moov sdk = Moov.builder()
                .security(Security.builder()
                    .username("")
                    .password("")
                    .build())
            .build();

        UploadFileResponse res = sdk.files().upload()
                .accountID("10a2b98a-ab61-4ec6-a5fc-41d969747bc6")
                .fileUploadRequestMultiPart(FileUploadRequestMultiPart.builder()
                    .file(FileUploadRequestMultiPartFile.builder()
                        .fileName("example.file")
                        .content("0x8cc9e675ad".getBytes(StandardCharsets.UTF_8))
                        .build())
                    .filePurpose(FilePurpose.REPRESENTATIVE_VERIFICATION)
                    .metadata("{\"requirement_id\": \"document.individual.verification\"}")
                    .build())
                .call();

        if (res.fileDetails().isPresent()) {
            // handle response
        }
    }
}

Parameters

Parameter Type Required Description
xMoovVersion Optional<String> Specify an API version.

API versioning follows the format vYYYY.QQ.BB, where
- YYYY is the year
- QQ is the two-digit month for the first month of the quarter (e.g., 01, 04, 07, 10)
- BB is the build number, starting at .01, for subsequent builds in the same quarter.
- For example, v2024.01.00 is the initial release of the first quarter of 2024.

The latest version represents the most recent development state. It may include breaking changes and should be treated as a beta release.
accountID String ✔️ N/A
fileUploadRequestMultiPart FileUploadRequestMultiPart ✔️ N/A

Response

UploadFileResponse

Errors

Error Type Status Code Content Type
models/errors/GenericError 400, 409 application/json
models/errors/FileValidationError 422 application/json
models/errors/APIException 4XX, 5XX */*

list

List all the files associated with a particular Moov account.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/files.read scope.

Example Usage

package hello.world;

import io.moov.sdk.Moov;
import io.moov.sdk.models.components.Security;
import io.moov.sdk.models.operations.ListFilesResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Exception {

        Moov sdk = Moov.builder()
                .security(Security.builder()
                    .username("")
                    .password("")
                    .build())
            .build();

        ListFilesResponse res = sdk.files().list()
                .accountID("c8a232aa-0b11-4b8a-b005-71e9e705d0e6")
                .call();

        if (res.fileDetails().isPresent()) {
            // handle response
        }
    }
}

Parameters

Parameter Type Required Description
xMoovVersion Optional<String> Specify an API version.

API versioning follows the format vYYYY.QQ.BB, where
- YYYY is the year
- QQ is the two-digit month for the first month of the quarter (e.g., 01, 04, 07, 10)
- BB is the build number, starting at .01, for subsequent builds in the same quarter.
- For example, v2024.01.00 is the initial release of the first quarter of 2024.

The latest version represents the most recent development state. It may include breaking changes and should be treated as a beta release.
accountID String ✔️ N/A

Response

ListFilesResponse

Errors

Error Type Status Code Content Type
models/errors/APIException 4XX, 5XX */*

get

Retrieve file details associated with a specific Moov account.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/files.read scope.

Example Usage

package hello.world;

import io.moov.sdk.Moov;
import io.moov.sdk.models.components.Security;
import io.moov.sdk.models.operations.GetFileDetailsResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Exception {

        Moov sdk = Moov.builder()
                .security(Security.builder()
                    .username("")
                    .password("")
                    .build())
            .build();

        GetFileDetailsResponse res = sdk.files().get()
                .accountID("b888f774-3e7c-4135-a18c-6b985523c4bc")
                .fileID("e50f7622-81da-484b-9c66-1c8a99c6b71b")
                .call();

        if (res.fileDetails().isPresent()) {
            // handle response
        }
    }
}

Parameters

Parameter Type Required Description
xMoovVersion Optional<String> Specify an API version.

API versioning follows the format vYYYY.QQ.BB, where
- YYYY is the year
- QQ is the two-digit month for the first month of the quarter (e.g., 01, 04, 07, 10)
- BB is the build number, starting at .01, for subsequent builds in the same quarter.
- For example, v2024.01.00 is the initial release of the first quarter of 2024.

The latest version represents the most recent development state. It may include breaking changes and should be treated as a beta release.
accountID String ✔️ N/A
fileID String ✔️ N/A

Response

GetFileDetailsResponse

Errors

Error Type Status Code Content Type
models/errors/APIException 4XX, 5XX */*