Package com.whatsapp.api.service
Interface WhatsappBusinessCloudApiService
public interface WhatsappBusinessCloudApiService
The interface Whatsapp business cloud api service.
-
Method Summary
Modifier and TypeMethodDescriptionretrofit2.Call<Response>
deleteMedia
(String apiVersion, String mediaId) Delete media call.retrofit2.Call<okhttp3.ResponseBody>
downloadMediaFile
(String url) Download media file call.retrofit2.Call<Response>
markMessageAsRead
(String apiVersion, String phoneNumberId, ReadMessage message) Send mark Meassge as read call.retrofit2.Call<Media>
retrieveMediaUrl
(String apiVersion, String mediaId) Retrieve media url call.retrofit2.Call<MessageResponse>
sendMessage
(String apiVersion, String phoneNumberId, Message message) Send message call.retrofit2.Call<Response>
twoStepVerification
(String apiVersion, String phoneNumberId, TwoStepCode twoStepCode) Two-step verification call.retrofit2.Call<UploadResponse>
uploadMedia
(String apiVersion, String phoneNumberId, okhttp3.MultipartBody.Part file, okhttp3.MultipartBody.Part messageProduct) Upload media call.
-
Method Details
-
sendMessage
@POST("/{api-version}/{Phone-Number-ID}/messages") retrofit2.Call<MessageResponse> sendMessage(@Path("api-version") String apiVersion, @Path("Phone-Number-ID") String phoneNumberId, @Body Message message) Send message call.- Parameters:
phoneNumberId
- the phone number idmessage
- the message- Returns:
- the call
-
uploadMedia
@Multipart @POST("/{api-version}/{Phone-Number-ID}/media") retrofit2.Call<UploadResponse> uploadMedia(@Path("api-version") String apiVersion, @Path("Phone-Number-ID") String phoneNumberId, @Part okhttp3.MultipartBody.Part file, @Part okhttp3.MultipartBody.Part messageProduct) Upload media call.- Parameters:
phoneNumberId
- the phone number idfile
- the filemessageProduct
- the message product- Returns:
- the call
-
retrieveMediaUrl
@GET("/{api-version}/{media-id}") retrofit2.Call<Media> retrieveMediaUrl(@Path("api-version") String apiVersion, @Path("media-id") String mediaId) Retrieve media url call.- Parameters:
mediaId
- the media id- Returns:
- the call
-
downloadMediaFile
@GET @Streaming @Headers("User-Agent:curl/7.64.1") retrofit2.Call<okhttp3.ResponseBody> downloadMediaFile(@Url String url) Download media file call.- Parameters:
url
- the url- Returns:
- the call
-
deleteMedia
@DELETE("/{api-version}/{media-id}") retrofit2.Call<Response> deleteMedia(@Path("api-version") String apiVersion, @Path("media-id") String mediaId) Delete media call.- Parameters:
mediaId
- the media id- Returns:
- the call
-
markMessageAsRead
@POST("/{api-version}/{Phone-Number-ID}/messages") retrofit2.Call<Response> markMessageAsRead(@Path("api-version") String apiVersion, @Path("Phone-Number-ID") String phoneNumberId, @Body ReadMessage message) Send mark Meassge as read call.- Parameters:
phoneNumberId
- the phone number idmessage
- the message- Returns:
- the call
-
twoStepVerification
@POST("/{api-version}/{Phone-Number-ID}") retrofit2.Call<Response> twoStepVerification(@Path("api-version") String apiVersion, @Path("Phone-Number-ID") String phoneNumberId, @Body TwoStepCode twoStepCode) Two-step verification call.- Parameters:
phoneNumberId
- the phone number idtwoStepCode
- the two-step code- Returns:
- the call
-