Get Unsigned Data

API Endpoint

Input Parameters

session-idYstringID for the storage upload session.Y
peer-idNstringClient that requires the offline signsN
nonce-timestampYint64Timestamp used for nonce. Must be within 1 hour of server time.N
upload-session-signatureYstringPrivate key-signed string of “::” for this delegated request.N
session-statusYstringThe “status” API session status that is received right before calling this API.N


async getUnsignedData(event) {
    let input  = {
      SessionId: this.state.added_session_id,
      SessionStatus: this.state.added_session_status,
      Hash: this.state.added_file_hash,
      TimeNonce: this.time,
      PrivKey: config.PrivKey,
      PeerID: config.PeerID
    const unsignedDataResponse = this.btfs.getUnsigned(input, {})
    try {
      for await (const response of unsignedDataResponse) {
        input.Unsigned = response.Unsigned
        input.Opcode = response.Opcode
        input.Price = response.Price
        const unsignedDataResponse = await this.btfs.sign(input, {}, {})
        for await (const response of unsignedDataResponse ){
    } catch (err) {
// Usage

unsigned, err := s.StorageUploadGetUnsignedData(sessionId, mhash, uts, storage.Status)

// Go Wrapper

func (s *Shell) StorageUploadGetUnsignedData(sid string, hash string, uts string, sessionStatus string) (*UnsignedData, error) {
    var out UnsignedData
    offlinePeerSessionSignature, err := getSessionSignature()
    if err != nil {
        return nil, err
    rb := s.Request("storage/upload/getunsigned", sid, utils.GetPeerId(), uts, offlinePeerSessionSignature, sessionStatus)
    return &out, rb.Exec(context.Background(), &out)
curl -X POST


    “Opcode”: “<string>”
    "Unsigned": “<string>”
    "Price": "<int64>"