API
Docs and API's for Weasy.io
Newsletter
Manage all the newsletter subscription in your website.Accepts GET POST PUT DELETE
All requests to the API must be authenticated with an API key on the HTTP Authorization header.
GET
Get all files from website filemanagerRequest example
~ curl -i -X GET \
-H 'X-API-KEY:xsFPVLn7aOllXixPDaGBgCZpyTmyX7G6CniNtKD' \
-H 'Content-Type:application/json' \
https://api.weasy.io/v1/newsletter
-H 'X-API-KEY:xsFPVLn7aOllXixPDaGBgCZpyTmyX7G6CniNtKD' \
-H 'Content-Type:application/json' \
https://api.weasy.io/v1/newsletter
Body response example [ HTTP CODE: 200 ]
Path parameters
| NAME | TYPE | REQUIRED | DESCRIPTION |
|---|---|---|---|
| limit | integer | optional | define items per page |
| page | integer | optional | define page to display |
POST
Add a contact or collection of contacts to your newsletter database.Request example
~ curl -i -X POST \
-H 'X-API-KEY:xsFPVLn7aOllXixPDaGBgCZpyTmyX7G6CniNtKD' \
-H 'Content-Type:application/json' \
-d '[{"name":"Contact 1","email":"email1@weasy.io","status":1,"lang":"en"},{"name":"Contact 2","email":"email2@weasy.io","status":0,"lang":"en"}]'\
https://api.weasy.io/v1/newsletter
-H 'X-API-KEY:xsFPVLn7aOllXixPDaGBgCZpyTmyX7G6CniNtKD' \
-H 'Content-Type:application/json' \
-d '[{"name":"Contact 1","email":"email1@weasy.io","status":1,"lang":"en"},{"name":"Contact 2","email":"email2@weasy.io","status":0,"lang":"en"}]'\
https://api.weasy.io/v1/newsletter
Body response example [ HTTP CODE: 200 ]
Body attributes
A json payload containing the following attributes.| NAME | TYPE | REQUIRED | DESCRIPTION |
|---|---|---|---|
| name | string | optional | define name of the contact |
| string | required | define the email of the contact | |
| status | integer | required | define the status of the contact. options: 1 for active, 0 for inactive |
| lang | string | optional | define the language of the contact options: all the iso country codes (ISO 3166-2) obtained from the Languages endpoint |
PUT
Change a contact from your newsletter database.Request example
~ curl -i -X POST \
-H 'X-API-KEY:xsFPVLn7aOllXixPDaGBgCZpyTmyX7G6CniNtKD' \
-H 'Content-Type:application/json' \
-d '{"name":"Contact 1 changed","email":"email1@weasy.io","status":1,"lang":"en"}'\
https://api.weasy.io/v1/newsletter/1
-H 'X-API-KEY:xsFPVLn7aOllXixPDaGBgCZpyTmyX7G6CniNtKD' \
-H 'Content-Type:application/json' \
-d '{"name":"Contact 1 changed","email":"email1@weasy.io","status":1,"lang":"en"}'\
https://api.weasy.io/v1/newsletter/1
Body response example [ HTTP CODE: 200 ]
Path parameters
| NAME | TYPE | REQUIRED | DESCRIPTION |
|---|---|---|---|
| id | integer | required | contact id |
Body attributes
A json payload containing the following attributes.| NAME | TYPE | REQUIRED | DESCRIPTION |
|---|---|---|---|
| name | string | optional | define name of the contact |
| string | required | define the email of the contact | |
| status | integer | required | define the status of the contact. options: 1 for active, 0 for inactive |
| lang | string | optional | define the language of the contact options: all the iso country codes (ISO 3166-2) obtained from the Languages endpoint |
DELETE
Delete a contact or collection of contacts from your newsletter database.Request example
~ curl -i -X DELETE \
-H 'X-API-KEY:xsFPVLn7aOllXixPDaGBgCZpyTmyX7G6CniNtKD' \
-H 'Content-Type:application/json' \
-d '["email1@weasy.io","email2@weasy.io"]'\
https://api.weasy.io/v1/newsletter
-H 'X-API-KEY:xsFPVLn7aOllXixPDaGBgCZpyTmyX7G6CniNtKD' \
-H 'Content-Type:application/json' \
-d '["email1@weasy.io","email2@weasy.io"]'\
https://api.weasy.io/v1/newsletter
Body response example [ HTTP CODE: 200 ]
Body attributes
| Attribute description |
|---|
| A json payload containing an array of file or files. |