MigaPushApi
Il funzionamento di questo modulo è semplice ed estremamente utile.
Grazie all’utilizzo di due specifiche API consente ad applicazioni esterne di inviare:
- notifiche push a singoli utenti di una app tramite l’indirizzo email di registrazione
- l’elenco degli utenti registrati di una specifica app della tua piattaforma siberian
Impostazioni
Una volta installato il modulo, Il pannello delle impostazioni è raggiungibile dal frontend dell’app builder. Dal menu verticale a sinistra, sezione Moduli, fai clic su Miga Push Api.
Da questa schermata l’unica scelta da effettuare è il numero massimo di push per minuto.
Note:
- API URL For Send Individual Push da utilizzare con post request, i cinque campi {`app_id`, `token`, `message`, `subject`, ‘email’} sono obbligatori ma “email” è il più importante.
- API URL Get Users List da utilizzare con post request, i due campi {`app_id`, `token`} sono obbligatori.
User List
Description
Fetch all the users available for sending Push notifications.
$endpoint = "https://www.domain.com/migapushapi/public_apiusers/init"
Request
| Param | Type | 
|---|---|
| app_id | int | 
| token | string | 
Response
Example

Send Individual Push
Description
Sends an individual push notification via user email.
$endpoint = "http://www.domain.com/migapushapi/public_api/init"Request
| Param | Type | Details | 
|---|---|---|
| subject * | string | Push title | 
| message * | string | Push message | 
| app_id * | int | |
| token * | string | |
| email * | string | |
| devices | string | all,android,ios | 
| open_url | int | If set to 1 url will be opened in app | 
| url | string | Along with open_urlset to 1, the url to open | 
| cover | string | base64 encoded image to display as a cover, must be png or jpg | 
Cover Image BASE64 Conversion Steps.
- Go to BASE64 Conversion link
- Choose a cover image (jpg, png)
- Select output type format (Data URI — data:content/type;base64)
- Click on encode image button.
ESEMPIO IMPLEMENTAZIONE PHP
For Get User List
<?php
?>
For Send Push Notification
<?php
?>
ESEMPIO IMPLEMENTAZIONE Javascript
For Get User List
Success Response
All Response
| Response | Details | 
|---|---|
| 1 | Successful | 
| 0 | Wrong/Missing Token | 
| 2 | App ID is missing | 
| 3 | Email is missing” | 
| 4 | Email User hasn’t a push token | 
| 5 | Message field is empty | 
| 6 | Subject is missing | 
| 7 | Url is missing (if field OpenUrl is 1 value and Url is empty) | 
| 8 | Wrong Cover Image base64 encoded image to display as a cover, must be png or jpg | 
| 9 | Invalid Request | 
| 10 | Invalid Parameter(s) Found. | 
| 11 | Already user send max push plz wait one minute | 
| 12 | Email does not exists | 
Example

LINK: https://support.migastone.com/it/hrf_faq/migapushapi-2/


