본문 바로가기
트레이딩/암호화폐

bybit . API V5 . 웹소켓 . authentication 처리

by i.got.it 2023. 10. 26.

 

 

private 웹소켓 authentication  구문 

 


{
    "req_id": "10001", // optional
    "op": "auth",
    "args": [
        "api_key",
        1662350400000, // expires; is greater than your current timestamp
        "signature"
    ]
}

 

VC++ 코드 구현예 

 



/*
2023.10.26. 
api v5 . 

private websocket 보안 접속 요청구문. 과거버전과 동일하며, api v5 에서 req_id 추가됨.필수아님. 

{
    "req_id": "10001", // optional
    "op": "auth",
    "args": [
        "api_key",
        1662350400000, // expires; is greater than your current timestamp
        "signature"
    ]
}
*/
int CCyWebSocketBybit::send_websocket_secure_auth()
{
    // expire 시간 . 현재시각에  통상 +5초 정도 설정. 
    std::string expires = std::to_string(CyUtilTime::get_time_ms() + 5000);

    std::string val_encode = "GET/realtime" + expires; 
    std::string signature = m_CCyUtilSSL.HmacEncode(m_ApiSecret.c_str(), val_encode.c_str());

    std::string str_send = "{\"op\":\"auth\",\"args\":[\"" + m_ApiKey + "\"," + expires + ",\"" + signature + "\"]}";

    return m_CCyWebSocket_Secure.send_websocket(str_send);
}

 

응답 

{
    "success": true,
    "ret_msg": "",
    "op": "auth",
    "conn_id": "cejreaspqfh3sjdnldmg-p"
}

 

 

 

상위정리 

 

 

bybit api v5 . 활용방법 정리

bybit API v5 . 서버 주소 bybit. API V5. 서버 주소 정리. 암호화폐 거래소 bybit 의 API V5 서버 주소 bybit 전종목 Rest 서버 - Rest 서버는 전 종목 동일 주소. 실거래 서버 시험용 서버 Rest 서버 주소 https://api.

igotit.tistory.com

 

 

 


첫 등록 : 2023.10.26

최종 수정 : 

단축 주소 : https://igotit.tistory.com/4953


 

댓글



 

비트코인




암호화폐       외환/나스닥/골드       암호화폐/외환/나스닥/골드 암호화폐/외환/나스닥/골드   암호화폐/외환/나스닥/골드
     
현물 |선물 인버스 |선물 USDT       전략매니저(카피트레이딩)     롤오버 이자 없는 스왑프리계좌
( 스왑프리 암호화폐도 거래 가능 )    
MT4, MT5 , cTrader 모두 지원     FTMO 계좌 매매운용. MT4,MT5