# egoisdk.PushApi All URIs are relative to *https://api.egoiapp.com* Method | HTTP request | Description ------------- | ------------- | ------------- [**actionSendPush**](PushApi.md#actionSendPush) | **POST** /campaigns/push/{campaign_hash}/actions/send | Send push message [**createPushCampaign**](PushApi.md#createPushCampaign) | **POST** /campaigns/push | Create new push campaign [**getPushApp**](PushApi.md#getPushApp) | **GET** /push/apps/{app_id} | Get a Push application from E-goi [**getPushApps**](PushApi.md#getPushApps) | **GET** /push/apps | Get all Push applications from E-goi [**patchPushCampaign**](PushApi.md#patchPushCampaign) | **PATCH** /campaigns/push/{campaign_hash} | Update a specific push campaign [**registerPushEvent**](PushApi.md#registerPushEvent) | **POST** /push/apps/{app_id}/event | Registers an event from the push notification. [**registerPushToken**](PushApi.md#registerPushToken) | **POST** /push/apps/{app_id}/token | Registers a Firebase token ## actionSendPush > AcceptedResponse actionSendPush(campaignHash, campaignPushSendRequest) Send push message Deploys and sends a push message ### Example ```javascript import egoisdk from 'egoisdk'; let defaultClient = egoisdk.ApiClient.instance; // Configure API key authorization: Apikey let Apikey = defaultClient.authentications['Apikey']; Apikey.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //Apikey.apiKeyPrefix = 'Token'; let apiInstance = new egoisdk.PushApi(); let campaignHash = "campaignHash_example"; // String | Hash of the Campaign let campaignPushSendRequest = new egoisdk.CampaignPushSendRequest(); // CampaignPushSendRequest | Parameters for the 'send push' action apiInstance.actionSendPush(campaignHash, campaignPushSendRequest, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **campaignHash** | **String**| Hash of the Campaign | **campaignPushSendRequest** | [**CampaignPushSendRequest**](CampaignPushSendRequest.md)| Parameters for the 'send push' action | ### Return type [**AcceptedResponse**](AcceptedResponse.md) ### Authorization [Apikey](../README.md#Apikey) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## createPushCampaign > HashcodeCampaign createPushCampaign(pushCampaignPostRequest) Create new push campaign Create a new push campaign ### Example ```javascript import egoisdk from 'egoisdk'; let defaultClient = egoisdk.ApiClient.instance; // Configure API key authorization: Apikey let Apikey = defaultClient.authentications['Apikey']; Apikey.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //Apikey.apiKeyPrefix = 'Token'; let apiInstance = new egoisdk.PushApi(); let pushCampaignPostRequest = new egoisdk.PushCampaignPostRequest(); // PushCampaignPostRequest | Parameters for the push campaign apiInstance.createPushCampaign(pushCampaignPostRequest, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **pushCampaignPostRequest** | [**PushCampaignPostRequest**](PushCampaignPostRequest.md)| Parameters for the push campaign | ### Return type [**HashcodeCampaign**](HashcodeCampaign.md) ### Authorization [Apikey](../README.md#Apikey) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## getPushApp > AppStructure getPushApp(appId) Get a Push application from E-goi Get a Push application from E-goi ### Example ```javascript import egoisdk from 'egoisdk'; let defaultClient = egoisdk.ApiClient.instance; // Configure API key authorization: Apikey let Apikey = defaultClient.authentications['Apikey']; Apikey.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //Apikey.apiKeyPrefix = 'Token'; let apiInstance = new egoisdk.PushApi(); let appId = "appId_example"; // String | ID of the E-goi push app. apiInstance.getPushApp(appId, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **appId** | **String**| ID of the E-goi push app. | ### Return type [**AppStructure**](AppStructure.md) ### Authorization [Apikey](../README.md#Apikey) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ## getPushApps > [AppStructure] getPushApps(opts) Get all Push applications from E-goi Get all Push applications from E-goi ### Example ```javascript import egoisdk from 'egoisdk'; let defaultClient = egoisdk.ApiClient.instance; // Configure API key authorization: Apikey let Apikey = defaultClient.authentications['Apikey']; Apikey.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //Apikey.apiKeyPrefix = 'Token'; let apiInstance = new egoisdk.PushApi(); let opts = { 'listId': 56 // Number | ID of the list to search for. }; apiInstance.getPushApps(opts, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **listId** | **Number**| ID of the list to search for. | [optional] ### Return type [**[AppStructure]**](AppStructure.md) ### Authorization [Apikey](../README.md#Apikey) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ## patchPushCampaign > HashcodeCampaign patchPushCampaign(campaignHash, pushCampaignPatchRequest) Update a specific push campaign Update push campaign ### Example ```javascript import egoisdk from 'egoisdk'; let defaultClient = egoisdk.ApiClient.instance; // Configure API key authorization: Apikey let Apikey = defaultClient.authentications['Apikey']; Apikey.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //Apikey.apiKeyPrefix = 'Token'; let apiInstance = new egoisdk.PushApi(); let campaignHash = "campaignHash_example"; // String | Hash of the Campaign let pushCampaignPatchRequest = new egoisdk.PushCampaignPatchRequest(); // PushCampaignPatchRequest | Parameters for the push campaign apiInstance.patchPushCampaign(campaignHash, pushCampaignPatchRequest, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **campaignHash** | **String**| Hash of the Campaign | **pushCampaignPatchRequest** | [**PushCampaignPatchRequest**](PushCampaignPatchRequest.md)| Parameters for the push campaign | ### Return type [**HashcodeCampaign**](HashcodeCampaign.md) ### Authorization [Apikey](../README.md#Apikey) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## registerPushEvent > PushResponse registerPushEvent(appId, pushEvent) Registers an event from the push notification. Registers a Firebase token ### Example ```javascript import egoisdk from 'egoisdk'; let defaultClient = egoisdk.ApiClient.instance; // Configure API key authorization: Apikey let Apikey = defaultClient.authentications['Apikey']; Apikey.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //Apikey.apiKeyPrefix = 'Token'; let apiInstance = new egoisdk.PushApi(); let appId = "appId_example"; // String | ID of the E-goi push app. let pushEvent = new egoisdk.PushEvent(); // PushEvent | Parameters for the event apiInstance.registerPushEvent(appId, pushEvent, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **appId** | **String**| ID of the E-goi push app. | **pushEvent** | [**PushEvent**](PushEvent.md)| Parameters for the event | ### Return type [**PushResponse**](PushResponse.md) ### Authorization [Apikey](../README.md#Apikey) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## registerPushToken > PushResponse registerPushToken(appId, pushToken) Registers a Firebase token Registers a Firebase token ### Example ```javascript import egoisdk from 'egoisdk'; let defaultClient = egoisdk.ApiClient.instance; // Configure API key authorization: Apikey let Apikey = defaultClient.authentications['Apikey']; Apikey.apiKey = 'YOUR API KEY'; // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //Apikey.apiKeyPrefix = 'Token'; let apiInstance = new egoisdk.PushApi(); let appId = "appId_example"; // String | ID of the E-goi push app. let pushToken = new egoisdk.PushToken(); // PushToken | Parameters for the token apiInstance.registerPushToken(appId, pushToken, (error, data, response) => { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }); ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **appId** | **String**| ID of the E-goi push app. | **pushToken** | [**PushToken**](PushToken.md)| Parameters for the token | ### Return type [**PushResponse**](PushResponse.md) ### Authorization [Apikey](../README.md#Apikey) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json