Skip to content
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

status -500 반환 #445

Open
nunnu1028 opened this issue Jun 27, 2021 · 2 comments
Open

status -500 반환 #445

nunnu1028 opened this issue Jun 27, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@nunnu1028
Copy link

Describe the bug
status -500 반환

To Reproduce
ServiceApiClient을 생성후 requestFriendList를 호출하면 -500 반환.

Expected behavior
friendList가 정상적으로 반환되어야함.

Screenshots
image

@nunnu1028 nunnu1028 added the bug Something isn't working label Jun 27, 2021
@nunnu1028
Copy link
Author

nunnu1028 commented Jun 27, 2021

임시로 만든 동기화 코드

interface IFriendInfo {
   userId: Long;
   nickName: string;
   profileImageUrl: string;
   fullProfileImageUrl: string;
   type: number;
   phoneNumber: string;
   statusMessage: string;
   UUID: string;
   friendNickName: string;
   accountId: number;
   originalProfileImageUrl: string;
   userType: number;
   ext: Object;
   hidden: boolean;
   purged: boolean;
   favorite: boolean;
   screenToken: number;
   suspended: boolean;
   directChatId: number;
}

interface IFriendUpdateRes {
   friends: IFriendInfo[];
}

async function getFriendResult(loginData: api.LoginData): IFriendUpdateRes {
   return (
      (
         await axios.post(
            "https://katalk.kakao.com/win32/friends/update.json",
            querystring.stringify({
               contacts: [],
               removed_contacts: [],
               phone_number_type: "7",
               token: "0",
               type: "a",
               manual: "true"
            }),
            {
               headers: {
                  "Content-Type": "application/x-www-form-urlencoded",
                  A: "win32/3.2.3/ko",
                  Authorization: `${loginData.result.accessToken}-${loginData.result.deviceUUID}`,
                  "User-Agent": "KT/3.2.3 Wd/10.0 ko",
                  Accept: "*/*",
                  "Accept-Language": "ko"
               }
            }
         )
      ).data as IFriendUpdateRes;
}

@dn1t
Copy link

dn1t commented Jul 8, 2021

const requestFriendList = async (credential: OAuthCredential): Promise<FriendListStruct> =>
  (
    await axios.post(
      'https://katalk.kakao.com/win32/friends/update.json',
      querystring.stringify({
        contacts: [],
        removed_contacts: [],
        phone_number_type: '7',
        token: '0',
        type: 'a',
        manual: 'true',
      }),
      {
        headers: {
          'Content-Type': 'application/x-www-form-urlencoded',
          A: 'win32/3.2.3/ko',
          Authorization: `${credential.accessToken}-${credential.deviceUUID}`,
          'User-Agent': 'KT/3.2.3 Wd/10.0 ko',
          Accept: '*/*',
          'Accept-Language': 'ko',
        },
      }
    )
  ).data;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants