-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Usage scenarios or usage instructions to Api details page #1387
Comments
Concretely, some information about development. OkHttpClient client = new OkHttpClient();
client.interceptors().add(new Interceptor() {
@Override
public Response intercept(Chain chain) throws IOException {
Request request = chain.request();
HttpUrl url = request.url().newBuilder().addQueryParameter("api_key","XYZ123").build();
request = request.newBuilder().url(url).build();
return chain.proceed(request);
}
});
Retrofit retrofit = new Retrofit.Builder()
.baseUrl("CLIENT.apinf.io")
.client(client)
.build();
public interface SpaceshipsService {
@GET("spaceships")
Call<List<Spaceship>> listSpaceships();
} The relevant places are The base url .baseUrl("CLIENT.apinf.io") The api-key parameter added to every request HttpUrl url = request.url().newBuilder().addQueryParameter("api_key","XYZ123").build(); The actual call to an endpoint, as defined in Swagger @GET("spaceships") As an Android developer, the first 2 items is what I need for configuration and I find this in detail or settings somewhere. The third item I find that in documentation. |
@NNN : what are your ideas about the possible UI view? please let me know. |
@NNN Based on our discussion, I prepared the given wireframe. |
@NNN What is the status of this task? |
@bajiat PR is ready for review. |
The instruction text is an important part of this task. We want to give brief instructions on how to call the API in the following ways:
Be sure to refer to the API Umbrella documentation for an example of how to make a post call. Ping: @bajiat @preriasusi: does this seem correct to you? |
There is no need for a 'try it out' button here. The task is only to create usage instructions. Ping: @bajiat @preriasusi |
For simplicity, we are only covering standard GET/POST requests. I.e. we will not provide language/framework specific usage examples. |
I agree with @brylie. This instruction text should tell basic info how to call api. When arrives to api page for the first time, he/she finds the url of the api. He/she should also know how can he/she call the api, meaning how to give API key. The endpoints, test calls and code examples/snippets should go to documentation tab. |
@bajiat, @preriasusi, @brylie got it. Working on it. |
Agree with the comments above. This is just user instructions, and should not contain functionality to call the API (ie. Try out button), because the base URL should not return anything. |
Help text could, for instance, say:
We can refine the text, but this is the basic pattern. Ping @bajiat @Nazarah @preriasusi |
That should do it. |
Are we using the correct terminology here? host = maps.google.com or maps.google.com/api/v1 ? Based on Mozilla, there is other terminology Based on Apigee the terminology becomes |
'Host' and 'basePath' come from the Open API Specification:
|
Terminology aside, the |
Ok, Open API specs are a good ref indeed. |
I mixed up the terminology, as there are quite a lot of similar words/concepts. The Basically, we want to construct a URL for the end user with the following structure:
|
The current work on the usage instructions looks nice: However, we are still missing key points in the definition of done. Please provide a valid URL in the usage instructions, with actual values for:
|
Include simple usage instructions or common usage instructions to API details page. These instructions should contain a possibility to copy at least user's API key (if an API key is available and if a proxy has been selected to this particular API)
User story
Definition of done
?api_key=###
query parameterX-Api-Key
as a request headerWireframe
The text was updated successfully, but these errors were encountered: