larksuite / larksuite/oapi-sdk-java
搜索部门时,报错:user access token is empty
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 310
- Forks
- 115
- PR merge metrics
- No merged PRs in 30d
Description
代码如下:
public static DepartmentSearchResult searchDepartments(String query) throws Exception {
ContactService contactService = new ContactService(config);
DepartmentSearchReqBody searchReqBody = new DepartmentSearchReqBody();
searchReqBody.setQuery(query);
Response<DepartmentSearchResult> response = contactService.getDepartments().search(searchReqBody).execute();
System.out.println(Jsons.DEFAULT_GSON.toJson(response));
if (response.getCode() == 0) {
return response.getData();
}
return null;
}
已经执行过testAccessToken方法。
执行searchDepartments报错:user access token is empty
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the provided searchDepartments example and compare its ContactService configuration with the testAccessToken setup. Trace the departments search request to find where the user access token is read and reproduce the empty-token error. Done means the cause is identified and the department search no longer fails when valid authentication is configured.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, authentication
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100