Skype4J icon indicating copy to clipboard operation
Skype4J copied to clipboard

ConnectionException:{"errorCode":201,"message":"To field is invalid"}

Open Doran1990 opened this issue 8 years ago • 8 comments

I can't send message to some firends, but I can send message with skype or web skype. the error is : pls help me how to slove it. com.samczsun.skype4j.exceptions.ConnectionException: Cause: While sending message Response: 400 Bad Request Begin Message

{"errorCode":201,"message":"To field is invalid"}

    End message

at com.samczsun.skype4j.internal.ExceptionHandler.generateException(ExceptionHandler.java:101)
at com.samczsun.skype4j.internal.Endpoints$EndpointConnection.connect(Endpoints.java:377)
at com.samczsun.skype4j.internal.Endpoints$EndpointConnection.connect(Endpoints.java:307)
at com.samczsun.skype4j.internal.Endpoints$EndpointConnection.post(Endpoints.java:291)
at com.samczsun.skype4j.internal.chat.ChatImpl.sendMessage(ChatImpl.java:85)

Doran1990 avatar May 29 '16 15:05 Doran1990

Code please :)

ducc avatar May 29 '16 15:05 ducc

This is my code: I get all contacts ,and send private message Collection<Contact> contacts = skype.getAllContacts(); Object[] ary = contacts.toArray(); for(int i =0;i<ary.length;i++){

Contact contact = (Contact)ary[i]; Chat chat = contact.getPrivateConversation(); ChatMessage chatMessage = null; chatMessage = chat.sendMessage(Message.create().with(Text.plain(msg)).with(Text.rich(link).withLink(link))); }

Doran1990 avatar May 29 '16 16:05 Doran1990

I send message to all of contacts,sometime get the error: ConnectionException: Cause: While sending message Response: 504 Gateway Timeout Begin Message

{"errorCode":507,"message":"Failure due to: AclNotAvailable."}

    End message

at com.samczsun.skype4j.internal.ExceptionHandler.generateException(ExceptionHandler.java:101) at com.samczsun.skype4j.internal.Endpoints$EndpointConnection.connect(Endpoints.java:377) at com.samczsun.skype4j.internal.Endpoints$EndpointConnection.connect(Endpoints.java:307) at com.samczsun.skype4j.internal.Endpoints$EndpointConnection.post(Endpoints.java:291) at com.samczsun.skype4j.internal.chat.ChatImpl.sendMessage(ChatImpl.java:85)

Doran1990 avatar May 29 '16 16:05 Doran1990

Whilst we are waiting for @samczsun, why not use a for loop for iterating contacts?

for (Contact contact : skype.getAllContacts()) {
  // do what you want for each contact here
}

ducc avatar May 30 '16 10:05 ducc

@Sponges sure, can use iterating.

Doran1990 avatar May 30 '16 14:05 Doran1990

any body help me?

Doran1990 avatar Jun 01 '16 02:06 Doran1990

it seem the error occur when send message to msn friend

Doran1990 avatar Jun 03 '16 05:06 Doran1990

Could you elaborate on what you mean by "msn friend"?

samczsun avatar Jul 31 '16 19:07 samczsun