@green-frog/mailmkt-api
v1.0.1
Published
Contrato path-preserving `/mailmkt/api`. ## Rate limits (Laravel throttle) | Escopo | Limite | Rotas | |--------|--------|-------| | Emissão de token | **5 req/min** por IP | `POST /token` | | API autenticada | **60 req/min** por token | demais rotas co
Readme
green-mailmkt-sdk
GreenMailmktSdk - JavaScript client for green-mailmkt-sdk
Contrato path-preserving /mailmkt/api (paridade EV-INT-007).
Rate limits (Laravel throttle)
| Escopo | Limite | Rotas |
|--------|--------|-------|
| Emissão de token | 5 req/min por IP | POST /token |
| API autenticada | 60 req/min por token | demais rotas com Bearer |
Resposta 429 Too Many Requests quando excedido (header Retry-After quando aplicável).
Erros tipados usam TypedApiError (message, code, request_id) quando aplicável.
Paginação (listas)
GET /listacampanhas e GET /listatemplates retornam envelope data + meta + links.
Query params: page (default 1), per_page (default 15, max 100),
filter[nome], filter[ativo], sort (ex. nome, -created_at).
This SDK is automatically generated by the OpenAPI Generator project:
- API version: 1.0.0
- Package version: 1.0.0
- Generator version: 7.12.0
- Build package: org.openapitools.codegen.languages.JavascriptClientCodegen
Installation
For Node.js
npm
To publish the library as a npm, please follow the procedure in "Publishing npm packages".
Then install it via:
npm install green-mailmkt-sdk --saveFinally, you need to build the module:
npm run buildLocal development
To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing package.json (and this README). Let's call this JAVASCRIPT_CLIENT_DIR. Then run:
npm installNext, link it globally in npm with the following, also from JAVASCRIPT_CLIENT_DIR:
npm linkTo use the link you just defined in your project, switch to the directory you want to use your green-mailmkt-sdk from, and run:
npm link /path/to/<JAVASCRIPT_CLIENT_DIR>Finally, you need to build the module:
npm run buildgit
If the library is hosted at a git repository, e.g.https://github.com/GIT_USER_ID/GIT_REPO_ID then install it via:
npm install GIT_USER_ID/GIT_REPO_ID --saveFor browser
The library also works in the browser environment via npm and browserify. After following
the above steps with Node.js and installing browserify with npm install -g browserify,
perform the following (assuming main.js is your entry file):
browserify main.js > bundle.jsThen include bundle.js in the HTML pages.
Webpack Configuration
Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:
module: {
rules: [
{
parser: {
amd: false
}
}
]
}Getting Started
Please follow the installation instruction and execute the following JS code:
var GreenMailmktSdk = require('green-mailmkt-sdk');
var api = new GreenMailmktSdk.AuthApi()
var issueMailmktApiTokenRequest = new GreenMailmktSdk.IssueMailmktApiTokenRequest(); // {IssueMailmktApiTokenRequest}
api.issueMailmktApiToken(issueMailmktApiTokenRequest).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Documentation for API Endpoints
All URIs are relative to /mailmkt/api
Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- GreenMailmktSdk.AuthApi | issueMailmktApiToken | POST /token | Emitir token Sanctum GreenMailmktSdk.CatlogoApi | listMailmktCampanhas | GET /listacampanhas | Listar campanhas do cliente do token GreenMailmktSdk.CatlogoApi | listMailmktTemplates | GET /listatemplates | Listar templates do cliente do token GreenMailmktSdk.DocumentaoApi | getMailmktOpenApiSpecification | GET /openapi.yaml | Especificação OpenAPI desta API GreenMailmktSdk.ProcessamentoApi | getMailmktProcessingQuantities | GET /processamento/{id}/quantidades | Contadores do processamento GreenMailmktSdk.ProcessamentoApi | getMailmktProcessingStatus | GET /processamento/{id}/status | Status do processamento GreenMailmktSdk.ProcessamentoApi | insertMailmktProcessing | POST /inserir | Criar processamento (JSON ou CSV) GreenMailmktSdk.ProcessamentoApi | scheduleMailmktProcessing | POST /processamento/{id}/agendar | Agendar disparo (estágio PROCESSADO)
Documentation for Models
- GreenMailmktSdk.AgendarResponse
- GreenMailmktSdk.CampanhaListItem
- GreenMailmktSdk.InserirRequest
- GreenMailmktSdk.InserirResponse
- GreenMailmktSdk.InsertMailmktProcessing422Response
- GreenMailmktSdk.IssueMailmktApiTokenRequest
- GreenMailmktSdk.PaginatedCampanhaList
- GreenMailmktSdk.PaginatedTemplateList
- GreenMailmktSdk.PaginationLinks
- GreenMailmktSdk.PaginationMeta
- GreenMailmktSdk.QuantidadesResponse
- GreenMailmktSdk.ScheduleMailmktProcessingRequest
- GreenMailmktSdk.StatusResponse
- GreenMailmktSdk.TemplateListItem
- GreenMailmktSdk.TokenResponse
- GreenMailmktSdk.TypedApiError
Documentation for Authorization
Authentication schemes defined for the API:
sanctum
- Type: Bearer authentication (Sanctum)
