TransferApi
All URIs are relative to http://localhost
| Method | HTTP request | Description |
|---|---|---|
| deleteTransfer | DELETE /transfers/{transfer_id} | Mark transfer request as deleted |
| listFiltered | GET /transfers | List outgoing transfer requests for current or specified user If limit is omitted will display top 50 transfer requests |
| listIncoming | GET /transfers/incoming | List transfer requests assigned to user |
| receiverAcceptTransfer | POST /transfers/{transfer_id}/receiver_accept | As a receiver, accept transfer request by id. |
| requestTransfer | POST /transfers | Transfer eid to either the pubkey or email address supplied in the PUT data |
| resendCode | POST /transfers/{transfer_id}/resend_code | Resend a new transfer OTP code for the current user, if the transfer allows it. |
| senderAcceptTransfer | POST /transfers/{transfer_id}/sender_accept | As 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#
| Name | Type | Description | Notes |
|---|---|---|---|
| transferId | String | ||
Return type#
Authorization#
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#
| Name | Type | Description | Notes |
|---|---|---|---|
| acceptedAfter | Date | When set will display only requests accepted after provided datetime | [optional] |
| dir | String | [optional] | |
| limit | Number | [optional] | |
| page | Number | [optional] | |
| senderId | String | ||
| Uuid of a sender | [optional] | ||
| sort | String | [optional] |
Return type#
Authorization#
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#
| Name | Type | Description | Notes |
|---|---|---|---|
| accepted | Boolean | Display accepted transfer requests. By default will display pending requests only. |
Return type#
Authorization#
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#
| Name | Type | Description | Notes |
|---|---|---|---|
| transferId | String | ||
| body | AcceptTransfer | ||
Return type#
[String]
Authorization#
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#
| Name | Type | Description | Notes |
|---|---|---|---|
| body | TransferRequest | ||
Return type#
Authorization#
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#
| Name | Type | Description | Notes |
|---|---|---|---|
| transferId | String | ||
Return type#
Object
Authorization#
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#
| Name | Type | Description | Notes |
|---|---|---|---|
| transferId | String | ||
| body | AcceptTransfer | ||
Return type#
Authorization#
HTTP request headers#
- Content-Type: Not defined
- Accept: /