Skip to content

Cannot send RCS card message: MessageResponseException #613

Description

@ninhleOptimizely

Hello, I am using the java SDK version 9.9.0

  • send RCS Rich card message with Java code:
public class SendRcsCardExample {
    public static void main(String[] args) {
        VonageClient client = VonageClient.builder()
                .apiKey(API_KEY)
                .apiSecret(API_SECRET)
                .build();

        RcsCard card = RcsCard.builder()
            .title("ProductCard")
            .text("Check out our amazing product")
            .mediaUrl(MESSAGES_IMAGE_URL)
            .mediaForceRefresh(false)
            .mediaHeight(MediaHeight.TALL)
            .mediaDescription("Do you like this picture?")
            .build();

        RcsCardRequest request = RcsCardRequest.builder()
                .from(SENDER_NUMBER)        // e.g., "agent_sender"
                .to(RECIPIENT_NUMBER)      // e.g.,  "317900000002"
                .card(card)
                .build();

        var response = client.getMessagesClient().sendMessage(request);
        System.out.println("Message sent successfully. ID: " + response.getMessageUuid());
    }
}
  • Stacktrace:
Exception in thread "main" com.vonage.client.messages.MessageResponseException: 422 (Invalid channel parameters): The value of one or more parameters is invalid.
	at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:62)
	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:502)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:486)
	at com.vonage.client.Jsonable.fromJson(Jsonable.java:125)
	at com.vonage.client.DynamicEndpoint.parseResponseFailure(DynamicEndpoint.java:341)
	at com.vonage.client.DynamicEndpoint.parseResponse(DynamicEndpoint.java:264)
	at com.vonage.client.AbstractMethod.execute(AbstractMethod.java:136)
	at com.vonage.client.messages.MessagesClient.sendMessage(MessagesClient.java:91)
	at org.example.rcs.test.SendRcsRichCardAllExamples.sendStandaloneRichCardByDedicatedApi(SendRcsRichCardAllExamples.java:93)
	at org.example.rcs.test.SendRcsRichCardAllExamples.main(SendRcsRichCardAllExamples.java:65)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions