# Errors registering alert endpoint

**URL:** <https://discussions.flightaware.com/t/errors-registering-alert-endpoint/15727>\
**Category:** AeroAPI\
**Created:** [November 13, 2014, 4:41pm UTC](https://discussions.flightaware.com/t/errors-registering-alert-endpoint/15727 "2014-11-13T16:41:40Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![gruupmeet](https://avatars.discourse-cdn.com/v4/letter/g/2bfe46/32.png) [@gruupmeet](https://discussions.flightaware.com/u/gruupmeet)\
**Post date:** [November 13, 2014, 4:41pm UTC](https://discussions.flightaware.com/t/errors-registering-alert-endpoint/15727/1 "2014-11-13T16:41:40Z")

</div>

I keep getting the error

```auto

Savon::SOAPFault: (CLIENT) INVALID: unsupported format_type

```

even though I have it set to “json/post”

The ruby code that I am using is

```auto

response = client.call(:register_alert_endpoint, message: {address: 'http://www.whatever.com/flightaware.json', format_type: "json/post"})

```

Other API calls work perfectly in the same manner, so it seems like it is expecting something else in the format\_type field even though the documentation explicitly states that “json/post” is the only valid option.

---

<div class="post-metadata">

**Author:** ![bovineone](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/bovineone/32/117631_2.png) [@bovineone](https://discussions.flightaware.com/u/bovineone)\
**Post date:** [November 13, 2014, 6:25pm UTC](https://discussions.flightaware.com/t/errors-registering-alert-endpoint/15727/2 "2014-11-13T18:25:55Z")

</div>

The second argument is not getting passed to us properly for some reason. It is being parsed as a missing/blank argument, so it is being rejected for that reason.

---

<div class="post-metadata">

**Author:** ![gruupmeet](https://avatars.discourse-cdn.com/v4/letter/g/2bfe46/32.png) [@gruupmeet](https://discussions.flightaware.com/u/gruupmeet)\
**Post date:** [November 13, 2014, 8:27pm UTC](https://discussions.flightaware.com/t/errors-registering-alert-endpoint/15727/3 "2014-11-13T20:27:03Z")

</div>

So none of the attempts that I made are actually sending the format\_type? That seems very odd since I included it. Do you have any advice on how to fix this?

---

<div class="post-metadata">

**Author:** ![bovineone](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/bovineone/32/117631_2.png) [@bovineone](https://discussions.flightaware.com/u/bovineone)\
**Post date:** [November 13, 2014, 8:36pm UTC](https://discussions.flightaware.com/t/errors-registering-alert-endpoint/15727/4 "2014-11-13T20:36:32Z")

</div>

Can you try something more similar to our Savon example:

```auto

result = client.request(:register_alert_endpoint) do
  soap.body = {
    :address => 'http://www.whatever.com/flightaware.json',
    :format_type => 'json/post'
  }
end

```

---

<div class="post-metadata">

**Author:** ![gruupmeet](https://avatars.discourse-cdn.com/v4/letter/g/2bfe46/32.png) [@gruupmeet](https://discussions.flightaware.com/u/gruupmeet)\
**Post date:** [November 13, 2014, 9:00pm UTC](https://discussions.flightaware.com/t/errors-registering-alert-endpoint/15727/5 "2014-11-13T21:00:41Z")

</div>

That code does not work with the current version of Savon. I am using Savon 2. For more information look at [savonrb.com/version2/requests.html](http://savonrb.com/version2/requests.html)

---

<div class="post-metadata">

**Author:** ![gruupmeet](https://avatars.discourse-cdn.com/v4/letter/g/2bfe46/32.png) [@gruupmeet](https://discussions.flightaware.com/u/gruupmeet)\
**Post date:** [November 14, 2014, 7:11pm UTC](https://discussions.flightaware.com/t/errors-registering-alert-endpoint/15727/6 "2014-11-14T19:11:31Z")

</div>

I got it to work with:

```auto

response = client.call(:register_alert_endpoint, message: { address: 'http://test.com/flightaware.json', format__type: 'json/post'})

```

It seems like savon adds an extra

> \_

and was just throwing out what it assumed was an invalid key

---

<div class="post-metadata">

**Author:** ![bovineone](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/bovineone/32/117631_2.png) [@bovineone](https://discussions.flightaware.com/u/bovineone)\
**Post date:** [November 14, 2014, 7:16pm UTC](https://discussions.flightaware.com/t/errors-registering-alert-endpoint/15727/7 "2014-11-14T19:16:05Z")

</div>

Were you looking at the raw SOAP request body that Savon was generating to figure that out? Are you saying this is a bug in Savon 2?

---

<div class="post-metadata">

**Author:** ![gruupmeet](https://avatars.discourse-cdn.com/v4/letter/g/2bfe46/32.png) [@gruupmeet](https://discussions.flightaware.com/u/gruupmeet)\
**Post date:** [November 17, 2014, 8:52pm UTC](https://discussions.flightaware.com/t/errors-registering-alert-endpoint/15727/8 "2014-11-17T20:52:36Z")

</div>

Yeah. It is a bug in the way Savon 2 names parameters and handles not valid named keys in the message hash. Thanks for telling me that the parameter was not being sent at all. Without that information it would have been much harder to find the bug.

---

<div class="post-metadata">

**Author:** ![bovineone](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/bovineone/32/117631_2.png) [@bovineone](https://discussions.flightaware.com/u/bovineone)\
**Post date:** [November 17, 2014, 9:25pm UTC](https://discussions.flightaware.com/t/errors-registering-alert-endpoint/15727/9 "2014-11-17T21:25:34Z")

</div>

Have you filed a bug report against Savon 2, if one doesn’t exist already? Or is there something we should be defining differently in our WSDL?

---

<div class="post-metadata">

**Author:** ![gruupmeet](https://avatars.discourse-cdn.com/v4/letter/g/2bfe46/32.png) [@gruupmeet](https://discussions.flightaware.com/u/gruupmeet)\
**Post date:** [November 17, 2014, 11:07pm UTC](https://discussions.flightaware.com/t/errors-registering-alert-endpoint/15727/10 "2014-11-17T23:07:16Z")

</div>

My guess is that it is just the way that Savon tries to clean up function names from the WSDL file to make them more like ruby hash keys. It probably adds an extra ‘\_’ and since they are working on a new version I was just going to manually add the extra underscore in my code for now and update when the new version is ready. It might fix it if the WSDL file defined the parameters like “FormatType” instead of “format\_type”, but I don’t think it is worth the effort of fixing this corner case if I am the only one that actually noticed the problem.
