### Install ProxiedMail JS Client via npm Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/README.md Use this command to install the library for your Node.js project. ```shell npm install proxiedmail-api ``` -------------------------------- ### Install Dependencies for Local Development Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/README.md Install project dependencies when working locally without publishing to npm. ```shell npm install ``` -------------------------------- ### Running the Example Script Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/README.md This command executes a Node.js script that demonstrates receiving email callbacks. ```bash node t.js ``` -------------------------------- ### User Authorization Example Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/docs/UserApi.md Demonstrates how to authorize a user using the userAuth method. This method is used for authentication and accepts an optional AuthRequest object. ```javascript import ProxiedMailApi from 'proxied_mail_api'; let apiInstance = new ProxiedMailApi.UserApi(); let opts = { 'authRequest': new ProxiedMailApi.AuthRequest() // AuthRequest | }; apiInstance.userAuth(opts, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }); ``` -------------------------------- ### apiV1ApiTokenGet Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/docs/ApiApi.md Retrieves an API token for authentication. This is a GET request to the /api/v1/api-token endpoint. ```APIDOC ## GET /api/v1/api-token ### Description Get api token ### Method GET ### Endpoint /api/v1/api-token ### Parameters This endpoint does not need any parameter. ### Request Example ```javascript import ProxiedMailApi from 'proxied_mail_api'; let defaultClient = ProxiedMailApi.ApiClient.instance; // Configure Bearer access token for authorization: api_auth let api_auth = defaultClient.authentications['api_auth']; api_auth.accessToken = "YOUR ACCESS TOKEN" let apiInstance = new ProxiedMailApi.ApiApi(); apiInstance.apiV1ApiTokenGet((error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }); ``` ### Response #### Success Response (200) - **data** (ApiV1ApiTokenGet200Response) - Description of the response data #### Response Example { "example": "response body" } ### Authorization api_auth ``` -------------------------------- ### Get Callback by Hash Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/README.md Retrieves callback information using a hash. This endpoint is part of the CallbackApi class. ```APIDOC ## GET /api/v1/callback/get/{hash} ### Description Auhtorization ### Method GET ### Endpoint /api/v1/callback/get/{hash} ### Parameters #### Path Parameters - **hash** (string) - Required - The hash of the callback to retrieve ### Request Example ### Response #### Success Response (200) #### Response Example ``` -------------------------------- ### Get API Token Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/README.md Retrieves an API token for authentication. This endpoint is part of the ApiApi class. ```APIDOC ## GET /api/v1/api-token ### Description Get api token ### Method GET ### Endpoint /api/v1/api-token ### Parameters ### Request Example ### Response #### Success Response (200) #### Response Example ``` -------------------------------- ### GET /api/v1/received-emails/{receivedEmailId} Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/docs/ApiV1ReceivedEmailsReceivedEmailIdGet200Response.md Retrieves the details of a specific received email, including its attributes. ```APIDOC ## GET /api/v1/received-emails/{receivedEmailId} ### Description Retrieves the details of a specific received email by its unique identifier. ### Method GET ### Endpoint /api/v1/received-emails/{receivedEmailId} ### Parameters #### Path Parameters - **receivedEmailId** (string) - Required - The unique identifier of the received email to retrieve. ### Response #### Success Response (200) - **type** (string) - Optional - The type of the resource. - **id** (string) - Optional - The unique identifier of the received email. - **attributes** (ApiV1ReceivedEmailsReceivedEmailIdGet200ResponseAttributes) - Optional - An object containing the detailed attributes of the received email. ``` -------------------------------- ### GET /api/v1/received-emails/{receivedEmailId} Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/docs/ApiV1ReceivedEmailsReceivedEmailIdGet200ResponseAttributes.md Retrieves the attributes of a specific received email by its ID. ```APIDOC ## GET /api/v1/received-emails/{receivedEmailId} ### Description Retrieves the attributes of a specific received email, identified by its unique ID. ### Method GET ### Endpoint /api/v1/received-emails/{receivedEmailId} ### Parameters #### Path Parameters - **receivedEmailId** (string) - Required - The unique identifier of the received email. ### Response #### Success Response (200) - **recipientEmail** (string) - Optional - The email address of the recipient. - **senderEmail** (string) - Optional - The email address of the sender. - **payload** (ApiV1ReceivedEmailsReceivedEmailIdGet200ResponseAttributesPayload) - Optional - The payload of the email. - **attachments** (array of ApiV1ReceivedEmailsReceivedEmailIdGet200ResponseAttributesAttachmentsInner) - Optional - A list of attachments associated with the email. - **isProcessed** (boolean) - Optional - Indicates if the email has been processed. - **createdAt** (string) - Optional - The timestamp when the email was received. - **updatedAt** (string) - Optional - The timestamp when the email attributes were last updated. ``` -------------------------------- ### Get API Token Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/docs/ApiApi.md Retrieves an API token using the ProxiedMail JS client. Ensure you configure the Bearer access token for authorization before making the call. ```javascript import ProxiedMailApi from 'proxied_mail_api'; let defaultClient = ProxiedMailApi.ApiClient.instance; // Configure Bearer access token for authorization: api_auth let api_auth = defaultClient.authentications['api_auth']; api_auth.accessToken = "YOUR ACCESS TOKEN" let apiInstance = new ProxiedMailApi.ApiApi(); apiInstance.apiV1ApiTokenGet((error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }); ``` -------------------------------- ### Get Received Email Content by ID Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/docs/ReceivedEmailApi.md Fetches the full content of a specific received email using its unique ID. API key authentication is required. ```javascript import ProxiedMailApi from 'proxied_mail_api'; let defaultClient = ProxiedMailApi.ApiClient.instance; // Configure API key authorization: api_key let api_key = defaultClient.authentications['api_key']; api_key.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //api_key.apiKeyPrefix = 'Token'; let apiInstance = new ProxiedMailApi.ReceivedEmailApi(); let receivedEmailId = "receivedEmailId_example"; // String | receivedEmailId of received email that needs to be fetched apiInstance.apiV1ReceivedEmailsReceivedEmailIdGet(receivedEmailId, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }); ``` -------------------------------- ### Get Received Email by ID Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/README.md Retrieves the content of a specific received email by its ID. This endpoint is part of the ReceivedEmailApi class. ```APIDOC ## GET /api/v1/received-emails/{receivedEmailId} ### Description Get content of received email by id ### Method GET ### Endpoint /api/v1/received-emails/{receivedEmailId} ### Parameters #### Path Parameters - **receivedEmailId** (string) - Required - The ID of the received email to retrieve ### Request Example ### Response #### Success Response (200) #### Response Example ``` -------------------------------- ### GET /api/v1/received-emails/{receivedEmailId} Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/docs/ApiV1ReceivedEmailsReceivedEmailIdGet200ResponseAttributesPayload.md Retrieves the attributes payload of a specific received email, including sender, recipient, subject, and body. ```APIDOC ## GET /api/v1/received-emails/{receivedEmailId} ### Description Retrieves the attributes payload of a specific received email. ### Method GET ### Endpoint /api/v1/received-emails/{receivedEmailId} ### Response #### Success Response (200) - **to** (String) - The recipient of the email. [optional] - **from** (String) - The sender of the email. [optional] - **subject** (String) - The subject line of the email. [optional] - **recipient** (String) - The recipient's email address. [optional] - **sender** (String) - The sender's email address. [optional] - **bodyHtml** (String) - The HTML content of the email body. [optional] - **bodyPlain** (String) - The plain text content of the email body. [optional] - **attachments** (String) - Information about email attachments. [optional] ### Response Example ```json { "to": "recipient@example.com", "from": "sender@example.com", "subject": "Meeting Update", "recipient": "recipient@example.com", "sender": "sender@example.com", "bodyHtml": "

Hello,

", "bodyPlain": "Hello,", "attachments": "" } ``` ``` -------------------------------- ### Get Received Emails List by Proxy Binding ID Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/docs/ReceivedEmailApi.md Retrieves a list of the last 55 received emails associated with a specific proxy email binding. Ensure API key authentication is configured. ```javascript import ProxiedMailApi from 'proxied_mail_api'; let defaultClient = ProxiedMailApi.ApiClient.instance; // Configure API key authorization: api_key let api_key = defaultClient.authentications['api_key']; api_key.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //api_key.apiKeyPrefix = 'Token'; let apiInstance = new ProxiedMailApi.ReceivedEmailApi(); let proxyBindingId = "proxyBindingId_example"; // String | proxyBindingId of proxy email that needs to be fetched apiInstance.apiV1ReceivedEmailsLinksProxyBindingIdGet(proxyBindingId, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }); ``` -------------------------------- ### Get Received Emails by Proxy Binding ID Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/README.md Retrieves a list of received emails linked to a specific proxy email binding (last 55). This endpoint is part of the ReceivedEmailApi class. ```APIDOC ## GET /api/v1/received-emails-links/{proxyBindingId} ### Description Get received emails list by proxy email (last 55) ### Method GET ### Endpoint /api/v1/received-emails-links/{proxyBindingId} ### Parameters #### Path Parameters - **proxyBindingId** (string) - Required - The ID of the proxy binding to get emails for ### Request Example ### Response #### Success Response (200) #### Response Example ``` -------------------------------- ### Build ProxiedMail JS Client Module Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/README.md Build the module after linking it locally for development. ```shell npm run build ``` -------------------------------- ### Use Linked Local Module in Project Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/README.md Link a globally defined local module into your project directory. ```shell npm link /path/to/ ``` -------------------------------- ### Bundle for Browser with Browserify Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/README.md Bundle your main JavaScript file into a single file for browser usage with Browserify. ```shell browserify main.js > bundle.js ``` -------------------------------- ### Create Proxy Email and Receive Emails (Facade API) Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/README.md This JavaScript code demonstrates using the ApiClientFacade to create a proxy email address and then periodically checks for received emails. It logs the proxy email address, its ID, and details of the first received email. ```javascript let ProxiedMailApi = require('proxiedmail-api'); let token = 'YOUR API TOKEN'; const apiApiClient = new ProxiedMailApi.ApiClientFacade(token); apiApiClient.createProxyEmail((pb) => { console.log('Proxy address ' + pb.getProxyEmail()) console.log('ID ' + pb.getId()) setInterval(function () { console.log('Received emails') apiApiClient.getReceivedEmails(pb.getId(), (resp) => { console.log(resp) if (resp.data.length > 0) { resp.data[0].getDetails(function (details) { console.log(details.getId()); console.log(details.getSubject()); console.log(details.getPayload()); console.log(details.getPayloadBodyHtml()); }) } }); }, 3000); }) ``` -------------------------------- ### ProxyBindingCreate Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/docs/ProxyBindingCreate.md Creates a new proxy binding. The `data` property is optional and contains the details for the proxy binding. ```APIDOC ## ProxyBindingCreate ### Description Creates a new proxy binding. The `data` property is optional and contains the details for the proxy binding. ### Parameters #### Request Body - **data** (ProxyBindingCreateData) - Optional - The data for the proxy binding. ``` -------------------------------- ### Add a New Callback Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/docs/CallbackApi.md Use this method to register a new callback URL. Ensure you have configured the 'api_auth' Bearer token for authorization. ```javascript import ProxiedMailApi from 'proxied_mail_api'; let defaultClient = ProxiedMailApi.ApiClient.instance; // Configure Bearer access token for authorization: api_auth let api_auth = defaultClient.authentications['api_auth']; api_auth.accessToken = "YOUR ACCESS TOKEN" let apiInstance = new ProxiedMailApi.CallbackApi(); apiInstance.addCallback((error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }); ``` -------------------------------- ### Link Local Module Globally Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/README.md Globally link your local proxied_mail_api module using npm link. ```shell npm link ``` -------------------------------- ### Create Proxy Email Binding Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/docs/ProxyBindingApi.md Use this method to create a new proxy email binding. Ensure API key authentication is configured. ```javascript import ProxiedMailApi from 'proxied_mail_api'; let defaultClient = ProxiedMailApi.ApiClient.instance; // Configure API key authorization: api_key let api_key = defaultClient.authentications['api_key']; api_key.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //api_key.apiKeyPrefix = 'Token'; let apiInstance = new ProxiedMailApi.ProxyBindingApi(); let opts = { 'proxyBindingCreate': [new ProxiedMailApi.ProxyBindingCreate()] // [ProxyBindingCreate] | }; apiInstance.addProxyBinding(opts, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }); ``` -------------------------------- ### Retrieve a Callback by Hash Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/docs/CallbackApi.md Use this method to fetch callback details using its unique hash. Configure the 'api_key' for authorization, and optionally set an API key prefix. ```javascript import ProxiedMailApi from 'proxied_mail_api'; let defaultClient = ProxiedMailApi.ApiClient.instance; // Configure API key authorization: api_key let api_key = defaultClient.authentications['api_key']; api_key.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //api_key.apiKeyPrefix = 'Token'; let apiInstance = new ProxiedMailApi.CallbackApi(); let hash = "hash_example"; // String | Callback hash apiInstance.apiV1CallbackGetHashGet(hash, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }); ``` -------------------------------- ### userAuth Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/docs/UserApi.md Handles user authorization by sending authentication credentials. ```APIDOC ## POST /api/v1/auth ### Description Auhtorization ### Method POST ### Endpoint /api/v1/auth ### Parameters #### Request Body - **authRequest** (AuthRequest) - Optional - ### Request Example ```javascript import ProxiedMailApi from 'proxied_mail_api'; let apiInstance = new ProxiedMailApi.UserApi(); let opts = { 'authRequest': new ProxiedMailApi.AuthRequest() // AuthRequest | }; apiInstance.userAuth(opts, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }); ``` ### Response #### Success Response (200) - **OauthAccessToken** (OauthAccessToken) - #### Response Example { "example": "response body" } ### Authorization No authorization required ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ``` -------------------------------- ### Add Callback and Create Proxy Binding Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/README.md This snippet demonstrates how to add a callback and create a proxy binding using the Proxied Mail JS client. It includes logic to continuously check for received emails. ```javascript callbackApi.addCallback((error, cb, response) => { const proxyBindingPayload = {'proxyBindingCreate': createProxyBindingPayload(cb.call_url)} var proxyBindingApi = new ProxiedMailApi.ProxyBindingApi(); //creating proxy-email and assigning callback url proxyBindingApi.addProxyBinding(proxyBindingPayload, (error, pb, response) => { //continuously checking callback status to get the email //just send the email to pb.data.attributes.proxy_address to check it out const interval = setInterval(function () { callbackApi.apiV1CallbackGetHashGet(cb.id, function (error, cbInfo) { console.log('check callback. email: ' + pb.data.attributes.proxy_address); console.log(cbInfo) //printing email info about callback if (cbInfo.is_received) { console.log('received') console.log(cbInfo) console.log('Subject: ' + cbInfo.payload.payload.Subject) console.log('Message: ' + cbInfo.payload.payload['body-plain']) console.log('From: ' + cbInfo.payload.payload['from']) clearInterval(interval); } }); }, 2000); }); } ) }); } }); ``` -------------------------------- ### Authenticate and Set API Token (Advanced API) Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/README.md This JavaScript code snippet shows how to authenticate with the ProxiedMail UserApi using provided credentials and then set the obtained API token for subsequent requests using the ApiApi client. It also configures the CallbackApi with the API token. ```javascript let ProxiedMailApi = require('proxiedmail-api'); let apiInstance = new ProxiedMailApi.UserApi(); let authReq = { 'authRequest': ProxiedMailApi.AuthRequest.constructFromObject( { "data": { "type": "auth-request", "attributes": { "username": "example@example.com", //please pass your credentials here after sign up "password": "example" } } } ) }; //logging in apiInstance.userAuth(authReq, (error, data, response) => { if (error) { console.error("error:" + error); } else { let token = data.data.attributes.token; var apiApiClient = new ProxiedMailApi.ApiApi(); apiApiClient.apiClient.authentications['api_auth'].accessToken = token; //settings bearer token //getting api token // your can skip this step and get one on the UI https://proxiedmail.com/en/settings apiApiClient.apiV1ApiTokenGet((error, data, response) => { if (error) { console.error("error:" + error); } //settings up api token let apiToken = data.token; var callbackApi = new ProxiedMailApi.CallbackApi(); callbackApi.apiClient.authentications['api_key'].apiKey = apiToken; // creating built-in callback-receiver ``` -------------------------------- ### Create Proxy Binding Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/README.md Creates a new proxy email binding. This endpoint is part of the ProxyBindingApi class. ```APIDOC ## POST /api/v1/proxy-bindings ### Description Create proxy-email ### Method POST ### Endpoint /api/v1/proxy-bindings ### Parameters ### Request Example ### Response #### Success Response (200) #### Response Example ``` -------------------------------- ### ApiV1ProxyBindingsGet200Response Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/docs/ApiV1ProxyBindingsGet200Response.md Represents the successful response structure for retrieving proxy bindings. It includes optional metadata and an optional list of proxy binding data. ```APIDOC ## GET /api/v1/proxy/bindings ### Description Retrieves a list of proxy bindings associated with the authenticated user or service. The response includes metadata about the request and the actual list of proxy bindings. ### Method GET ### Endpoint /api/v1/proxy/bindings ### Parameters #### Query Parameters None explicitly documented. ### Response #### Success Response (200) - **meta** (ApiV1ProxyBindingsGet200ResponseMeta) - Optional. Metadata related to the response, such as pagination information or status. - **data** ([ProxyBindingList]) - Optional. A list containing proxy binding objects. ### Response Example ```json { "meta": { "pagination": { "total": 100, "limit": 10, "offset": 0 } }, "data": [ { "id": "binding-123", "service": "example.com", "target": "user@example.com", "createdAt": "2023-10-27T10:00:00Z" } ] } ``` ``` -------------------------------- ### apiV1ProxyBindingsGet Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/docs/ProxyBindingApi.md Retrieves a list of all configured proxy email bindings. This is useful for auditing or managing existing email forwarding rules. ```APIDOC ## GET /api/v1/proxy-bindings ### Description List of proxy emails ### Method GET ### Endpoint /api/v1/proxy-bindings ### Parameters This endpoint does not need any parameters. ### Response #### Success Response (200) - **data** (ApiV1ProxyBindingsGet200Response) - Description of the response body #### Response Example { "example": "ApiV1ProxyBindingsGet200Response object" } ``` -------------------------------- ### ApiV1ApiTokenGet200Response Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/docs/ApiV1ApiTokenGet200Response.md Represents the structure of a successful API token response. ```APIDOC ## GET /api/v1/api/token ### Description Retrieves an API token. This endpoint is used to obtain authentication tokens for accessing the API. ### Method GET ### Endpoint /api/v1/api/token ### Response #### Success Response (200) - **token** (String) - The API token. This field is optional. ``` -------------------------------- ### Create Proxy Binding Payload Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/README.md This function constructs the payload for creating a proxy binding, specifying the callback URL and optionally real email addresses for forwarding. ```javascript //callback construction function function createProxyBindingPayload(callbackUrl) { return ProxiedMailApi.ProxyBindingCreate.constructFromObject( { "data":{ "type":"proxy_bindings", "attributes":{ "real_addresses":[], //on empty it will generate internal real address //that kind of real addresses is not forwarding anything to any email //however if you need forwarding just use something like "abc@example.com" //please note that real address should be confirmed "proxy_address": null, "callback_url": callbackUrl } } } ); } ``` -------------------------------- ### addProxyBinding Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/docs/ProxyBindingApi.md Creates a new proxy email binding. This operation allows users to set up email forwarding or aliasing rules. ```APIDOC ## POST /api/v1/proxy-bindings ### Description Create proxy-email ### Method POST ### Endpoint /api/v1/proxy-bindings ### Parameters #### Request Body - **proxyBindingCreate** ([ProxyBindingCreate]) - Optional - ### Request Example { "proxyBindingCreate": [ { "example": "ProxyBindingCreate object" } ] } ### Response #### Success Response (200) - **data** (AddProxyBinding200Response) - Description of the response body #### Response Example { "example": "AddProxyBinding200Response object" } ``` -------------------------------- ### GetCallback Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/docs/GetCallback.md Retrieves callback information with optional filtering parameters. ```APIDOC ## GetCallback ### Description Retrieves callback information. This method allows for optional filtering based on status, payload, code, whether it was received, and the method used. ### Method GET ### Endpoint /callback ### Parameters #### Query Parameters - **status** (String) - Optional - Filters callbacks by their status. - **payload** (Object) - Optional - Filters callbacks by their payload. - **code** (String) - Optional - Filters callbacks by their code. - **isReceived** (Boolean) - Optional - Filters callbacks by their received status. - **method** (String) - Optional - Filters callbacks by the method used. ### Response #### Success Response (200) - **status** (String) - The status of the callback. - **payload** (Object) - The payload associated with the callback. - **code** (String) - The code of the callback. - **isReceived** (Boolean) - Indicates if the callback was received. - **method** (String) - The method used for the callback. ``` -------------------------------- ### List Proxy Emails Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/README.md Retrieves a list of all proxy email bindings. This endpoint is part of the ProxyBindingApi class. ```APIDOC ## GET /api/v1/proxy-bindings ### Description List of proxy emails ### Method GET ### Endpoint /api/v1/proxy-bindings ### Parameters ### Request Example ### Response #### Success Response (200) #### Response Example ``` -------------------------------- ### ProxyBindingCreateData Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/docs/ProxyBindingCreateData.md Represents the data structure for creating a proxy binding, including its type and attributes. ```APIDOC ## ProxyBindingCreateData ### Description Represents the data structure for creating a proxy binding. It includes optional type and attributes fields. ### Properties #### type (String) - Optional Specifies the type of the object. For proxy bindings, the allowed value is `proxy_bindings`. #### attributes (ProxyBindingCreateDataAttributes) - Optional Contains the attributes for the proxy binding, defined in the `ProxyBindingCreateDataAttributes` structure. ### Enum: TypeEnum * `proxy_bindings` (value: `"proxy_bindings"`) ``` -------------------------------- ### List Proxy Emails Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/docs/ProxyBindingApi.md Retrieve a list of all configured proxy emails. API key authentication is required. ```javascript import ProxiedMailApi from 'proxied_mail_api'; let defaultClient = ProxiedMailApi.ApiClient.instance; // Configure API key authorization: api_key let api_key = defaultClient.authentications['api_key']; api_key.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //api_key.apiKeyPrefix = 'Token'; let apiInstance = new ProxiedMailApi.ProxyBindingApi(); apiInstance.apiV1ProxyBindingsGet((error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }); ``` -------------------------------- ### User Authorization Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/README.md Authenticates a user. This endpoint is part of the UserApi class. ```APIDOC ## POST /api/v1/auth ### Description Auhtorization ### Method POST ### Endpoint /api/v1/auth ### Parameters ### Request Example ### Response #### Success Response (200) #### Response Example ``` -------------------------------- ### AddProxyBinding200ResponseMeta Properties Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/docs/AddProxyBinding200ResponseMeta.md This snippet details the properties available in the AddProxyBinding200ResponseMeta object, which are optional boolean flags indicating the status of email sending and the first proxy binding. ```APIDOC ## AddProxyBinding200ResponseMeta ### Description Represents the metadata returned in a successful (200) response from the AddProxyBinding API. It contains optional flags related to email verification and the status of the first proxy binding. ### Properties #### isVerificationEmailSend (Boolean) - Optional Indicates whether a verification email has been sent. #### firstProxyBinding (Boolean) - Optional Indicates if this is the first proxy binding being created. ``` -------------------------------- ### CreatedCallback Properties Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/docs/CreatedCallback.md The CreatedCallback object allows for optional configuration of status, callback URLs, and identifiers for event notifications. ```APIDOC ## CreatedCallback Object ### Description Represents a callback configuration for events, allowing for optional status, URL, and ID specifications. ### Properties #### status (String) - Optional * Description: Represents the status of the callback. #### callUrl (String) - Optional * Description: The URL to be called for the event notification. #### getUrl (String) - Optional * Description: The URL to retrieve event details. #### id (String) - Optional * Description: A unique identifier for the callback configuration. ``` -------------------------------- ### ApiV1ReceivedEmailsLinksProxyBindingIdGet200Response Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/docs/ApiV1ReceivedEmailsLinksProxyBindingIdGet200Response.md Represents the structure of a successful response (HTTP 200 OK) when fetching links associated with a proxied received email using its binding ID. It includes optional fields for type, id, and attributes. ```APIDOC ## GET /api/v1/received-emails/links/{proxyBindingId} ### Description Retrieves links associated with a proxied received email using its unique binding ID. ### Method GET ### Endpoint `/api/v1/received-emails/links/{proxyBindingId}` ### Parameters #### Path Parameters - **proxyBindingId** (string) - Required - The unique identifier for the proxied received email. ### Response #### Success Response (200) - **type** (string) - Optional - The type of the response object. - **id** (string) - Optional - The unique identifier of the response object. - **attributes** (ApiV1ReceivedEmailsLinksProxyBindingIdGet200ResponseAttributes) - Optional - An object containing the attributes of the received email links. ``` -------------------------------- ### Add Callback Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/README.md Adds a callback URL for receiving notifications. This endpoint is part of the CallbackApi class. ```APIDOC ## POST /api/v1/callback ### Description Auhtorization ### Method POST ### Endpoint /api/v1/callback ### Parameters ### Request Example ### Response #### Success Response (200) #### Response Example ``` -------------------------------- ### apiV1ReceivedEmailsLinksProxyBindingIdGet Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/docs/ReceivedEmailApi.md Retrieves a list of received emails associated with a specific proxy email binding. This endpoint returns the last 55 emails. ```APIDOC ## GET /api/v1/received-emails-links/{proxyBindingId} ### Description Get received emails list by proxy email (last 55) ### Method GET ### Endpoint /api/v1/received-emails-links/{proxyBindingId} ### Parameters #### Path Parameters - **proxyBindingId** (String) - Required - proxyBindingId of proxy email that needs to be fetched ### Response #### Success Response (200) - **ApiV1ReceivedEmailsLinksProxyBindingIdGet200Response** - Description of the response type ### Authorization api_key ``` -------------------------------- ### addCallback Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/docs/CallbackApi.md Adds a new callback. This endpoint is used to register a callback URL for receiving notifications. It requires API authentication. ```APIDOC ## POST /api/v1/callback ### Description Registers a callback URL for receiving notifications. Requires API authentication. ### Method POST ### Endpoint /api/v1/callback ### Parameters This endpoint does not require any parameters. ### Request Example ```javascript import ProxiedMailApi from 'proxied_mail_api'; let defaultClient = ProxiedMailApi.ApiClient.instance; // Configure Bearer access token for authorization: api_auth let api_auth = defaultClient.authentications['api_auth']; api_auth.accessToken = "YOUR ACCESS TOKEN" let apiInstance = new ProxiedMailApi.CallbackApi(); apiInstance.addCallback((error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }); ``` ### Response #### Success Response (200) - **data** (CreatedCallback) - Details of the created callback. #### Response Example (Response structure depends on the CreatedCallback object definition) ### Authorization api_auth ``` -------------------------------- ### apiV1CallbackGetHashGet Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/docs/CallbackApi.md Retrieves callback details using its unique hash. This endpoint is protected by API key authorization. ```APIDOC ## GET /api/v1/callback/get/{hash} ### Description Retrieves the details of a specific callback using its unique hash. Requires API key authorization. ### Method GET ### Endpoint /api/v1/callback/get/{hash} ### Parameters #### Path Parameters - **hash** (String) - Required - The unique hash identifier for the callback. ### Request Example ```javascript import ProxiedMailApi from 'proxied_mail_api'; let defaultClient = ProxiedMailApi.ApiClient.instance; // Configure API key authorization: api_key let api_key = defaultClient.authentications['api_key']; api_key.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //api_key.apiKeyPrefix = 'Token'; let apiInstance = new ProxiedMailApi.CallbackApi(); let hash = "hash_example"; // String | Callback hash apiInstance.apiV1CallbackGetHashGet(hash, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }); ``` ### Response #### Success Response (200) - **data** (GetCallback) - Details of the requested callback. #### Response Example (Response structure depends on the GetCallback object definition) ### Authorization api_key ``` -------------------------------- ### Webpack Configuration to Disable AMD Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/README.md Configure Webpack to disable the AMD loader to resolve module errors. ```javascript module: { rules: [ { parser: { amd: false } } ] } ``` -------------------------------- ### patchProxyBinding Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/docs/ProxyBindingApi.md Updates an existing proxy email binding identified by its ID. Allows modification of forwarding or aliasing rules. ```APIDOC ## PATCH /api/v1/proxy-bindings/{id} ### Description Update proxy-email ### Method PATCH ### Endpoint /api/v1/proxy-bindings/{id} ### Parameters #### Path Parameters - **id** (String) - Required - ID of proxy-email that needs to be fetched #### Request Body - **patchProxyBindingRequestInner** ([PatchProxyBindingRequestInner]) - Optional - ### Request Example { "patchProxyBindingRequestInner": [ { "example": "PatchProxyBindingRequestInner object" } ] } ### Response #### Success Response (200) - **data** (AddProxyBinding200Response) - Description of the response body #### Response Example { "example": "AddProxyBinding200Response object" } ``` -------------------------------- ### AuthRequestDataAttributes Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/docs/AuthRequestDataAttributes.md Defines the attributes used in authentication requests, including optional username and password fields. ```APIDOC ## AuthRequestDataAttributes ### Description Represents the data structure for authentication requests. ### Properties #### Optional Properties - **username** (String) - The username for authentication. - **password** (String) - The password for authentication. ``` -------------------------------- ### OauthAccessTokenDataAttributes Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/docs/OauthAccessTokenDataAttributes.md Represents the data attributes associated with an OAuth access token. ```APIDOC ## OauthAccessTokenDataAttributes ### Description This object contains the attributes of an OAuth access token. ### Properties #### token - **Type**: String - **Description**: The access token string. - **Notes**: [optional] #### expiresAt - **Type**: String - **Description**: The timestamp when the access token expires. - **Notes**: [optional] #### _2faGranted - **Type**: Number - **Description**: Indicates if two-factor authentication was granted. - **Notes**: [optional] #### isNewAcc - **Type**: Boolean - **Description**: Indicates if this is for a new account. - **Notes**: [optional] ``` -------------------------------- ### Update Proxy Binding Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/README.md Updates an existing proxy email binding. This endpoint is part of the ProxyBindingApi class. ```APIDOC ## PATCH /api/v1/proxy-bindings/{id} ### Description Update proxy-email ### Method PATCH ### Endpoint /api/v1/proxy-bindings/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the proxy binding to update ### Request Example ### Response #### Success Response (200) #### Response Example ``` -------------------------------- ### Callback Notification for Received Email Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/README.md This JSON structure represents a callback notification received by the application when an email is sent to a proxy address. It includes details about the email's status and payload. ```json { "status":"ok", "payload":{ "id":"C83643D7-D500-0000-00003CC8", "payload":{ "Content-Type":"multipart/alternative; boundary=\"0000000000007777f3060f55ba65\"", "Date":"Sat, 20 Jan 2024 00:32:04 +0000", "Dkim-Signature":"....", "From":"Alex Yatsenko ", "Message-Id":"", "Mime-Version":"1.0", "Received":"....", "Subject":"hey hey", "To":"ee71fb6c2@proxiedmail.com", "body-html":"
hello mate
\r\n", "body-plain":"hello mate\r\n", "domain":"proxiedmail.com", "from":"Alex Yatsenko ", "recipient":"ee71fb6c2@proxiedmail.com", "sender":"yatsenkolesh@gmail.com", "signature":"ea0e415659f5bfbcd3d27a06806d6444005ed019656c9407e444872f0e64a0c2", "stripped-html":"
hello mate
\n", "stripped-text":"hello mate", "subject":"hey hey", "timestamp":"1705710737", "token":"7b6c2bba30f805bd01596016b748aaa9af43d9e748c4c2a67c" }, "attachments":[ ], "recipient":{ "address":"ee71fb6c2@proxiedmail.com" }, "receivedAt":"Sat Jan 20 2024 00:32:17 GMT+0000", "user":{ "id":"1B3AAA43-0000-0000-00009BC6", "username":"example-proxiedmail-user-email@com", "token":"Bearer ..." } }, "code":"ok", "is_received":true, "method":"POST" } ``` -------------------------------- ### apiV1ReceivedEmailsReceivedEmailIdGet Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/docs/ReceivedEmailApi.md Retrieves the full content of a specific received email using its unique identifier. ```APIDOC ## GET /api/v1/received-emails/{receivedEmailId} ### Description Get content of received email by id ### Method GET ### Endpoint /api/v1/received-emails/{receivedEmailId} ### Parameters #### Path Parameters - **receivedEmailId** (String) - Required - receivedEmailId of received email that needs to be fetched ### Response #### Success Response (200) - **ApiV1ReceivedEmailsReceivedEmailIdGet200Response** - Description of the response type ### Authorization api_key ``` -------------------------------- ### Update Proxy Email Binding Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/docs/ProxyBindingApi.md Update an existing proxy email binding using its ID. This operation requires API key authentication. ```javascript import ProxiedMailApi from 'proxied_mail_api'; let defaultClient = ProxiedMailApi.ApiClient.instance; // Configure API key authorization: api_key let api_key = defaultClient.authentications['api_key']; api_key.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //api_key.apiKeyPrefix = 'Token'; let apiInstance = new ProxiedMailApi.ProxyBindingApi(); let id = "id_example"; // String | ID of proxy-email that needs to be fetched let opts = { 'patchProxyBindingRequestInner': [new ProxiedMailApi.PatchProxyBindingRequestInner()] // [PatchProxyBindingRequestInner] | }; apiInstance.patchProxyBinding(id, opts, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }); ``` -------------------------------- ### ReceivedEmailAttachment Source: https://github.com/proxied-mail/proxiedmail-js-client/blob/main/docs/ApiV1ReceivedEmailsReceivedEmailIdGet200ResponseAttributesAttachmentsInner.md Represents an attachment associated with a received email. This object contains a URL to access the attachment. ```APIDOC ## ReceivedEmailAttachment Object ### Description Represents an attachment associated with a received email. This object contains a URL to access the attachment. ### Properties #### url - **url** (String) - Optional - The URL to access the attachment. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.