(accounting().attachments())
- list - List Attachments
- get - Get Attachment
- delete - Delete Attachment
- download - Download Attachment
List Attachments
package hello.world;
import com.apideck.unify.Apideck;
import com.apideck.unify.models.components.AttachmentReferenceType;
import com.apideck.unify.models.errors.BadRequestResponse;
import com.apideck.unify.models.errors.NotFoundResponse;
import com.apideck.unify.models.errors.PaymentRequiredResponse;
import com.apideck.unify.models.errors.UnauthorizedResponse;
import com.apideck.unify.models.errors.UnprocessableResponse;
import com.apideck.unify.models.operations.AccountingAttachmentsAllRequest;
import com.apideck.unify.models.operations.AccountingAttachmentsAllResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws BadRequestResponse, UnauthorizedResponse, PaymentRequiredResponse, NotFoundResponse, UnprocessableResponse, Exception {
Apideck sdk = Apideck.builder()
.apiKey("<YOUR_API_KEY_HERE>")
.consumerId("test-consumer")
.appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
.build();
AccountingAttachmentsAllRequest req = AccountingAttachmentsAllRequest.builder()
.referenceType(AttachmentReferenceType.INVOICE)
.referenceId("12345")
.serviceId("salesforce")
.fields("id,updated_at")
.build();
AccountingAttachmentsAllResponse res = sdk.accounting().attachments().list()
.request(req)
.call();
if (res.getAttachmentsResponse().isPresent()) {
// handle response
}
}
}
Parameter | Type | Required | Description |
---|---|---|---|
request |
AccountingAttachmentsAllRequest | ✔️ | The request object to use for the request. |
AccountingAttachmentsAllResponse
Error Type | Status Code | Content Type |
---|---|---|
models/errors/BadRequestResponse | 400 | application/json |
models/errors/UnauthorizedResponse | 401 | application/json |
models/errors/PaymentRequiredResponse | 402 | application/json |
models/errors/NotFoundResponse | 404 | application/json |
models/errors/UnprocessableResponse | 422 | application/json |
models/errors/APIException | 4XX, 5XX | */* |
Get Attachment
package hello.world;
import com.apideck.unify.Apideck;
import com.apideck.unify.models.components.AttachmentReferenceType;
import com.apideck.unify.models.errors.BadRequestResponse;
import com.apideck.unify.models.errors.NotFoundResponse;
import com.apideck.unify.models.errors.PaymentRequiredResponse;
import com.apideck.unify.models.errors.UnauthorizedResponse;
import com.apideck.unify.models.errors.UnprocessableResponse;
import com.apideck.unify.models.operations.AccountingAttachmentsOneRequest;
import com.apideck.unify.models.operations.AccountingAttachmentsOneResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws BadRequestResponse, UnauthorizedResponse, PaymentRequiredResponse, NotFoundResponse, UnprocessableResponse, Exception {
Apideck sdk = Apideck.builder()
.apiKey("<YOUR_API_KEY_HERE>")
.consumerId("test-consumer")
.appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
.build();
AccountingAttachmentsOneRequest req = AccountingAttachmentsOneRequest.builder()
.referenceType(AttachmentReferenceType.INVOICE)
.referenceId("12345")
.id("<id>")
.serviceId("salesforce")
.fields("id,updated_at")
.build();
AccountingAttachmentsOneResponse res = sdk.accounting().attachments().get()
.request(req)
.call();
if (res.getAttachmentResponse().isPresent()) {
// handle response
}
}
}
Parameter | Type | Required | Description |
---|---|---|---|
request |
AccountingAttachmentsOneRequest | ✔️ | The request object to use for the request. |
AccountingAttachmentsOneResponse
Error Type | Status Code | Content Type |
---|---|---|
models/errors/BadRequestResponse | 400 | application/json |
models/errors/UnauthorizedResponse | 401 | application/json |
models/errors/PaymentRequiredResponse | 402 | application/json |
models/errors/NotFoundResponse | 404 | application/json |
models/errors/UnprocessableResponse | 422 | application/json |
models/errors/APIException | 4XX, 5XX | */* |
Delete Attachment
package hello.world;
import com.apideck.unify.Apideck;
import com.apideck.unify.models.components.AttachmentReferenceType;
import com.apideck.unify.models.errors.BadRequestResponse;
import com.apideck.unify.models.errors.NotFoundResponse;
import com.apideck.unify.models.errors.PaymentRequiredResponse;
import com.apideck.unify.models.errors.UnauthorizedResponse;
import com.apideck.unify.models.errors.UnprocessableResponse;
import com.apideck.unify.models.operations.AccountingAttachmentsDeleteRequest;
import com.apideck.unify.models.operations.AccountingAttachmentsDeleteResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws BadRequestResponse, UnauthorizedResponse, PaymentRequiredResponse, NotFoundResponse, UnprocessableResponse, Exception {
Apideck sdk = Apideck.builder()
.apiKey("<YOUR_API_KEY_HERE>")
.consumerId("test-consumer")
.appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
.build();
AccountingAttachmentsDeleteRequest req = AccountingAttachmentsDeleteRequest.builder()
.referenceType(AttachmentReferenceType.INVOICE)
.referenceId("12345")
.id("<id>")
.serviceId("salesforce")
.build();
AccountingAttachmentsDeleteResponse res = sdk.accounting().attachments().delete()
.request(req)
.call();
if (res.deleteAttachmentResponse().isPresent()) {
// handle response
}
}
}
Parameter | Type | Required | Description |
---|---|---|---|
request |
AccountingAttachmentsDeleteRequest | ✔️ | The request object to use for the request. |
AccountingAttachmentsDeleteResponse
Error Type | Status Code | Content Type |
---|---|---|
models/errors/BadRequestResponse | 400 | application/json |
models/errors/UnauthorizedResponse | 401 | application/json |
models/errors/PaymentRequiredResponse | 402 | application/json |
models/errors/NotFoundResponse | 404 | application/json |
models/errors/UnprocessableResponse | 422 | application/json |
models/errors/APIException | 4XX, 5XX | */* |
Download Attachment
package hello.world;
import com.apideck.unify.Apideck;
import com.apideck.unify.models.components.AttachmentReferenceType;
import com.apideck.unify.models.errors.BadRequestResponse;
import com.apideck.unify.models.errors.NotFoundResponse;
import com.apideck.unify.models.errors.PaymentRequiredResponse;
import com.apideck.unify.models.errors.UnauthorizedResponse;
import com.apideck.unify.models.errors.UnprocessableResponse;
import com.apideck.unify.models.operations.AccountingAttachmentsDownloadRequest;
import com.apideck.unify.models.operations.AccountingAttachmentsDownloadResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws BadRequestResponse, UnauthorizedResponse, PaymentRequiredResponse, NotFoundResponse, UnprocessableResponse, Exception {
Apideck sdk = Apideck.builder()
.apiKey("<YOUR_API_KEY_HERE>")
.consumerId("test-consumer")
.appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
.build();
AccountingAttachmentsDownloadRequest req = AccountingAttachmentsDownloadRequest.builder()
.referenceType(AttachmentReferenceType.INVOICE)
.referenceId("12345")
.id("<id>")
.serviceId("salesforce")
.fields("id,updated_at")
.build();
AccountingAttachmentsDownloadResponse res = sdk.accounting().attachments().download()
.request(req)
.call();
if (res.getAttachmentDownloadResponse().isPresent()) {
// handle response
}
}
}
Parameter | Type | Required | Description |
---|---|---|---|
request |
AccountingAttachmentsDownloadRequest | ✔️ | The request object to use for the request. |
AccountingAttachmentsDownloadResponse
Error Type | Status Code | Content Type |
---|---|---|
models/errors/BadRequestResponse | 400 | application/json |
models/errors/UnauthorizedResponse | 401 | application/json |
models/errors/PaymentRequiredResponse | 402 | application/json |
models/errors/NotFoundResponse | 404 | application/json |
models/errors/UnprocessableResponse | 422 | application/json |
models/errors/APIException | 4XX, 5XX | */* |