How to add retrofit add "[ ]" in query?

Viewed 25

Url - https://api.data.gov.in/resource/9ef84268-d588-465a-a308-a864a43d0070?filters%5Bmarket%5D=Agra&api-key=API_KEY&format=json&offset=2&limit=10

I was able to add format, limit, offset etc in API, but failed to add filters%5Bmarket%5D=Agra in the API call, how to add it? Using retrofit for API calls.

interface GovApi {
    @GET("9ef84268-d588-465a-a308-a864a43d0070")
    suspend fun getList(
        @Query("api-key") apiKey: String,
        @Query("format") format: String,
        @Query("offset") offset: Int,
        @Query("limit") limit: String
    ): Response<GovList>
}
1 Answers
 @GET("9ef84268-d588-465a-a308-a864a43d0070")
    suspend fun getFilteredList(
        @Query("filters[market]") filter: String = "",
        @Query("api-key") apiKey: String,
        @Query("format") format: String,
        @Query("offset") offset: Int,
        @Query("limit") limit: String
    ): Response<GovList>
Related