Skip to content

Latest commit

 

History

History
396 lines (308 loc) · 19.9 KB

README.md

File metadata and controls

396 lines (308 loc) · 19.9 KB

Messages

(sms().messages())

Overview

Available Operations

list

List Messages

Example Usage

package hello.world;

import com.apideck.unify.Apideck;
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.SmsMessagesAllRequest;
import com.apideck.unify.models.operations.SmsMessagesAllResponse;
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();

        SmsMessagesAllRequest req = SmsMessagesAllRequest.builder()
                .serviceId("salesforce")
                .fields("id,updated_at")
                .build();

        SmsMessagesAllResponse res = sdk.sms().messages().list()
                .request(req)
                .call();

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

Parameters

Parameter Type Required Description
request SmsMessagesAllRequest ✔️ The request object to use for the request.

Response

SmsMessagesAllResponse

Errors

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 */*

create

Create Message

Example Usage

package hello.world;

import com.apideck.unify.Apideck;
import com.apideck.unify.models.components.ExtendPaths;
import com.apideck.unify.models.components.MessageInput;
import com.apideck.unify.models.components.MessageType;
import com.apideck.unify.models.components.PassThroughBody;
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.SmsMessagesAddRequest;
import com.apideck.unify.models.operations.SmsMessagesAddResponse;
import java.lang.Exception;
import java.time.OffsetDateTime;
import java.util.List;
import java.util.Map;

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();

        SmsMessagesAddRequest req = SmsMessagesAddRequest.builder()
                .message(MessageInput.builder()
                    .from("+15017122661")
                    .to("+15017122662")
                    .body("Hi! How are you doing?")
                    .subject("Picture")
                    .type(MessageType.SMS)
                    .scheduledAt(OffsetDateTime.parse("2020-09-30T07:43:32.000Z"))
                    .webhookUrl("https://unify.apideck.com/webhook/webhooks/eyz329dkffdl4949/x/sms")
                    .reference("CUST001")
                    .messagingServiceId("123456")
                    .passThrough(List.of(
                        PassThroughBody.builder()
                            .serviceId("<id>")
                            .extendPaths(List.of(
                                ExtendPaths.builder()
                                    .path("$.nested.property")
                                    .value(Map.ofEntries(\n    Map.entry("TaxClassificationRef", Map.ofEntries(\n    Map.entry("value", "EUC-99990201-V1-00020000")))))
                                    .build()))
                            .build()))
                    .build())
                .serviceId("salesforce")
                .build();

        SmsMessagesAddResponse res = sdk.sms().messages().create()
                .request(req)
                .call();

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

Parameters

Parameter Type Required Description
request SmsMessagesAddRequest ✔️ The request object to use for the request.

Response

SmsMessagesAddResponse

Errors

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

Get Message

Example Usage

package hello.world;

import com.apideck.unify.Apideck;
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.SmsMessagesOneRequest;
import com.apideck.unify.models.operations.SmsMessagesOneResponse;
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();

        SmsMessagesOneRequest req = SmsMessagesOneRequest.builder()
                .id("<id>")
                .serviceId("salesforce")
                .fields("id,updated_at")
                .build();

        SmsMessagesOneResponse res = sdk.sms().messages().get()
                .request(req)
                .call();

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

Parameters

Parameter Type Required Description
request SmsMessagesOneRequest ✔️ The request object to use for the request.

Response

SmsMessagesOneResponse

Errors

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 */*

update

Update Message

Example Usage

package hello.world;

import com.apideck.unify.Apideck;
import com.apideck.unify.models.components.ExtendPaths;
import com.apideck.unify.models.components.MessageInput;
import com.apideck.unify.models.components.MessageType;
import com.apideck.unify.models.components.PassThroughBody;
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.SmsMessagesUpdateRequest;
import com.apideck.unify.models.operations.SmsMessagesUpdateResponse;
import java.lang.Exception;
import java.time.OffsetDateTime;
import java.util.List;
import java.util.Map;

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();

        SmsMessagesUpdateRequest req = SmsMessagesUpdateRequest.builder()
                .id("<id>")
                .message(MessageInput.builder()
                    .from("+15017122661")
                    .to("+15017122662")
                    .body("Hi! How are you doing?")
                    .subject("Picture")
                    .type(MessageType.SMS)
                    .scheduledAt(OffsetDateTime.parse("2020-09-30T07:43:32.000Z"))
                    .webhookUrl("https://unify.apideck.com/webhook/webhooks/eyz329dkffdl4949/x/sms")
                    .reference("CUST001")
                    .messagingServiceId("123456")
                    .passThrough(List.of(
                        PassThroughBody.builder()
                            .serviceId("<id>")
                            .extendPaths(List.of(
                                ExtendPaths.builder()
                                    .path("$.nested.property")
                                    .value(Map.ofEntries(\n    Map.entry("TaxClassificationRef", Map.ofEntries(\n    Map.entry("value", "EUC-99990201-V1-00020000")))))
                                    .build()))
                            .build()))
                    .build())
                .serviceId("salesforce")
                .build();

        SmsMessagesUpdateResponse res = sdk.sms().messages().update()
                .request(req)
                .call();

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

Parameters

Parameter Type Required Description
request SmsMessagesUpdateRequest ✔️ The request object to use for the request.

Response

SmsMessagesUpdateResponse

Errors

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

Delete Message

Example Usage

package hello.world;

import com.apideck.unify.Apideck;
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.SmsMessagesDeleteRequest;
import com.apideck.unify.models.operations.SmsMessagesDeleteResponse;
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();

        SmsMessagesDeleteRequest req = SmsMessagesDeleteRequest.builder()
                .id("<id>")
                .serviceId("salesforce")
                .build();

        SmsMessagesDeleteResponse res = sdk.sms().messages().delete()
                .request(req)
                .call();

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

Parameters

Parameter Type Required Description
request SmsMessagesDeleteRequest ✔️ The request object to use for the request.

Response

SmsMessagesDeleteResponse

Errors

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 */*