markandrus / twilio-haskell

Twilio library for Haskell
BSD 3-Clause "New" or "Revised" License
38 stars 39 forks source link

GET Messages fails on clean checkout, POST Message and GET Message fine #48

Closed jglukasik closed 7 years ago

jglukasik commented 7 years ago

On a clean checkout and a stack build , I then modify main in test/Test.hs to be:

main = runTwilio' (getEnv "ACCOUNT_SID")
                  (getEnv "AUTH_TOKEN") $ do
  Message { Message.sid = messageSID } <- testPOSTMessages
  testGETMessage messageSID
  testGETMessages
  return ()

(I also source my Twilio creds, and change the phone #'s in testPOSTMessage)

POST and GET'ing a single message work fine, but GET Messages fails.

Output (account/phone redacted):

twilio-0.1.3.2: unregistering (local file changes: test/Test.hs)
twilio-0.1.3.2: build (lib + test)
Preprocessing library twilio-0.1.3.2...
Preprocessing test suite 'Tests' for twilio-0.1.3.2...
[1 of 1] Compiling Main             ( test/Test.hs, .stack-work/dist/x86_64-linux/Cabal-1.24.2.0/build/Tests/Tests-tmp/Main.o )
Linking .stack-work/dist/x86_64-linux/Cabal-1.24.2.0/build/Tests/Tests ...
twilio-0.1.3.2: copy/register
Installing library in
/home/jgl/twilio-haskell/.stack-work/install/x86_64-linux/lts-8.20/8.0.2/lib/x86_64-linux-ghc-8.0.2/twilio-0.1.3.2-2N1HG1W1tnwBfNs1pE2m9y
Registering twilio-0.1.3.2...
twilio-0.1.3.2: test (suite: Tests)

POST /Messages
"{\"sid\": \"SMc72d7c96a41543d49de37d41715187cf\", \"date_created\": \"Sat, 22 Jul 2017 22:55:07 +0000\", \"date_updated\": \"Sat, 22 Jul 2017 22:55:07 +0000\", \"date_sent\": null, \"account_sid\": \"REDACTED\", \"to\": \"+1xxxxxxxxxx\", \"from\": \"+1xxxxxxxxxx\", \"messaging_service_sid\": null, \"body\": \"Hello\", \"status\": \"queued\", \"num_segments\": \"1\", \"num_media\": \"0\", \"direction\": \"outbound-api\", \"api_version\": \"2010-04-01\", \"price\": null, \"price_unit\": \"USD\", \"error_code\": null, \"error_message\": null, \"uri\": \"/2010-04-01/Accounts/REDACTED/Messages/SMc72d7c96a41543d49de37d41715187cf.json\", \"subresource_uris\": {\"media\": \"/2010-04-01/Accounts/REDACTED/Messages/SMc72d7c96a41543d49de37d41715187cf/Media.json\"}}"
Message {sid = MessageSID {getMessageSID = "SMc72d7c96a41543d49de37d41715187cf"}, dateCreated = 2017-07-22 22:55:07 UTC, dateUpdated = 2017-07-22 22:55:07 UTC, dateSent = Nothing, accountSID = AccountSID {getAccountSID = "REDACTED"}, to = "+1xxxxxxxxxx", from = "+1xxxxxxxxxx", body = "Hello", status = queued, direction = outbound-api, priceUnit = USD, apiVersion = 2010-04-01, uri = /2010-04-01/Accounts/REDACTED/Messages/SMc72d7c96a41543d49de37d41715187cf.json}
GET /Message/SMc72d7c96a41543d49de37d41715187cf
"{\"sid\": \"SMc72d7c96a41543d49de37d41715187cf\", \"date_created\": \"Sat, 22 Jul 2017 22:55:07 +0000\", \"date_updated\": \"Sat, 22 Jul 2017 22:55:07 +0000\", \"date_sent\": \"Sat, 22 Jul 2017 22:55:07 +0000\", \"account_sid\": \"REDACTED\", \"to\": \"+1xxxxxxxxxx\", \"from\": \"+1xxxxxxxxxx\", \"messaging_service_sid\": null, \"body\": \"Hello\", \"status\": \"delivered\", \"num_segments\": \"1\", \"num_media\": \"0\", \"direction\": \"outbound-api\", \"api_version\": \"2010-04-01\", \"price\": \"-0.00750\", \"price_unit\": \"USD\", \"error_code\": null, \"error_message\": null, \"uri\": \"/2010-04-01/Accounts/REDACTED/Messages/SMc72d7c96a41543d49de37d41715187cf.json\", \"subresource_uris\": {\"media\": \"/2010-04-01/Accounts/REDACTED/Messages/SMc72d7c96a41543d49de37d41715187cf/Media.json\"}}"
Message {sid = MessageSID {getMessageSID = "SMc72d7c96a41543d49de37d41715187cf"}, dateCreated = 2017-07-22 22:55:07 UTC, dateUpdated = 2017-07-22 22:55:07 UTC, dateSent = Just 2017-07-22 22:55:07 UTC, accountSID = AccountSID {getAccountSID = "REDACTED"}, to = "+1xxxxxxxxxx", from = "+1xxxxxxxxxx", body = "Hello", status = delivered, direction = outbound-api, priceUnit = USD, apiVersion = 2010-04-01, uri = /2010-04-01/Accounts/REDACTED/Messages/SMc72d7c96a41543d49de37d41715187cf.json}
GET /Messages
"
{\"first_page_uri\": \"/2010-04-01/Accounts/REDACTED/Messages.json?PageSize=50&Page=0\", \"end\": 49, \"previous_page_uri\": null, \"messages\": [ {\"sid\": \"SMc72d7c96a41543d49de37d41715187cf\", \"date_created\": \"Sat, 22 Jul 2017 22:55:07 +0000\", \"date_updated\": \"Sat, 22 Jul 2017 22:55:07 +0000\", \"date_sent\": \"Sat, 22 Jul 2017 22:55:07 +0000\", \"account_sid\": \"REDACTED\", \"to\": \"+1xxxxxxxxxx\", \"from\": \"+1xxxxxxxxxx\", \"messaging_service_sid\": null, \"body\": \"Hello\", \"status\": \"delivered\", \"num_segments\": \"1\", \"num_media\": \"0\", \"direction\": \"outbound-api\", \"api_version\": \"2010-04-01\", \"price\": \"-0.00750\", \"price_unit\": \"USD\", \"error_code\": null, \"error_message\": null, \"uri\": \"/2010-04-01/Accounts/REDACTED/Messages/SMc72d7c96a41543d49de37d41715187cf.json\", \"subresource_uris\": {\"media\": \"/2010-04-01/Accounts/REDACTED/Messages/SMc72d7c96a41543d49de37d41715187cf/Media.json\"}}, {\"sid\": \"SMbede3659f17a4143aa8fbc1b4698bc79\", \"date_created\": \"Sat, 22 Jul 2017 22:53:59 +0000\", \"date_updated\": \"Sat, 22 Jul 2017 22:54:00 +0000\", \"date_sent\": \"Sat, 22 Jul 2017 22:53:59 +0000\", \"account_sid\": \"REDACTED\", \"to\": \"+1xxxxxxxxxx\", \"from\": \"+1xxxxxxxxxx\", \"messaging_service_sid\": null, \"body\": \"Hello\", \"status\": \"delivered\", \"num_segments\": \"1\", \"num_media\": \"0\", \"direction\": \"outbound-api\", \"api_version\": \"2010-04-01\", \"price\": \"-0.00750\", \"price_unit\": \"USD\", \"error_code\": null, \"error_message\": null, \"uri\": \"/2010-04-01/Accounts/REDACTED/Messages/SMbede3659f17a4143aa8fbc1b4698bc79.json\", \"subresource_uris\": {\"media\": \"/2010-04-01/Accounts/REDACTED/Messages/SMbede3659f17a4143aa8fbc1b4698bc79/Media.json\"}}, {\"sid\": \"SM2736edb2bfcb4333b130bb2dabffa1d7\", \"date_created\": \"Sat, 22 Jul 2017 22:53:29 +0000\", \"date_updated\": \"Sat, 22 Jul 2017 22:53:30 +0000\", \"date_sent\": \"Sat, 22 Jul 2017 22:53:29 +0000\", \"account_sid\": \"REDACTED\", \"to\": \"+1xxxxxxxxxx\", \"from\": \"+1xxxxxxxxxx\", \"messaging_service_sid\": null, \"body\": \"Hello\", \"status\": \"delivered\", \"num_segments\": \"1\", \"num_media\": \"0\", \"direction\": \"outbound-api\", \"api_version\": \"2010-04-01\", \"price\": \"-0.00750\", \"price_unit\": \"USD\", \"error_code\": null, \"error_message\": null, \"uri\": \"/2010-04-01/Accounts/REDACTED/Messages/SM2736edb2bfcb4333b130bb2dabffa1d7.json\", \"subresource_uris\": {\"media\": \"/2010-04-01/Accounts/REDACTED/Messages/SM2736edb2bfcb4333b130bb2dabffa1d7/Media.json\"}}, {\"sid\": \"SM66e6296b3d578463943e05ebf71db645\", \"date_created\": \"Sat, 22 Jul 2017 22:50:09 +0000\", \"date_updated\": \"Sat, 22 Jul 2017 22:50:09 +0000\", \"date_sent\": \"Sat, 22 Jul 2017 22:50:09 +0000\", \"account_sid\": \"REDACTED\", \"to\": \"+1xxxxxxxxxx\", \"from\": \"+1xxxxxxxxxx\", \"messaging_service_sid\": null, \"body\": \"Hello\", \"status\": \"received\", \"num_segments\": \"1\", \"num_media\": \"0\", \"direction\": \"inbound\", \"api_version\": \"2010-04-01\", \"price\": \"-0.00750\", \"price_unit\": \"USD\", \"error_code\": null, \"error_message\": null, \"uri\": \"/2010-04-01/Accounts/REDACTED/Messages/SM66e6296b3d578463943e05ebf71db645.json\", \"subresource_uris\": {\"media\": \"/2010-04-01/Accounts/REDACTED/Messages/SM66e6296b3d578463943e05ebf71db645/Media.json\"}}, {\"sid\": \"SM461a079127bb43d78106627219d1d03c\", \"date_created\": \"Sat, 22 Jul 2017 22:50:09 +0000\", \"date_updated\": \"Sat, 22 Jul 2017 22:50:09 +0000\", \"date_sent\": \"Sat, 22 Jul 2017 22:50:09 +0000\", \"account_sid\": \"REDACTED\", \"to\": \"+1xxxxxxxxxx\", \"from\": \"+1xxxxxxxxxx\", \"messaging_service_sid\": null, \"body\": \"Hello\", \"status\": \"delivered\", \"num_segments\": \"1\", \"num_media\": \"0\", \"direction\": \"outbound-api\", \"api_version\": \"2010-04-01\", \"price\": \"-0.00750\", \"price_unit\": \"USD\", \"error_code\": null, \"error_message\": null, \"uri\": \"/2010-04-01/Accounts/REDACTED/Messages/SM461a079127bb43d78106627219d1d03c.json\", \"subresource_uris\": {\"media\": \"/2010-04-01/Accounts/REDACTED/Messages/SM461a079127bb43d78106627219d1d03c/Media.json\"}}, {\"sid\": \"MMad3a43bcf4fb9ee16616e840bf45b03d\", \"date_created\": \"Sat, 22 Jul 2017 18:28:31 +0000\", \"date_updated\": \"Sat, 22 Jul 2017 18:28:33 +0000\", \"date_sent\": \"Sat, 22 Jul 2017 18:28:33 +0000\", \"account_sid\": \"REDACTED\", \"to\": \"+1xxxxxxxxxx\", \"from\": \"+1xxxxxxxxxx\", \"messaging_service_sid\": null, \"body\": \"(a minimum of 272 years and a maximum of 512 years).\", \"status\": \"received\", \"num_segments\": \"1\", \"num_media\": \"1\", \"direction\": \"inbound\", \"api_version\": \"2010-04-01\", \"price\": \"-0.01000\", \"price_unit\": \"USD\", \"error_code\": null, \"error_message\": null, \"uri\": \"/2010-04-01/Accounts/REDACTED/Messages/MMad3a43bcf4fb9ee16616e840bf45b03d.json\", \"subresource_uris\": {\"media\": \"/2010-04-01/Accounts/REDACTED/Messages/MMad3a43bcf4fb9ee16616e840bf45b03d/Media.json\"}}, {\"sid\": \"MMf1d4688002d42794039b913f97161d70\", \"date_created\": \"Fri, 21 Jul 2017 07:31:19 +0000\", \"date_updated\": \"Fri, 21 Jul 2017 07:31:21 +0000\", \"date_sent\": \"Fri, 21 Jul 2017 07:31:21 +0000\", \"account_sid\": \"REDACTED\", \"to\": \"+1xxxxxxxxxx\", \"from\": \"+1xxxxxxxxxx\", \"messaging_service_sid\": null, \"body\": \"\", \"status\": \"received\", \"num_segments\": \"1\", \"num_media\": \"1\", \"direction\": \"inbound\", \"api_version\": \"2010-04-01\", \"price\": \"-0.01000\", \"price_unit\": \"USD\", \"error_code\": null, \"error_message\": null, \"uri\": \"/2010-04-01/Accounts/REDACTED/Messages/MMf1d4688002d42794039b913f97161d70.json\", \"subresource_uris\": {\"media\": \"/2010-04-01/Accounts/REDACTED/Messages/MMf1d4688002d42794039b913f97161d70/Media.json\"}}, {\"sid\": \"MMf679fc959827bea80e4add1491bdf790\", \"date_created\": \"Thu, 20 Jul 2017 07:52:57 +0000\", \"date_updated\": \"Thu, 20 Jul 2017 07:52:59 +0000\", \"date_sent\": \"Thu, 20 Jul 2017 07:52:58 +0000\", \"account_sid\": \"REDACTED\", \"to\": \"+1xxxxxxxxxx\", \"from\": \"+1xxxxxxxxxx\", \"messaging_service_sid\": null, \"body\": \"\", \"status\": \"received\", \"num_segments\": \"1\", \"num_media\": \"1\", \"direction\": \"inbound\", \"api_version\": \"2010-04-01\", \"price\": \"-0.01000\", \"price_unit\": \"USD\", \"error_code\": null, \"error_message\": null, \"uri\": \"/2010-04-01/Accounts/REDACTED/Messages/MMf679fc959827bea80e4add1491bdf790.json\", \"subresource_uris\": {\"media\": \"/2010-04-01/Accounts/REDACTED/Messages/MMf679fc959827bea80e4add1491bdf790/Media.json\"}}, {\"sid\": \"SMf40ede7d517c31d4cf1e4c1b15ad76e3\", \"date_created\": \"Thu, 20 Jul 2017 07:51:15 +0000\", \"date_updated\": \"Thu, 20 Jul 2017 07:51:15 +0000\", \"date_sent\": \"Thu, 20 Jul 2017 07:51:15 +0000\", \"account_sid\": \"REDACTED\", \"to\": \"+1xxxxxxxxxx\", \"from\": \"+1xxxxxxxxxx\", \"messaging_service_sid\": null, \"body\": \"again\", \"status\": \"received\", \"num_segments\": \"1\", \"num_media\": \"0\", \"direction\": \"inbound\", \"api_version\": \"2010-04-01\", \"price\": \"-0.00750\", \"price_unit\": \"USD\", \"error_code\": null, \"error_message\": null, \"uri\": \"/2010-04-01/Accounts/REDACTED/Messages/SMf40ede7d517c31d4cf1e4c1b15ad76e3.json\", \"subresource_uris\": {\"media\": \"/2010-04-01/Accounts/REDACTED/Messages/SMf40ede7d517c31d4cf1e4c1b15ad76e3/Media.json\"}}, {\"sid\": \"SMf9c0b5799528919c019c420955e51467\", \"date_created\": \"Thu, 20 Jul 2017 07:49:46 +0000\", \"date_updated\": \"Thu, 20 Jul 2017 07:49:46 +0000\", \"date_sent\": \"Thu, 20 Jul 2017 07:49:46 +0000\", \"account_sid\": \"REDACTED\", \"to\": \"+1xxxxxxxxxx\", \"from\": \"+1xxxxxxxxxx\", \"messaging_service_sid\": null, \"body\": \"testy\", \"status\": \"received\", \"num_segments\": \"1\", \"num_media\": \"0\", \"direction\": \"inbound\", \"api_version\": \"2010-04-01\", \"price\": \"-0.00750\", \"price_unit\": \"USD\", \"error_code\": null, \"error_message\": null, \"uri\": \"/2010-04-01/Accounts/REDACTED/Messages/SMf9c0b5799528919c019c420955e51467.json\", \"subresource_uris\": {\"media\": \"/2010-04-01/Accounts/REDACTED/Messages/SMf9c0b5799528919c019c420955e51467/Media.json\"}}, {\"sid\": \"MM76871c12e6e93754b95f520736a88382\", \"date_created\": \"Thu, 20 Jul 2017 04:34:10 +0000\", \"date_updated\": \"Thu, 20 Jul 2017 04:34:11 +0000\", \"date_sent\": \"Thu, 20 Jul 2017 04:34:11 +0000\", \"account_sid\": \"REDACTED\", \"to\": \"+1xxxxxxxxxx\", \"from\": \"+1xxxxxxxxxx\", \"messaging_service_sid\": \"MG064b55c8744006df434d54069c8cdd3d\", \"body\": \"\", \"status\": \"received\", \"num_segments\": \"1\", \"num_media\": \"1\", \"direction\": \"inbound\", \"api_version\": \"2010-04-01\", \"price\": \"-0.01000\", \"price_unit\": \"USD\", \"error_code\": null, \"error_message\": null, \"uri\": \"/2010-04-01/Accounts/REDACTED/Messages/MM76871c12e6e93754b95f520736a88382.json\", \"subresource_uris\": {\"media\": \"/2010-04-01/Accounts/REDACTED/Messages/MM76871c12e6e93754b95f520736a88382/Media.json\"}}, {\"sid\": \"SM4b3399cdf827443caac8b26dc81e890a\", \"date_created\": \"Wed, 19 Jul 2017 08:50:19 +0000\", \"date_updated\": \"Wed, 19 Jul 2017 08:50:19 +0000\", \"date_sent\": \"Wed, 19 Jul 2017 08:50:19 +0000\", \"account_sid\": \"REDACTED\", \"to\": \"+1xxxxxxxxxx\", \"from\": \"+1xxxxxxxxxx\", \"messaging_service_sid\": null, \"body\": \"Back to the iphone huh\", \"status\": \"delivered\", \"num_segments\": \"1\", \"num_media\": \"0\", \"direction\": \"outbound-api\", \"api_version\": \"2010-04-01\", \"price\": \"-0.00750\", \"price_unit\": \"USD\", \"error_code\": null, \"error_message\": null, \"uri\": \"/2010-04-01/Accounts/REDACTED/Messages/SM4b3399cdf827443caac8b26dc81e890a.json\", \"subresource_uris\": {\"media\": \"/2010-04-01/Accounts/REDACTED/Messages/SM4b3399cdf827443caac8b26dc81e890a/Media.json\"}}, {\"sid\": \"MM531b142f48fd84f05809283759fe0aee\", \"date_created\": \"Wed, 19 Jul 2017 04:40:21 +0000\", \"date_updated\": \"Wed, 19 Jul 2017 04:40:22 +0000\", \"date_sent\": \"Wed, 19 Jul 2017 04:40:22 +0000\", \"account_sid\": \"REDACTED\", \"to\": \"+1xxxxxxxxxx\", \"from\": \"+1xxxxxxxxxx\", \"messaging_service_sid\": \"MG064b55c8744006df434d54069c8cdd3d\", \"body\": \"went off accidentally and William was shot in the chest. Dags were less romantic\", \"status\": \"received\", \"num_segments\": \"1\", \"num_media\": \"1\", \"direction\": \"inbound\", \"api_version\": \"2010-04-01\", \"price\": \"-0.01000\", \"price_unit\": \"USD\", \"error_code\": null, \"error_message\": null, \"uri\": \"/2010-04-01/Accounts/REDACTED/Messages/MM531b142f48fd84f05809283759fe0aee.json\", \"subresource_uris\": {\"media\": \"/2010-04-01/Accounts/REDACTED/Messages/MM531b142f48fd84f05809283759fe0aee/Media.json\"}}, {\"sid\": \"MM55dfbb4de1dadf16f4aeb17bd6906b3a\", \"date_created\": \"Thu, 22 Jun 2017 03:45:48 +0000\", \"date_updated\": \"Thu, 22 Jun 2017 03:45:48 +0000\", \"date_sent\": \"Thu, 22 Jun 2017 03:45:48 +0000\", \"account_sid\": \"REDACTED\", \"to\": \"+1xxxxxxxxxx\", \"from\": \"+1xxxxxxxxxx\", \"messaging_service_sid\": \"MG064b55c8744006df434d54069c8cdd3d\", \"body\": \"The concept was intended \\\"to bring into prominence the fact that the speaking of language is part of an activity, or a form of life, \\\" (PI 23) which gives language its meaning.\", \"status\": \"received\", \"num_segments\": \"1\", \"num_media\": \"1\", \"direction\": \"inbound\", \"api_version\": \"2010-04-01\", \"price\": \"-0.01000\", \"price_unit\": \"USD\", \"error_code\": null, \"error_message\": null, \"uri\": \"/2010-04-01/Accounts/REDACTED/Messages/MM55dfbb4de1dadf16f4aeb17bd6906b3a.json\", \"subresource_uris\": {\"media\": \"/2010-04-01/Accounts/REDACTED/Messages/MM55dfbb4de1dadf16f4aeb17bd6906b3a/Media.json\"}}, {\"sid\": \"MMae975cd02b9e17f3cc6e23754214e705\", \"date_created\": \"Tue, 20 Jun 2017 05:43:51 +0000\", \"date_updated\": \"Tue, 20 Jun 2017 05:43:53 +0000\", \"date_sent\": \"Tue, 20 Jun 2017 05:43:53 +0000\", \"account_sid\": \"REDACTED\", \"to\": \"+1xxxxxxxxxx\", \"from\": \"+1xxxxxxxxxx\", \"messaging_service_sid\": \"MG064b55c8744006df434d54069c8cdd3d\", \"body\": \"\", \"status\": \"received\", \"num_segments\": \"1\", \"num_media\": \"1\", \"direction\": \"inbound\", \"api_version\": \"2010-04-01\", \"price\": \"-0.01000\", \"price_unit\": \"USD\", \"error_code\": null, \"error_message\": null, \"uri\": \"/2010-04-01/Accounts/REDACTED/Messages/MMae975cd02b9e17f3cc6e23754214e705.json\", \"subresource_uris\": {\"media\": \"/2010-04-01/Accounts/REDACTED/Messages/MMae975cd02b9e17f3cc6e23754214e705/Media.json\"}}, {\"sid\": \"SMe5e849513aaf43d5ae3e4a924e19d305\", \"date_created\": \"Sun, 12 Mar 2017 07:57:30 +0000\", \"date_updated\": \"Sun, 12 Mar 2017 07:57:31 +0000\", \"date_sent\": \"Sun, 12 Mar 2017 07:57:30 +0000\", \"account_sid\": \"REDACTED\", \"to\": \"+1xxxxxxxxxx\", \"from\": \"+1xxxxxxxxxx\", \"messaging_service_sid\": null, \"body\": \"http://\\ud83c\\udf34.jgl.me\", \"status\": \"delivered\", \"num_segments\": \"1\", \"num_media\": \"0\", \"direction\": \"outbound-api\", \"api_version\": \"2010-04-01\", \"price\": \"-0.00750\", \"price_unit\": \"USD\", \"error_code\": null, \"error_message\": null, \"uri\": \"/2010-04-01/Accounts/REDACTED/Messages/SMe5e849513aaf43d5ae3e4a924e19d305.json\", \"subresource_uris\": {\"media\": \"/2010-04-01/Accounts/REDACTED/Messages/SMe5e849513aaf43d5ae3e4a924e19d305/Media.json\"}}], \"uri\": \"/2010-04-01/Accounts/REDACTED/Messages.json?PageSize=50&Page=0\", \"page_size\": 50, \"start\": 0, \"next_page_uri\": \"/2010-04-01/Accounts/REDACTED/Messages.json?PageSize=50&Page=1&PageToken=PASMe5e849513aaf43d5ae3e4a924e19d305\", \"page\": 0}"
Tests: UnexpectedResponse (Response {responseStatus = Status {statusCode = 200, statusMessage = "OK"}, responseVersion = HTTP/1.1, responseHeaders = [("Access-Control-Allow-Credentials","true"),("Access-Control-Allow-Headers","Accept, Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since"),("Access-Control-Allow-Methods","GET, POST, DELETE, OPTIONS"),("Access-Control-Allow-Origin","*"),("Access-Control-Expose-Headers","ETag"),("Content-Type","application/json"),("Date","Sat, 22 Jul 2017 22:55:08 GMT"),("Strict-Transport-Security","max-age=15768000"),("Twilio-Request-Duration","0.221"),("Twilio-Request-Id","RQ43fd7233b7d647069ab89914e7862de9"),("X-Powered-By","AT-5000"),("X-Shenanigans","none"),("Content-Length","43741"),("Connection","keep-alive")], responseBody = " {\"first_page_uri\": \"/2010-04-01/Accounts/REDACTED/Messages.json?PageSize=50&Page=0\", \"end\": 49, \"previous_page_uri\": null, \"messages\": [ {\"sid\": \"SMc72d7c96a41543d49de37d41715187cf\", \"date_created\": \"Sat, 22 Jul 2017 22:55:07 +0000\", \"date_updated\": \"Sat, 22 Jul 2017 22:55:07 +0000\", \"date_sent\": \"Sat, 22 Jul 2017 22:55:07 +0000\", \"account_sid\": \"REDACTED\", \"to\": \"+1xxxxxxxxxx\", \"from\": \"+1xxxxxxxxxx\", \"messaging_service_sid\": null, \"body\": \"Hello\", \"status\": \"delivered\", \"num_segments\": \"1\", \"num_media\": \"0\", \"direction\": \"outbound-api\", \"api_version\": \"2010-04-01\", \"price\": \"-0.00750\", \"price_unit\": \"USD\", \"error_code\": null, \"error_message\": null, \"uri\": \"/2010-04-01/Accounts/REDACTED/Messages/SMc72d7c96a41543d49de37d41715187cf.json\", \"subresource_uris\": {\"media\": \"/2010-04-01/Accounts/REDACTED/Messages/SMc72d7c96a41543d49de37d41715187cf/Media.json\"}}, {\"sid\": \"SMbede3659f17a4143aa8fbc1b4698bc79\", \"date_created\": \"Sat, 22 Jul 2017 22:53:59 +0000\", \"date_updated\": \"Sat, 22 Jul 2017 22:54:00 +0000\", \"date_sent\": \"Sat, 22 Jul 2017 22:53:59 +0000\", \"account_sid\": \"REDACTED\", \"to\": \"+1xxxxxxxxxx\", \"from\": \"+1xxxxxxxxxx\", \"messaging_service_sid\": null, \"body\": \"Hello\", \"status\": \"delivered\", \"num_segments\": \"1\", \"num_media\": \"0\", \"direction\": \"outbound-api\", \"api_version\": \"2010-04-01\", \"price\": \"-0.00750\", \"price_unit\": \"USD\", \"error_code\": null, \"error_message\": null, \"uri\": \"/2010-04-01/Accounts/REDACTED/Messages/SMbede3659f17a4143aa8fbc1b4698bc79.json\", \"subresource_uris\": {\"media\": \"/2010-04-01/Accounts/REDACTED/Messages/SMbede3659f17a4143aa8fbc1b4698bc79/Media.json\"}}, {\"sid\": \"SM2736edb2bfcb4333b130bb2dabffa1d7\", \"date_created\": \"Sat, 22 Jul 2017 22:53:29 +0000\", \"date_updated\": \"Sat, 22 Jul 2017 22:53:30 +0000\", \"date_sent\": \"Sat, 22 Jul 2017 22:53:29 +0000\", \"account_sid\": \"REDACTED\", \"to\": \"+1xxxxxxxxxx\", \"from\": \"+1xxxxxxxxxx\", \"messaging_service_sid\": null, \"body\": \"Hello\", \"status\": \"delivered\", \"num_segments\": \"1\", \"num_media\": \"0\", \"direction\": \"outbound-api\", \"api_version\": \"2010-04-01\", \"price\": \"-0.00750\", \"price_unit\": \"USD\", \"error_code\": null, \"error_message\": null, \"uri\": \"/2010-04-01/Accounts/REDACTED/Messages/SM2736edb2bfcb4333b130bb2dabffa1d7.json\", \"subresource_uris\": {\"media\": \"/2010-04-01/Accounts/REDACTED/Messages/SM2736edb2bfcb4333b130bb2dabffa1d7/Media.json\"}}, {\"sid\": \"SM66e6296b3d578463943e05ebf71db645\", \"date_created\": \"Sat, 22 Jul 2017 22:50:09 +0000\", \"date_updated\": \"Sat, 22 Jul 2017 22:50:09 +0000\", \"date_sent\": \"Sat, 22 Jul 2017 22:50:09 +0000\", \"account_sid\": \"REDACTED\", \"to\": \"+1xxxxxxxxxx\", \"from\": \"+1xxxxxxxxxx\", \"messaging_service_sid\": null, \"body\": \"Hello\", \"status\": \"received\", \"num_segments\": \"1\", \"num_media\": \"0\", \"direction\": \"inbound\", \"api_version\": \"2010-04-01\", \"price\": \"-0.00750\", \"price_unit\": \"USD\", \"error_code\": null, \"error_message\": null, \"uri\": \"/2010-04-01/Accounts/REDACTED/Messages/SM66e6296b3d578463943e05ebf71db645.json\", \"subresource_uris\": {\"media\": \"/2010-04-01/Accounts/REDACTED/Messages/SM66e6296b3d578463943e05ebf71db645/Media.json\"}}, {\"sid\": \"SM461a079127bb43d78106627219d1d03c\", \"date_created\": \"Sat, 22 Jul 2017 22:50:09 +0000\", \"date_updated\": \"Sat, 22 Jul 2017 22:50:09 +0000\", \"date_sent\": \"Sat, 22 Jul 2017 22:50:09 +0000\", \"account_sid\": \"REDACTED\", \"to\": \"+1xxxxxxxxxx\", \"from\": \"+1xxxxxxxxxx\", \"messaging_service_sid\": null, \"body\": \"Hello\", \"status\": \"delivered\", \"num_segments\": \"1\", \"num_media\": \"0\", \"direction\": \"outbound-api\", \"api_version\": \"2010-04-01\", \"price\": \"-0.00750\", \"price_unit\": \"USD\", \"error_code\": null, \"error_message\": null, \"uri\": \"/2010-04-01/Accounts/REDACTED/Messages/SM461a079127bb43d78106627219d1d03c.json\", \"subresource_uris\": {\"media\": \"/2010-04-01/Accounts/REDACTED/Messages/SM461a079127bb43d78106627219d1d03c/Media.json\"}}, {\"sid\": \"MMad3a43bcf4fb9ee16616e840bf45b03d\", \"date_created\": \"Sat, 22 Jul 2017 18:28:31 +0000\", \"date_updated\": \"Sat, 22 Jul 2017 18:28:33 +0000\", \"date_sent\": \"Sat, 22 Jul 2017 18:28:33 +0000\", \"account_sid\": \"REDACTED\", \"to\": \"+1xxxxxxxxxx\", \"from\": \"+1xxxxxxxxxx\", \"messaging_service_sid\": null, \"body\": \"(a minimum of 272 years and a maximum of 512 years).\", \"status\": \"received\", \"num_segments\": \"1\", \"num_media\": \"1\", \"direction\": \"inbound\", \"api_version\": \"2010-04-01\", \"price\": \"-0.01000\", \"price_unit\": \"USD\", \"error_code\": null, \"error_message\": null, \"uri\": \"/2010-04-01/Accounts/REDACTED/Messages/MMad3a43bcf4fb9ee16616e840bf45b03d.json\", \"subresource_uris\": {\"media\": \"/2010-04-01/Accounts/REDACTED/Messages/MMad3a43bcf4fb9ee16616e840bf45b03d/Media.json\"}}, {\"sid\": \"MMf1d4688002d42794039b913f97161d70\", \"date_created\": \"Fri, 21 Jul 2017 07:31:19 +0000\", \"date_updated\": \"Fri, 21 Jul 2017 07:31:21 +0000\", \"date_sent\": \"Fri, 21 Jul 2017 07:31:21 +0000\", \"account_sid\": \"REDACTED\", \"to\": \"+1xxxxxxxxxx\", \"from\": \"+1xxxxxxxxxx\", \"messaging_service_sid\": null, \"body\": \"\", \"status\": \"received\", \"num_segments\": \"1\", \"num_media\": \"1\", \"direction\": \"inbound\", \"api_version\": \"2010-04-01\", \"price\": \"-0.01000\", \"price_unit\": \"USD\", \"error_code\": null, \"error_message\": null, \"uri\": \"/2010-04-01/Accounts/REDACTED/Messages/MMf1d4688002d42794039b913f97161d70.json\", \"subresource_uris\": {\"media\": \"/2010-04-01/Accounts/REDACTED/Messages/MMf1d4688002d42794039b913f97161d70/Media.json\"}}, {\"sid\": \"MMf679fc959827bea80e4add1491bdf790\", \"date_created\": \"Thu, 20 Jul 2017 07:52:57 +0000\", \"date_updated\": \"Thu, 20 Jul 2017 07:52:59 +0000\", \"date_sent\": \"Thu, 20 Jul 2017 07:52:58 +0000\", \"account_sid\": \"REDACTED\", \"to\": \"+1xxxxxxxxxx\", \"from\": \"+1xxxxxxxxxx\", \"messaging_service_sid\": null, \"body\": \"\", \"status\": \"received\", \"num_segments\": \"1\", \"num_media\": \"1\", \"direction\": \"inbound\", \"api_version\": \"2010-04-01\", \"price\": \"-0.01000\", \"price_unit\": \"USD\", \"error_code\": null, \"error_message\": null, \"uri\": \"/2010-04-01/Accounts/REDACTED/Messages/MMf679fc959827bea80e4add1491bdf790.json\", \"subresource_uris\": {\"media\": \"/2010-04-01/Accounts/REDACTED/Messages/MMf679fc959827bea80e4add1491bdf790/Media.json\"}}, {\"sid\": \"SMf40ede7d517c31d4cf1e4c1b15ad76e3\", \"date_created\": \"Thu, 20 Jul 2017 07:51:15 +0000\", \"date_updated\": \"Thu, 20 Jul 2017 07:51:15 +0000\", \"date_sent\": \"Thu, 20 Jul 2017 07:51:15 +0000\", \"account_sid\": \"REDACTED\", \"to\": \"+1xxxxxxxxxx\", \"from\": \"+1xxxxxxxxxx\", \"messaging_service_sid\": null, \"body\": \"again\", \"status\": \"received\", \"num_segments\": \"1\", \"num_media\": \"0\", \"direction\": \"inbound\", \"api_version\": \"2010-04-01\", \"price\": \"-0.00750\", \"price_unit\": \"USD\", \"error_code\": null, \"error_message\": null, \"uri\": \"/2010-04-01/Accounts/REDACTED/Messages/SMf40ede7d517c31d4cf1e4c1b15ad76e3.json\", \"subresource_uris\": {\"media\": \"/2010-04-01/Accounts/REDACTED/Messages/SMf40ede7d517c31d4cf1e4c1b15ad76e3/Media.json\"}}, {\"sid\": \"SMf9c0b5799528919c019c420955e51467\", \"date_created\": \"Thu, 20 Jul 2017 07:49:46 +0000\", \"date_updated\": \"Thu, 20 Jul 2017 07:49:46 +0000\", \"date_sent\": \"Thu, 20 Jul 2017 07:49:46 +0000\", \"account_sid\": \"REDACTED\", \"to\": \"+1xxxxxxxxxx\", \"from\": \"+1xxxxxxxxxx\", \"messaging_service_sid\": null, \"body\": \"testy\", \"status\": \"received\", \"num_segments\": \"1\", \"num_media\": \"0\", \"direction\": \"inbound\", \"api_version\": \"2010-04-01\", \"price\": \"-0.00750\", \"price_unit\": \"USD\", \"error_code\": null, \"error_message\": null, \"uri\": \"/2010-04-01/Accounts/REDACTED/Messages/SMf9c0b5799528919c019c420955e51467.json\", \"subresource_uris\": {\"media\": \"/2010-04-01/Accounts/REDACTED/Messages/SMf9c0b5799528919c019c420955e51467/Media.json\"}}, {\"sid\": \"MM76871c12e6e93754b95f520736a88382\", \"date_created\": \"Thu, 20 Jul 2017 04:34:10 +0000\", \"date_updated\": \"Thu, 20 Jul 2017 04:34:11 +0000\", \"date_sent\": \"Thu, 20 Jul 2017 04:34:11 +0000\", \"account_sid\": \"REDACTED\", \"to\": \"+1xxxxxxxxxx\", \"from\": \"+1xxxxxxxxxx\", \"messaging_service_sid\": \"MG064b55c8744006df434d54069c8cdd3d\", \"body\": \"\", \"status\": \"received\", \"num_segments\": \"1\", \"num_media\": \"1\", \"direction\": \"inbound\", \"api_version\": \"2010-04-01\", \"price\": \"-0.01000\", \"price_unit\": \"USD\", \"error_code\": null, \"error_message\": null, \"uri\": \"/2010-04-01/Accounts/REDACTED/Messages/MM76871c12e6e93754b95f520736a88382.json\", \"subresource_uris\": {\"media\": \"/2010-04-01/Accounts/REDACTED/Messages/MM76871c12e6e93754b95f520736a88382/Media.json\"}}, {\"sid\": \"SM4b3399cdf827443caac8b26dc81e890a\", \"date_created\": \"Wed, 19 Jul 2017 08:50:19 +0000\", \"date_updated\": \"Wed, 19 Jul 2017 08:50:19 +0000\", \"date_sent\": \"Wed, 19 Jul 2017 08:50:19 +0000\", \"account_sid\": \"REDACTED\", \"to\": \"+1xxxxxxxxxx\", \"from\": \"+1xxxxxxxxxx\", \"messaging_service_sid\": null, \"body\": \"Back to the iphone huh\", \"status\": \"delivered\", \"num_segments\": \"1\", \"num_media\": \"0\", \"direction\": \"outbound-api\", \"api_version\": \"2010-04-01\", \"price\": \"-0.00750\", \"price_unit\": \"USD\", \"error_code\": null, \"error_message\": null, \"uri\": \"/2010-04-01/Accounts/REDACTED/Messages/SM4b3399cdf827443caac8b26dc81e890a.json\", \"subresource_uris\": {\"media\": \"/2010-04-01/Accounts/REDACTED/Messages/SM4b3399cdf827443caac8b26dc81e890a/Media.json\"}}, {\"sid\": \"MM531b142f48fd84f05809283759fe0aee\", \"date_created\": \"Wed, 19 Jul 2017 04:40:21 +0000\", \"date_updated\": \"Wed, 19 Jul 2017 04:40:22 +0000\", \"date_sent\": \"Wed, 19 Jul 2017 04:40:22 +0000\", \"account_sid\": \"REDACTED\", \"to\": \"+1xxxxxxxxxx\", \"from\": \"+1xxxxxxxxxx\", \"messaging_service_sid\": \"MG064b55c8744006df434d54069c8cdd3d\", \"body\": \"went off accidentally and William was shot in the chest. Dags were less romantic\", \"status\": \"received\", \"num_segments\": \"1\", \"num_media\": \"1\", \"direction\": \"inbound\", \"api_version\": \"2010-04-01\", \"price\": \"-0.01000\", \"price_unit\": \"USD\", \"error_code\": null, \"error_message\": null, \"uri\": \"/2010-04-01/Accounts/REDACTED/Messages/MM531b142f48fd84f05809283759fe0aee.json\", \"subresource_uris\": {\"media\": \"/2010-04-01/Accounts/REDACTED/Messages/MM531b142f48fd84f05809283759fe0aee/Media.json\"}}, {\"sid\": \"MM55dfbb4de1dadf16f4aeb17bd6906b3a\", \"date_created\": \"Thu, 22 Jun 2017 03:45:48 +0000\", \"date_updated\": \"Thu, 22 Jun 2017 03:45:48 +0000\", \"date_sent\": \"Thu, 22 Jun 2017 03:45:48 +0000\", \"account_sid\": \"REDACTED\", \"to\": \"+1xxxxxxxxxx\", \"from\": \"+1xxxxxxxxxx\", \"messaging_service_sid\": \"MG064b55c8744006df434d54069c8cdd3d\", \"body\": \"The concept was intended \\\"to bring into prominence the fact that the speaking of language is part of an activity, or a form of life, \\\" (PI 23) which gives language its meaning.\", \"status\": \"received\", \"num_segments\": \"1\", \"num_media\": \"1\", \"direction\": \"inbound\", \"api_version\": \"2010-04-01\", \"price\": \"-0.01000\", \"price_unit\": \"USD\", \"error_code\": null, \"error_message\": null, \"uri\": \"/2010-04-01/Accounts/REDACTED/Messages/MM55dfbb4de1dadf16f4aeb17bd6906b3a.json\", \"subresource_uris\": {\"media\": \"/2010-04-01/Accounts/REDACTED/Messages/MM55dfbb4de1dadf16f4aeb17bd6906b3a/Media.json\"}}, {\"sid\": \"MMae975cd02b9e17f3cc6e23754214e705\", \"date_created\": \"Tue, 20 Jun 2017 05:43:51 +0000\", \"date_updated\": \"Tue, 20 Jun 2017 05:43:53 +0000\", \"date_sent\": \"Tue, 20 Jun 2017 05:43:53 +0000\", \"account_sid\": \"REDACTED\", \"to\": \"+1xxxxxxxxxx\", \"from\": \"+1xxxxxxxxxx\", \"messaging_service_sid\": \"MG064b55c8744006df434d54069c8cdd3d\", \"body\": \"\", \"status\": \"received\", \"num_segments\": \"1\", \"num_media\": \"1\", \"direction\": \"inbound\", \"api_version\": \"2010-04-01\", \"price\": \"-0.01000\", \"price_unit\": \"USD\", \"error_code\": null, \"error_message\": null, \"uri\": \"/2010-04-01/Accounts/REDACTED/Messages/MMae975cd02b9e17f3cc6e23754214e705.json\", \"subresource_uris\": {\"media\": \"/2010-04-01/Accounts/REDACTED/Messages/MMae975cd02b9e17f3cc6e23754214e705/Media.json\"}}, {\"sid\": \"SMe5e849513aaf43d5ae3e4a924e19d305\", \"date_created\": \"Sun, 12 Mar 2017 07:57:30 +0000\", \"date_updated\": \"Sun, 12 Mar 2017 07:57:31 +0000\", \"date_sent\": \"Sun, 12 Mar 2017 07:57:30 +0000\", \"account_sid\": \"REDACTED\", \"to\": \"+1xxxxxxxxxx\", \"from\": \"+1xxxxxxxxxx\", \"messaging_service_sid\": null, \"body\": \"http://\\ud83c\\udf34.jgl.me\", \"status\": \"delivered\", \"num_segments\": \"1\", \"num_media\": \"0\", \"direction\": \"outbound-api\", \"api_version\": \"2010-04-01\", \"price\": \"-0.00750\", \"price_unit\": \"USD\", \"error_code\": null, \"error_message\": null, \"uri\": \"/2010-04-01/Accounts/REDACTED/Messages/SMe5e849513aaf43d5ae3e4a924e19d305.json\", \"subresource_uris\": {\"media\": \"/2010-04-01/Accounts/REDACTED/Messages/SMe5e849513aaf43d5ae3e4a924e19d305/Media.json\"}}], \"uri\": \"/2010-04-01/Accounts/REDACTED/Messages.json?PageSize=50&Page=0\", \"page_size\": 50, \"start\": 0, \"next_page_uri\": \"/2010-04-01/Accounts/REDACTED/Messages.json?PageSize=50&Page=1&PageToken=PASMe5e849513aaf43d5ae3e4a924e19d305\", \"page\": 0}", responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose}) 

Completed 2 action(s).
Test suite failure for package twilio-0.1.3.2
    Tests:  exited with: ExitFailure 1
Logs printed to console
markandrus commented 7 years ago

Thanks @jglukasik,

Probably the Aeson FromJSON instances needs to be updated. Usually this happens when a parse error occurs.

Mark

markandrus commented 7 years ago

Actually, it might be because this library expects the SM-prefixed SMS SIDs, but the /Messages endpoint can also return MM-prefixed MMS SIDs.

markandrus commented 7 years ago

I need to land a test, but https://github.com/markandrus/twilio-haskell/pull/46 may have fixed this.

jglukasik commented 7 years ago

I can confirm that https://github.com/markandrus/twilio-haskell/pull/46 fixes this issue. Thank you @markandrus!