Open buschtoens opened 10 years ago
Thanks for this list. Can you please elaborate more on the buggy-ness of bulk members add? If there is a failing test please create an issue with any relevant code. Or do you mean the api method is somehow impractical (ie. add()
)? Any better suggestions? I will try and get to the missing functionality as I can. Adding to schema is pretty trivial. It's just a matter of writing the tests and testing it all out that's a bit time consuming. Of course PR's are always welcome too. There are also the generic REST methods to accommodate missing endpoints. Thanks again.
tbh, I haven't tried member bulk adding yet, but in the docs, Mailgun states that you'll have to use POST /lists/<address>/members.json
for that. But in the schema.js you're using POST /lists/{address}/members
(missing the .json
).
Ooh that's a bug! I'll fix it soon. Thanks.
Oh actually I forgot... it's handled in build.js
:
// HACKY special case for members bulk add
if(action.href === '/lists/{address}/members' && actionName === 'add') {
action.href = '/lists/{address}/members.json'
}
I'll try and improve this.
@bojand Appreciate the great library. Seems like a number of endpoints are still missing, any plan to cover the rest?
Hello, yes as I can get to them. It's a bit time consuming to cover the tests for some of these. I have updated this list with some additions I implemented some time ago (mainly the stats stuff). Are there any specific endpoints that would be beneficial more so sooner? I think I'll try to finish messages and campaigns first when I can. PR's always welcome too :)
Great, thanks.
/<domain>/messages
and Events
are top on my list. Will be great if you can get to them soon, and I will see if I can send in some PRS :)
Actually I forgot, but GET domains/<domain>/messages/<message>
and DELETE domains/<domain>/messages/<message>
are implemented. It's in the schema. I couldn't figure out a good way to unit test it, so I am not sure if it's 100% working. But you can give it a try and let me know how it goes.
For example to get message info:
mailgun.messages('WyJhOTM4NDk1ODA3Iiw').info(function(err, msgInfo) {
console.log(msgInfo);
});
Similarly to delete:
mailgun.messages('WyJhOTM4NDk1ODA3Iiw').delete(function(err, body) {
console.log(body);
});
I will try and get to the Events sometime.
Just tried it on my side,
mailgun.messages('20140602040452.32167.70583').info(function (err, msgInfo) {
console.log(err);
console.log(msgInfo);
});
[Error: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>404 Not Found</title>
<h1>Not Found</h1>
<p>The requested URL was not found on the server.</p><p>If you entered the URL manually please check your spelling and try again.</p>
]
Looks like the constructed the url is incorrect.
Ok, thanks for the feedback. Will try to address it soon. For now you should be able to use the generic rest methods.
@jayzeng events
endpoint has been added in the 0.4.11
release that's on NPM now. Also I believe I have addressed the messages().info()
URL issue. Please let me know. I do not have an easy way to unit test this right now. Might need to rewrite the tests to properly handle it.
So what's the state of turning the documented methods listed above into implemented functionality?
Hello, which methods specifically? Everything that's "checked off" should be implemented already. As for the other ones, they shouldn't be hard to add. It's mostly just a matter of adding the definitions to the schema file, and the functions should be built automatically. The tests for new functions are the more time consuming part I guess. Unfortunately I am really swamped with real work and life stuff right now to complete the library at the moment. Hope to get to it sometime in the future. But any endpoints not implemented should be accessible using the generic rest methods.
Ah, thanks for the clarifications. I quickly grepped the source looking for routes support and didn't find the code; I didn't realize you were using a JSON schema to generate the methods programatically.
Thanks for the update!
Hello,
I've noticed that there is no option for setting the Mailgun Testing mode. Any chance is planned to be implemented soon?
Thanks
You can just add o:testmode
param to the send()
request params and set it to true
and that should work.
So this is a list of all API endpoints and methods mentioned in the API docs. I think that this might be helpful for reaching 100 % completeness. Feel free to edit this and check finished methods.
I also nagged @mailgun, about the API schema on twitter. Maybe we should file an issue.
/<domain>/messages
POST /<domain>/messages
POST /<domain>/messages.mime
GET domains/<domain>/messages
DELETE domains/<domain>/messages/<message>
Retrieving and deleting stored messages would kick ass.
/domains
GET /domains
GET /domains/<domain>
POST /domains
DELETE /domains/<domain>
GET /domains/<domain>/credentials
POST /domains/<domain>/credentials
PUT /domains/<domain>/credentials/<login>
DELETE /domains/<domain>/credentials/<login>
/<domain>/unsubscribes
GET /<domain>/unsubscribes
GET /<domain>/unsubscribes/<address>
DELETE /<domain>/unsubscribes/<address or id>
POST /<domain>/unsubscribes
/<domain>/complaints
GET /<domain>/complaints
GET /<domain>/complaints/<address>
POST /<domain>/complaints
DELETE /<domain>/complaints/<address>
This could be very useful for automated evaluation or notification of support personnel.
/<domain>/bounces
GET /<domain>/bounces
GET /<domain>/bounces/<address>
POST /<domain>/bounces
DELETE /<domain>/bounces/<address>
Stats
GET /<domain>/stats
DELETE /<domain>/tags
Events
GET /<domain>/events
/routes/
GET /routes
GET /routes/<id>
POST /routes
PUT /routes/<id>
DELETE /routes/<id>
/<domain>/campaigns
GET /<domain>/campaigns
GET /<domain>/campaigns/<id>
POST /<domain>/campaigns
PUT /<domain>/campaigns/<id>
DELETE /<domain>/campaigns/<id>
GET /<domain>/campaigns/<id>/events
GET /<domain>/campaigns/<id>/stats
GET /<domain>/campaigns/<id>/clicks
GET /<domain>/campaigns/<id>/opens
GET /<domain>/campaigns/<id>/unsubscribes
GET /<domain>/campaigns/<id>/complaints
/<domain>/webhooks
GET /domains/<domain>/webhooks
GET /domains/<domain>/webhooks/<webhookname>
POST /domains/<domain>/webhooks
PUT /domains/<domain>/webhooks/<webhookname>
DELETE /domains/<domain>/webhooks/<webhookname>
Webhooks support would be sexy. Maybe I can come around to submitting a PR.
/lists/
GET /lists
GET /lists/<address>
POST /lists
PUT /lists/<address>
DELETE /lists/<address>
GET /lists/<address>/members
GET /lists/<address>/members/<member_address>
POST /lists/<address>/members
PUT /lists/<address>/members/<member_address>
POST /lists/<address>/members.json
I think this one's buggy.DELETE /lists/<address>/members/<member_address>
/address/
GET /address/validate
GET /address/parse
Not really neccessary. We could do this on our own, if needed.