# Creating a server user using curl on Windows command line?

**URL:** <https://community.wowza.com/t/creating-a-server-user-using-curl-on-windows-command-line/55188>\
**Category:** Wowza Streaming Engine\
**Tags:** rest-api\
**Created:** [May 15, 2020, 4:14pm UTC](https://community.wowza.com/t/creating-a-server-user-using-curl-on-windows-command-line/55188 "2020-05-15T16:14:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Terence\_Darwen](https://avatars.discourse-cdn.com/v4/letter/t/35a633/32.png) [@Terence\_Darwen](https://community.wowza.com/u/Terence_Darwen)\
**Post date:** [May 15, 2020, 4:14pm UTC](https://community.wowza.com/t/creating-a-server-user-using-curl-on-windows-command-line/55188/1 "2020-05-15T16:14:35Z")

</div>

I’m trying to “create a server user” as explained in [this REST API documentation example](https://www.wowza.com/docs/user-management-query-examples). I’m using curl on the Windows command line as shown below. I get a fairly cryptic error response (also shown below). The error log also gives me an error message (also shown below), but I’m not finding that very helpful either. I’ve been able to issue simpler curl commands. For example, the command to query log info as shown below works fine. Any help on what I’m doing wrong with would be appreciated. Thank you.

Windows command line curl command I use:

```auto
curl -X POST --digest -u "user:pw" http://localhost:8087/v2/servers/_defaultServer_/users -d @json.txt

```

json.txt:

```auto
{ "userName": "WowzaNewbie", "password":"mypassword", "groups": [""] }

```

Command line response:

```auto
<?xml version="1.0" encoding="UTF-8" standalone="no"?><error><wowzaServer>4.8.0</wowzaServer><code>500</code><message>The server encountered an unexpected condition which prevented it from fulfilling the request</message></error>

```

Error Log Info:

```auto
ERROR server comment 2020-05-15 09:33:35 - - - - - 88596.69 - - - - - - - - class com.wowza.wms.rest.user.UserConfig.post : java.lang.NullPointerException|at com.wowza.wms.rest.ConfigBase.post(ConfigBase.java:3578)|at com.wowza.wms.rest.user.UsersConfig.post(UsersConfig.java:324)|at org.restlet.resource.ServerResource.doHandle(ServerResource.java:454)|at org.restlet.resource.ServerResource.doNegotiatedHandle(ServerResource.java:683)|at org.restlet.resource.ServerResource.doConditionalHandle(ServerResource.java:357)|

```

This curl command works fine:

```auto
curl -X GET --digest -u "user:pw" "http://localhost:8087/v2/servers/_defaultServer_/logfiles?order=newestFirst"

```

---

<div class="post-metadata">

**Author:** ![Amara\_Graham](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/amara_graham/32/381_2.png) [@Amara\_Graham](https://community.wowza.com/u/Amara_Graham)\
**Post date:** [May 18, 2020, 3:06pm UTC](https://community.wowza.com/t/creating-a-server-user-using-curl-on-windows-command-line/55188/2 "2020-05-18T15:06:46Z")

</div>

I ran this just now in Postman and was able to get the same 500 error when my JSON body was set to text and not JSON. Instead of sending your JSON file as a .txt, can you send it as a .json file?

---

<div class="post-metadata">

**Author:** ![Terence\_Darwen](https://avatars.discourse-cdn.com/v4/letter/t/35a633/32.png) [@Terence\_Darwen](https://community.wowza.com/u/Terence_Darwen)\
**Post date:** [May 21, 2020, 10:26pm UTC](https://community.wowza.com/t/creating-a-server-user-using-curl-on-windows-command-line/55188/3 "2020-05-21T22:26:04Z")

</div>

Hi Amara - Thanks for the reply. I believe the issue was with properly escaping slashes and quotes on the Windows command line. I switched to a BASH command line that runs on Windows and was able to run this with no problem… So problem solved… Thanks again. -Terence

---

<div class="post-metadata">

**Author:** ![Amara\_Graham](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/amara_graham/32/381_2.png) [@Amara\_Graham](https://community.wowza.com/u/Amara_Graham)\
**Post date:** [May 21, 2020, 10:34pm UTC](https://community.wowza.com/t/creating-a-server-user-using-curl-on-windows-command-line/55188/4 "2020-05-21T22:34:08Z")

</div>

No problem! Glad you got it working. Escaping is always sneaky.
