-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pass api key and username in the header
- Loading branch information
1 parent
b0890bd
commit 7794e90
Showing
2 changed files
with
10 additions
and
6 deletions.
There are no files selected for viewing
15 changes: 9 additions & 6 deletions
15
...scourse/src/main/java/org/xwiki/contrib/usersync/discourse/internal/DiscourseService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,21 @@ | ||
package org.xwiki.contrib.usersync.discourse.internal; | ||
|
||
import retrofit2.Call; | ||
import retrofit2.http.*; | ||
|
||
import org.xwiki.contrib.usersync.discourse.internal.*; | ||
import retrofit2.http.Body; | ||
import retrofit2.http.DELETE; | ||
import retrofit2.http.GET; | ||
import retrofit2.http.POST; | ||
import retrofit2.http.Path; | ||
import retrofit2.http.Header; | ||
|
||
public interface DiscourseService { | ||
@GET("users/{username}.json") | ||
Call<GetUserResponse> getUser(@Path("username") String username, @Query("api_key") String apiKey, @Query("api_username") String apiUsername); | ||
Call<GetUserResponse> getUser(@Path("username") String username, @Header("Api-Key") String apiKey, @Header("Api-Username") String apiUsername); | ||
|
||
@POST("users") | ||
Call<CreateUserResponse> createUser(@Body CreateUserBody createUserBody, @Query("api_key") String apiKey, @Query("api_username") String apiUsername); | ||
Call<CreateUserResponse> createUser(@Body CreateUserBody createUserBody, @Header("Api-Key") String apiKey, @Header("Api-Username") String apiUsername); | ||
|
||
@DELETE("/admin/users/{userid}.json") | ||
Call<DeleteUserResponse> deleteUser(@Path("userid") Integer userId, @Query("api_key") String apiKey, @Query("api_username") String apiUsername); | ||
Call<DeleteUserResponse> deleteUser(@Path("userid") Integer userId, @Header("Api-Key") String apiKey, @Header("Api-Username") String apiUsername); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You should pass the other exception as second parameter instead of just the message.