-
Notifications
You must be signed in to change notification settings - Fork 71
Servers
Igor Balos edited this page Oct 1, 2018
·
6 revisions
For these API requests you will need to use a account API token. Once you obtain it, you will need to use account API client.
account_token = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
client = Postmark::AccountApiClient.new(account_token, secure: true)
Get server by ID
client.get_server(1)
# => { "ID": 1,"Name": "Staging Testing", "Color": "Red" ...}
Create server
server = new Server();
server.setName("NewServerName");
// create server
server = client.createServer(server);
Update server
server = new Server();
server.setName("CompletelyNewName");
// set server
server = client.setServer(serverId, server);
Get list of servers
Servers servers = client.getServers(Parameters.init().build("count", 5).build("offset", 0));
System.out.println(servers.getServers().get(0).getColor());
Delete a server
String response = client.deleteServer(serverId);
For additional information about the capabilities of the Postmark API, see Postmark Developers Documentation.
- Email sending
- Test email sending
- Bounces
- Templates
- Templates push
- Server
- Servers
- Message Streams
- Webhooks
- Messages
- Domains
- Sender Signatures
- Stats
- Trigger Tags
- Suppressions
- Data Removals
- Trigger Inbound Rules
- Parsing Inbound
- Using Postmark with Mail library
- Accessing Postmark Message ID
- Error Handling
- Integration Testing
- Troubleshooting
- Known issues and how to resolve them