/** * Create Download link for attachment. * The URL will be returned via response body and is valid for <b>300</b> seconds. * * @param conversationId Id of the {@link Conversation conversation} that the attachment belongs to * @param attachmentId id of the (@link {@link MessageAttachment} that you want to receive the download link for * @return A {@linkplain CallSpec callSpec object} ready to execute the request. * * @see <a href="https://dev.xing.com/docs/post/users/me/conversations/:conversation_id/attachments/:id/download">Create * a temporary URL to download an attachment.</a> */ public CallSpec<String, HttpError> getAttachmentDownloadLink(String conversationId, String attachmentId) { return Resource.<String, HttpError>newPostSpec(api, "/v1/users/me/conversations/{conversation_id}/attachments/{attachment_id}/download", false) .pathParam("conversation_id", conversationId) .pathParam("attachment_id", attachmentId) .responseAs(single(String.class, "download", "url")) .build(); }
/** * Creates a new {@linkplain ConversationMessage message} in an existing {@linkplain Conversation conversation}. * * @param messageContent The {@linkplain ConversationMessage message} to add * @param conversationId Id of the {@link Conversation conversation} where the message is created in * @param userId Id of the {@linkplain com.xing.api.data.profile.XingUser user} who sends the message * @return A {@linkplain CallSpec callSpec object} ready to execute the request. * * @see <a href="https://dev.xing.com/docs/post/users/:user_id/conversations/:conversation_id/messages">'Create * message in a conversation' resource page</a> */ public CallSpec<ConversationMessage, HttpError> sendMessageToConversation(String userId, String conversationId, String messageContent) { return Resource.<ConversationMessage, HttpError>newPostSpec(api, "/v1/users/{user_id}/conversations/{conversation_id}/messages", false) .pathParam("user_id", userId) .pathParam("conversation_id", conversationId) .queryParam("content", messageContent) .responseAs(single(ConversationMessage.class, "message")) .build(); }
.pathParam("user_id", userId) .pathParam("conversation_id", conversationId) .responseAs(single(Conversation.class, "conversation")) .build();
.pathParam("conversation_id", conversationId) .pathParam("message_id", messageId) .responseAs(single(ConversationMessage.class, "message")) .build();
/** * Starts a {@linkplain Conversation conversation} by sending the passed message to the recipients. * The subject of a conversation cannot be changed afterwards. * Basic members are not allowed to send messages to non-contacts. * Premium members are limited to 20 messages to non-contacts per month. * * @param content Message text with max size of 16384 UTF-8 characters * @param recipientIds Comma-separated list of recipients. There must be between one and 10 recipients. * Sender cannot be included. * @param subject Subject for conversation. Max. size is 255 UTF-8 characters * @param userId Id of the {@linkplain com.xing.api.data.profile.XingUser user} starting the conversation * @return A {@linkplain CallSpec callSpec object} ready to execute the request. * * @see <a href="https://dev.xing.com/docs/post/users/:user_id/conversations">'Create a conversation' resource page</a> */ public CallSpec<Conversation, HttpError> createConversation(String userId, String subject, String content, String... recipientIds) { return Resource.<Conversation, HttpError>newPostSpec(api, "/v1/users/{user_id}/conversations", false) .pathParam("user_id", userId) .queryParam("content", content) .queryParam("recipient_ids", recipientIds) .queryParam("subject", subject) .responseAs(single(Conversation.class, "conversation")) .build(); }