Skip to content

Latest commit

 

History

History
382 lines (259 loc) · 10.1 KB

File metadata and controls

382 lines (259 loc) · 10.1 KB

egoisdk.PushApi

All URIs are relative to https://api.egoiapp.com

Method HTTP request Description
actionSendPush POST /campaigns/push/{campaign_hash}/actions/send Send push message
createPushCampaign POST /campaigns/push Create new push campaign
getPushApp GET /push/apps/{app_id} Get a Push application from E-goi
getPushApps GET /push/apps Get all Push applications from E-goi
patchPushCampaign PATCH /campaigns/push/{campaign_hash} Update a specific push campaign
registerPushEvent POST /push/apps/{app_id}/event Registers an event from the push notification.
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

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 Parameters for the 'send push' action

Return type

AcceptedResponse

Authorization

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

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 Parameters for the push campaign

Return type

HashcodeCampaign

Authorization

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

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

Authorization

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

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]

Authorization

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

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 Parameters for the push campaign

Return type

HashcodeCampaign

Authorization

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

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 Parameters for the event

Return type

PushResponse

Authorization

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

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 Parameters for the token

Return type

PushResponse

Authorization

Apikey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json