larksuite / larksuite/oapi-sdk-java

搜索部门时,报错:user access token is empty

Open
#63 3 comments 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.