title: Attribute Value must be a Constant in Retrofit Api Interface
body: <p>I am trying to hide my API Key and therefore am setting up my Retrofit  Api Interface as such:</p>
  
  <blockquote>
  <pre><code>public interface ApiInterface {
      @GET("?api_key=" + popularmovies.name.com.popularmovies.BuildConfig.TMD_API_KEY + "&amp;language=en-US")
      Call&lt;Movies&gt; getImages();
  }
  </code></pre>
  </blockquote>
  
  <p>However, I am receiving an error "Attribute value must be a constant." Is there a way to resolve and access this String?</p>
  
  <hr>
  
  <p><strong>UPDATE</strong>: Here is a second try:</p>
  
  <pre><code>private static final String API_KEY = popularmovies.troychuinard.com.popularmovies.BuildConfig.TMD_API_KEY;
  
  
  public interface ApiInterface {
      @GET("?language=en-US")
      Call&lt;Movies&gt; getImages(@Query("api_key") API_KEY);
  }
  </code></pre>
  
  <p><strong>UPDATE</strong>: Here is a third try:</p>
  
  <p>Below is the logging I am seeing as the URL making the request, as can be seen the API Key is now at the end of the URL which is incorrect syntax:</p>
  
  <blockquote>
    <p>06-10 18:41:33.212 4969-4993/? D/OkHttp: &lt;-- 401 Unauthorized <a href="http://api.themoviedb.org/3/movie/popular?language=en-US&amp;api_key=?api_key%3D09b0a9a9d5d9ddee2b3bc69e78b02457" rel="nofollow noreferrer">http://api.themoviedb.org/3/movie/popular?language=en-US&amp;api_key=?api_key%3D09b0a9a9d5d9ddee2b3bc69e78b02457</a> (592ms)
        Access-Control-Allow-Origin: *</p>
  </blockquote>