textmagic / textmagic-rest-csharp

MIT License
8 stars 19 forks source link

Inconsistency between API documentation and sandbox for POST /api/v2/messages #2

Closed foufure closed 9 years ago

foufure commented 9 years ago

During the tests of POST /api/v2/messages (send a new outbound message) the question arose which return value it should give back:

What should be taken? Is the sandbox right? Or does it depend of the return code 201 or 202? (but the sandbox only return 200 OK??).

Can someone clarify this for me?

Thanks in advance!

pricing sendingresult

dmitry-textmagic commented 9 years ago

Hi Jonathan!

POST /api/v2/messages returning SendingResult object unless dummy parameter set to true. When it happens, it returns Pricing object instead. I.e. GET /api/v2/messages/price is equivalent to POST /api/v2/messages with dummy = false. Just a kind of "syntax sugar".

So, in normal situation, POST /api/v2/messages always returns SendingResult with 20x.

foufure commented 9 years ago

It is a little bit disappointing to have POST /api/v2/messages returning SendingResult or Pricing which are completely different results. As GET /api/v2/messages/price already provides a mean of simulating the transaction, it is a little bit redundant. If it was for me, I would always return SendingResult and extend it with a Dummy/Real state or let the Dummy completely away.

Please tell me what you think of it. If you do not plan to change something I will close the issue, otherwise I will let it open.

dmitry-textmagic commented 9 years ago

I agree with you. We were decided to remove "dummy" parameter from POST /api/v2/messages. I will close this issue when appropriate change become live.

dmitry-textmagic commented 9 years ago

This change will be reflected in production tomorrow morning (~6:00 UTC).