From c31763d1e45f78d843860e46a00304d25db4d178 Mon Sep 17 00:00:00 2001 From: isra el Date: Mon, 15 Apr 2024 01:51:55 +0300 Subject: [PATCH] chore(android): replace query apiKey auth by header --- .../com/vernu/sms/services/GatewayApiService.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/android/app/src/main/java/com/vernu/sms/services/GatewayApiService.java b/android/app/src/main/java/com/vernu/sms/services/GatewayApiService.java index 73e546e..7d78ba7 100644 --- a/android/app/src/main/java/com/vernu/sms/services/GatewayApiService.java +++ b/android/app/src/main/java/com/vernu/sms/services/GatewayApiService.java @@ -1,19 +1,24 @@ package com.vernu.sms.services; +import com.vernu.sms.dtos.SMSDTO; +import com.vernu.sms.dtos.SMSForwardResponseDTO; import com.vernu.sms.dtos.RegisterDeviceInputDTO; import com.vernu.sms.dtos.RegisterDeviceResponseDTO; import retrofit2.Call; import retrofit2.http.Body; +import retrofit2.http.Header; import retrofit2.http.PATCH; import retrofit2.http.POST; import retrofit2.http.Path; -import retrofit2.http.Query; public interface GatewayApiService { @POST("gateway/devices") - Call registerDevice(@Query("apiKey") String apiKey, @Body() RegisterDeviceInputDTO body); + Call registerDevice(@Header("x-api-key") String apiKey, @Body() RegisterDeviceInputDTO body); @PATCH("gateway/devices/{deviceId}") - Call updateDevice(@Path("deviceId") String deviceId, @Query("apiKey") String apiKey, @Body() RegisterDeviceInputDTO body); + Call updateDevice(@Path("deviceId") String deviceId, @Header("x-api-key") String apiKey, @Body() RegisterDeviceInputDTO body); + + @POST("gateway/devices/{deviceId}/receivedSMS") + Call sendReceivedSMS(@Path("deviceId") String deviceId, @Header("x-api-key") String apiKey, @Body() SMSDTO body); } \ No newline at end of file