Skip to main content

TransferApi

All URIs are relative to http://localhost

MethodHTTP requestDescription
deleteTransferDELETE /transfers/{transfer_id}Mark transfer request as deleted
listFilteredGET /transfersList outgoing transfer requests for current or specified user If limit is omitted will display top 50 transfer requests
listIncomingGET /transfers/incomingList transfer requests assigned to user
receiverAcceptTransferPOST /transfers/{transfer_id}/receiver_acceptAs a receiver, accept transfer request by id.
requestTransferPOST /transfersTransfer eid to either the pubkey or email address supplied in the PUT data
resendCodePOST /transfers/{transfer_id}/resend_codeResend a new transfer OTP code for the current user, if the transfer allows it.
senderAcceptTransferPOST /transfers/{transfer_id}/sender_acceptAs a sender, confirm the transfer request by transfer id.

deleteTransfer#

/*** @returns DisplayTransferRequest**/async function deleteTransfer(transferId: String)

Mark transfer request as deleted

Notes:#

Note: user expected to be Admin or creator of transfer request Note: When transfer request deleted it cannot be accepted, if it was accepted before being deleted it is just marked deleted, but emoji does not move back

Example#

const yat = require('yatjs');const api = new yat.YatJs();
await api.login("[email protected]", "your_password");
let transferId = null; // String // populate transferId...
try {  let res = await api.transfer().deleteTransfer(transferId);  // res is of type DisplayTransferRequest  console.log('API called successfully. Result: ', res);} catch (error) {  console.error(error);}

Parameters#

NameTypeDescriptionNotes
transferIdString

Return type#

DisplayTransferRequest

Authorization#

apiKey

HTTP request headers#

  • Content-Type: Not defined
  • Accept: /

listFiltered#

/*** @returns ListOfDisplayTransferRequest**/async function listFiltered(opts)

List outgoing transfer requests for current or specified user If limit is omitted will display top 50 transfer requests

Example#

const yat = require('yatjs');const api = new yat.YatJs();
await api.login("[email protected]", "your_password");
let opts = {  'acceptedAfter': new Date("2013-10-20T19:20:30+01:00"), // Date | When set will display only requests accepted after provided datetime  'dir': "dir_example", // String |   'limit': 56, // Number |   'page': 56, // Number |   'senderId': null, // String | Uuid of a sender  'sort': "sort_example" // String | };try {  let res = await api.transfer().listFiltered(opts);  // res is of type ListOfDisplayTransferRequest  console.log('API called successfully. Result: ', res);} catch (error) {  console.error(error);}

Parameters#

NameTypeDescriptionNotes
acceptedAfterDateWhen set will display only requests accepted after provided datetime[optional]
dirString[optional]
limitNumber[optional]
pageNumber[optional]
senderIdString
Uuid of a sender[optional]
sortString[optional]

Return type#

ListOfDisplayTransferRequest

Authorization#

apiKey

HTTP request headers#

  • Content-Type: Not defined
  • Accept: /

listIncoming#

/*** @returns [DisplayTransferRequest]**/async function listIncoming(accepted: Boolean)

List transfer requests assigned to user

Example#

const yat = require('yatjs');const api = new yat.YatJs();
await api.login("[email protected]", "your_password");
let accepted = true; // Boolean | Display accepted transfer requests.  By default will display pending requests only.// populate accepted...
try {  let res = await api.transfer().listIncoming(accepted);  // res is of type [DisplayTransferRequest]  console.log('API called successfully. Result: ', res);} catch (error) {  console.error(error);}

Parameters#

NameTypeDescriptionNotes
acceptedBooleanDisplay accepted transfer requests. By default will display pending requests only.

Return type#

[DisplayTransferRequest]

Authorization#

apiKey

HTTP request headers#

  • Content-Type: Not defined
  • Accept: /

receiverAcceptTransfer#

/*** @returns [String]**/async function receiverAcceptTransfer(transferId: String, body: AcceptTransfer)

As a receiver, accept transfer request by id.

Notes:#

If the OTP is correct, the transfer instructions are submitted. Returning transferred Emoji IDs

Example#

const yat = require('yatjs');const api = new yat.YatJs();
await api.login("[email protected]", "your_password");
let transferId = null; // String // populate transferId...
let body = new YatJs.AcceptTransfer(); // AcceptTransfer // populate body...
try {  let res = await api.transfer().receiverAcceptTransfer(transferId, body);  // res is of type [String]  console.log('API called successfully. Result: ', res);} catch (error) {  console.error(error);}

Parameters#

NameTypeDescriptionNotes
transferIdString
bodyAcceptTransfer

Return type#

[String]

Authorization#

apiKey

HTTP request headers#

  • Content-Type: Not defined
  • Accept: /

requestTransfer#

/*** @returns DisplayTransferRequest**/async function requestTransfer(body: TransferRequest)

Transfer eid to either the pubkey or email address supplied in the PUT data

Notes:#

Note: user expected to be Admin or have scope Scopes::EmojiTransfer and own emoji If recipient does not exist account will be created and sent invitation email If recipient is not activated it will be automatically activated

Example#

const yat = require('yatjs');const api = new yat.YatJs();
await api.login("[email protected]", "your_password");
let body = new YatJs.TransferRequest(); // TransferRequest // populate body...
try {  let res = await api.transfer().requestTransfer(body);  // res is of type DisplayTransferRequest  console.log('API called successfully. Result: ', res);} catch (error) {  console.error(error);}

Parameters#

NameTypeDescriptionNotes
bodyTransferRequest

Return type#

DisplayTransferRequest

Authorization#

apiKey

HTTP request headers#

  • Content-Type: Not defined
  • Accept: /

resendCode#

/*** @returns Object**/async function resendCode(transferId: String)

Resend a new transfer OTP code for the current user, if the transfer allows it.

Notes:#

The code will be resent if: - the current user is the sender and the sender has not confirmed - the current user is the receiver, the sender has confirmed the transfer but has not been accepted by the receiver

Example#

const yat = require('yatjs');const api = new yat.YatJs();
await api.login("[email protected]", "your_password");
let transferId = null; // String // populate transferId...
try {  let res = await api.transfer().resendCode(transferId);  // res is of type Object  console.log('API called successfully. Result: ', res);} catch (error) {  console.error(error);}

Parameters#

NameTypeDescriptionNotes
transferIdString

Return type#

Object

Authorization#

apiKey

HTTP request headers#

  • Content-Type: Not defined
  • Accept: /

senderAcceptTransfer#

/*** @returns DisplayTransferRequest**/async function senderAcceptTransfer(transferId: String, body: AcceptTransfer)

As a sender, confirm the transfer request by transfer id.

Notes:#

The correct OTP must be provided. If it is, the receiver is notified and may accept the transfer. Returning an empty response object on success

Example#

const yat = require('yatjs');const api = new yat.YatJs();
await api.login("[email protected]", "your_password");
let transferId = null; // String // populate transferId...
let body = new YatJs.AcceptTransfer(); // AcceptTransfer // populate body...
try {  let res = await api.transfer().senderAcceptTransfer(transferId, body);  // res is of type DisplayTransferRequest  console.log('API called successfully. Result: ', res);} catch (error) {  console.error(error);}

Parameters#

NameTypeDescriptionNotes
transferIdString
bodyAcceptTransfer

Return type#

DisplayTransferRequest

Authorization#

apiKey

HTTP request headers#

  • Content-Type: Not defined
  • Accept: /