# Unhelpful error msg if API command typo

**URL:** <https://discuss.circleci.com/t/unhelpful-error-msg-if-api-command-typo/993>\
**Category:** Bug Reports\
**Created:** [December 8, 2015, 6:29pm UTC](https://discuss.circleci.com/t/unhelpful-error-msg-if-api-command-typo/993 "2015-12-08T18:29:02Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![martinhbramwell](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/martinhbramwell/32/600_2.png) [@martinhbramwell](https://discuss.circleci.com/u/martinhbramwell)\
**Post date:** [December 8, 2015, 6:29pm UTC](https://discuss.circleci.com/t/unhelpful-error-msg-if-api-command-typo/993/1 "2015-12-08T18:29:02Z")

</div>

I just wasted **way** too much time trying to understand why an API command would not work.

Instead of a REST response error message I was getting a blank HTML page with a lot of javascript, and no other indication of a problem.

I was trying . . .

```
curl -X POST --header "Content-Type: application/json" -d '{"type":"deploy-key"}' https://circleci.com/api/v1/project/:username/:project/checkout_key?circle-token=:token -H "Accept: application/json"

```

. . . when I should have written . . .

```
curl -X POST --header "Content-Type: application/json" -d '{"type":"deploy-key"}' https://circleci.com/api/v1/project/:username/:project/checkout-key?circle-token=:token -H "Accept: application/json"

```

See the difference?

---

<div class="post-metadata">

**Author:** ![levlaz](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/levlaz/32/36978_2.png) [@levlaz](https://discuss.circleci.com/u/levlaz)\
**Post date:** [December 8, 2015, 6:47pm UTC](https://discuss.circleci.com/t/unhelpful-error-msg-if-api-command-typo/993/2 "2015-12-08T18:47:09Z")

</div>

> [@martinhbramwell](#):
>
> curl -X POST --header “Content-Type: application/json” -d ‘{“type”:“deploy-key”}’ [https://circleci.com/api/v1/project/:username/:project/checkout-key?circle-token=:token](https://circleci.com/api/v1/project/:username/:project/checkout-key?circle-token=:token) -H “Accept: application/json”

Ouch – I had to use a diff to see the difference. Thank you for letting us know. 🙂

 ![](https://global.discourse-cdn.com/circleci/original/1X/dfbb4546da6f887c682e83d461954069b8c2a1ea.png)

---

<div class="post-metadata">

**Author:** ![alexey](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/alexey/32/42_2.png) [@alexey](https://discuss.circleci.com/u/alexey)\
**Post date:** [December 9, 2015, 2:45pm UTC](https://discuss.circleci.com/t/unhelpful-error-msg-if-api-command-typo/993/3 "2015-12-09T14:45:34Z")

</div>

Spend some time looking at the diff—the difference seems to be in using the dash ( `-` ) in the correct variant and underscore ( `_` ) in the one that didn’t work.

---

<div class="post-metadata">

**Author:** ![martinhbramwell](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/martinhbramwell/32/600_2.png) [@martinhbramwell](https://discuss.circleci.com/u/martinhbramwell)\
**Post date:** [December 9, 2015, 3:01pm UTC](https://discuss.circleci.com/t/unhelpful-error-msg-if-api-command-typo/993/4 "2015-12-09T15:01:39Z")

</div>

Alexey, I’m sorry … you misunderstood the point of my post.

I found the \_ vs - error myself. The point was that the REST API error response was absolutely useless in helping me determine quickly what I had done wrong. Were the response to have been . . .

```
Unknown command 'checkout_key'. Cannot process.

```

. . . I would have solved it instantly.

---

<div class="post-metadata">

**Author:** ![alexey](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/alexey/32/42_2.png) [@alexey](https://discuss.circleci.com/u/alexey)\
**Post date:** [December 9, 2015, 7:20pm UTC](https://discuss.circleci.com/t/unhelpful-error-msg-if-api-command-typo/993/5 "2015-12-09T19:20:42Z")

</div>

Got it, Martin, thanks for clarifying. We’ll see what we can do about this.

---

<div class="post-metadata">

**Author:** ![mecampbellsoup](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/mecampbellsoup/32/14647_2.png) [@mecampbellsoup](https://discuss.circleci.com/u/mecampbellsoup)\
**Post date:** [November 21, 2016, 6:37pm UTC](https://discuss.circleci.com/t/unhelpful-error-msg-if-api-command-typo/993/6 "2016-11-21T18:37:18Z")

</div>

@alexey @martinhbramwell this might sound dumb, but you didn’t actually leave the URL with e.g. `:username` and `:project` right? You have to swap those values with the _actual_ username and project you want to point to…

I’m asking because I’m having an issue like the one you described:

> Instead of a REST response error message I was getting a blank HTML page with a lot of javascript, and no other indication of a problem.

Here’s my command:

```shell
curl -X POST -H "Accept: application/json" -H "Content-Type: application/json" "https://circleci.com/api/v1.1/project/gh/:username/:project?circle-token=${CIRCLE_TOKEN}"

```

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [June 18, 2018, 11:33am UTC](https://discuss.circleci.com/t/unhelpful-error-msg-if-api-command-typo/993/7 "2018-06-18T11:33:54Z")

</div>

Closed on June 18, 2018, 11:33am UTC


