I connected android app(retrofit) with WordPress(json api) site and i got when i click on categories it displays me categories from the site :
How can i get post’s from only one category ?
here is my interface API :

public interface API {

/* your wordPress url */
String BASE_URL = "http://jollymagazine.com/";


// minimize field for list of post
String EXCLUDE_FIELD = "&exclude=content,categories,tags,comments,custom_fields";

/* info API transaction ------------------------------- */

@GET("?json=info")
Call<CallbackInfo> getInfo();


/* Post API transaction ------------------------------- */

@Headers({"Cache-Control: max-age=0", "User-Agent: WordPress"})
@GET("?json=get_posts" + EXCLUDE_FIELD)
Call<CallbackListPost> getPostByPage(
        @Query("page") int page,
        @Query("count") int count
);

@Headers({"Cache-Control: max-age=0", "User-Agent: WordPress"})
@GET("?json=get_post")
Call<CallbackDetailsPost> getPostDetialsById(
        @Query("id") int id
);

@Headers({"Cache-Control: max-age=0", "User-Agent: WordPress"})
@GET("?json=get_search_results" + EXCLUDE_FIELD)
Call<CallbackListPost> getSearchPosts(
        @Query("search") String search,
        @Query("count") int count
);


/* Category API transaction --------------------------- */

@Headers({"Cache-Control: max-age=0", "User-Agent: WordPress"})
@GET("?json=get_category_index")
Call<CallbackCategories> getAllCategories();

@Headers({"Cache-Control: max-age=0", "User-Agent: WordPress"})
@GET("?json=get_category_posts" + EXCLUDE_FIELD)
Call<CallbackCategoryDetails> getCategoryDetailsByPage(
        @Query("id") int id,
        @Query("page") int page,
        @Query("count") int count
);

@Headers({"Cache-Control: max-age=0", "User-Agent: WordPress"})
@GET("?json=respond/submit_comment")
Call<CallbackComment> sendComment(
        @Query("post_id") long post_id,
        @Query("name") String name,
        @Query("email") String email,
        @Query("content") String content
);

@Headers({"Cache-Control: max-age=0", "User-Agent: WordPress"})
@POST("?api-fcm=register")
Call<CallbackDevice> registerDevice(@Body DeviceInfo deviceInfo);

}

I need to get from this category http://jollymagazine.com/kategorija/blog/ post ?

Read more here: Retrofit =Getting posts from specific category WordPress JSON API


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: