# Create user for REST API & enable Stream Targets for the Application

**URL:** <https://community.wowza.com/t/create-user-for-rest-api-enable-stream-targets-for-the-application/46278>\
**Category:** Wowza Developer Dojo\
**Created:** [November 26, 2015, 12:12am UTC](https://community.wowza.com/t/create-user-for-rest-api-enable-stream-targets-for-the-application/46278 "2015-11-26T00:12:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Leonardo\_Cabral](https://avatars.discourse-cdn.com/v4/letter/l/46a35a/32.png) [@Leonardo\_Cabral](https://community.wowza.com/u/Leonardo_Cabral)\
**Post date:** [November 26, 2015, 12:12am UTC](https://community.wowza.com/t/create-user-for-rest-api-enable-stream-targets-for-the-application/46278/1 "2015-11-26T00:12:59Z")

</div>

Hi guys,

I have two problems to solve on my project. We built a system around Wowza Streaming Engine with a setup script. But I didn’t find:

1 - How to create an user for REST API without the UI (using the command line or the API itself).

2 - How to enable the Stream Targets through REST API. I know how to add new Stream Targets, but I don’t know how to enable the Stream Targets option for the Application.

Someone know something about?

Thank you

---

<div class="post-metadata">

**Author:** ![Roger\_Littin1](https://avatars.discourse-cdn.com/v4/letter/r/c89c15/32.png) [@Roger\_Littin1](https://community.wowza.com/u/Roger_Littin1)\
**Post date:** [November 27, 2015, 9:26am UTC](https://community.wowza.com/t/create-user-for-rest-api-enable-stream-targets-for-the-application/46278/2 "2015-11-27T09:26:13Z")

</div>

Hi,

For the first one, see [https://www.wowza.com/docs/user-management-query-examples](https://www.wowza.com/docs/user-management-query-examples)

For the second one, you need to update the modules to add the Push Publish module. You need to include all of the existing modules in the application when you do the update so get the existing list of modules using the following request:

```auto
curl -X GET --header 'Accept:application/json; charset=utf-8' http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/live/modules

```

That will return something like the following:

```auto
{
  "version":"1448571999000",
  "serverName":"_defaultServer_",
  "moduleList": [
    {
      "order": 0,
      "name": "base",
      "description": "Base",
      "class": "com.wowza.wms.module.ModuleCore"
    },
    {
      "order": 1,
      "name": "logging",
      "description": "Client Logging",
      "class": "com.wowza.wms.module.ModuleClientLogging"
    },
    {
      "order": 2,
      "name": "flvplayback",
      "description": "FLVPlayback",
      "class": "com.wowza.wms.module.ModuleFLVPlayback"
    },
    {
      "order": 3,
      "name": "ModuleCoreSecurity",
      "description": "Core Security Module for Applications",
      "class": "com.wowza.wms.security.ModuleCoreSecurity"
    }
  ]
}

```

Add the Push Publish module to the list and submit it as a PUT request:

```auto
curl -X PUT --header 'Accept:application/json; charset=utf-8' --header 'Content-type:application/json; charset=utf-8' http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/live/modules -d'
{
  "version":"1448571999000",
  "serverName":"_defaultServer_",
  "moduleList": [
    {
      "order": 0,
      "name": "base",
      "description": "Base",
      "class": "com.wowza.wms.module.ModuleCore"
    },
    {
      "order": 1,
      "name": "logging",
      "description": "Client Logging",
      "class": "com.wowza.wms.module.ModuleClientLogging"
    },
    {
      "order": 2,
      "name": "flvplayback",
      "description": "FLVPlayback",
      "class": "com.wowza.wms.module.ModuleFLVPlayback"
    },
    [i]{
      "order": 3,
      "name": "ModulePushPublish",
      "description": "ModulePushPublish",
      "class": "com.wowza.wms.pushpublish.module.ModulePushPublish"
    },[/i]
    {
      "order": 4,
      "name": "ModuleCoreSecurity",
      "description": "Core Security Module for Applications",
      "class": "com.wowza.wms.security.ModuleCoreSecurity"
    }
  ]
}'

```

If the application is currently running, you will need to restart the it after the update:

```auto
curl -X PUT --header 'Accept:application/json; charset=utf-8' --header 'Content-type:application/json; charset=utf-8' http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/live/actions/restart

```

---

<div class="post-metadata">

**Author:** ![Matt\_Young](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/matt_young/32/389_2.png) [@Matt\_Young](https://community.wowza.com/u/Matt_Young)\
**Post date:** [March 1, 2016, 9:31am UTC](https://community.wowza.com/t/create-user-for-rest-api-enable-stream-targets-for-the-application/46278/3 "2016-03-01T09:31:24Z")

</div>

Hello

Please try the following example:

```auto
curl -X POST --header 'Accept:application/json; charset=utf-8' --header 'Content-type:application/json; charset=utf-8' http://localhost:8087/v2/servers/_defaultServer_/publishers -d'
{
"description": "This is my live source encoder.",
"name": "source1",
"password": "myPassword"
}'

```

If it does not work for you, please reply with the exact cURL command you used and the response.

Thanks,

Matt

---

<div class="post-metadata">

**Author:** ![Leonardo\_Cabral](https://avatars.discourse-cdn.com/v4/letter/l/46a35a/32.png) [@Leonardo\_Cabral](https://community.wowza.com/u/Leonardo_Cabral)\
**Post date:** [November 27, 2015, 1:22pm UTC](https://community.wowza.com/t/create-user-for-rest-api-enable-stream-targets-for-the-application/46278/4 "2015-11-27T13:22:29Z")

</div>

Thank you Roger!

Worked perfectly.

---

<div class="post-metadata">

**Author:** ![Lavika\_Kurda](https://avatars.discourse-cdn.com/v4/letter/l/8e7dd6/32.png) [@Lavika\_Kurda](https://community.wowza.com/u/Lavika_Kurda)\
**Post date:** [February 11, 2016, 9:18pm UTC](https://community.wowza.com/t/create-user-for-rest-api-enable-stream-targets-for-the-application/46278/5 "2016-02-11T21:18:53Z")

</div>

Hi,

I am facing a problem in creating a user. The rest API does create a publisher, but with null name. Neither can I edit it on my web version.

Any Idea? Why is this happening?
