# WSE REST API - Connect a stream file not working

**URL:** <https://community.wowza.com/t/wse-rest-api-connect-a-stream-file-not-working/95119>\
**Category:** Wowza Streaming Engine\
**Tags:** rest-api\
**Created:** [July 7, 2022, 9:35am UTC](https://community.wowza.com/t/wse-rest-api-connect-a-stream-file-not-working/95119 "2022-07-07T09:35:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![HanChang\_Cheng](https://avatars.discourse-cdn.com/v4/letter/h/8dc957/32.png) [@HanChang\_Cheng](https://community.wowza.com/u/HanChang_Cheng)\
**Post date:** [July 7, 2022, 9:35am UTC](https://community.wowza.com/t/wse-rest-api-connect-a-stream-file-not-working/95119/1 "2022-07-07T09:35:40Z")

</div>

Hi  
I try to use this site’s API , **All APIs except connect can be executed**  
[https://www.wowza.com/docs/stream-management-query-examples](https://www.wowza.com/docs/stream-management-query-examples)

> curl -X PUT   
> -u “user:pwd”   
> -H ‘Accept:application/json; charset=utf-8’   
> -H ‘Content-type:application/json; charset=utf-8’   
> “[http://localhost:8087/v2/servers/\_defaultServer\_/vhosts/\_defaultVHost\_/applications/L\_A/streamfiles/B0\_B10\_166/actions/connect?connectAppName=L\_A&appInstance=\_definst\_&mediaCasterType=rtp](http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/L_A/streamfiles/B0_B10_166/actions/connect?connectAppName=L_A&appInstance=_definst_&mediaCasterType=rtp)”

my application : L\_A  
stream files: B0\_B10\_166  
servers and vhosts use default.

Finally I got this result  
{“success”:false,“message”:null,“data”:null}

System log Error Msg ( wowzastreamingengine\_access.log )

> 2022-07-07 17:20:39 CST comment server ERROR 500 - class com.wowza.wms.rest.vhosts.applications.streamfiles.StreamFileAppConfig.connectStreamFileAction : java.lang.NullPointerException|at java.base/java.net.URLDecoder.decode(Unknown Source)|at java.base/java.net.URLDecoder.decode(Unknown Source)|at com.wowza.wms.rest.vhosts.streamfiles.StreamFileConfig.connectAction(StreamFileConfig.java:611)|at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)|at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)|at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)|at java.base/java.lang.reflect.Method.invoke(Unknown Source)|at com.wowza.wms.rest.ActionBase.get(ActionBase.java:173)|at com.wowza.wms.rest.ActionBase.put(ActionBase.java:121)|at com.wowza.wms.rest.vhosts.applications.streamfiles.StreamFileAppAction.put(StreamFileAppAction.java:75)|at org.restlet.resource.ServerResource.doHandle(ServerResource.java:434)|at org.restlet.resource.ServerResource.doNegotiatedHandle(ServerResource.java:666)|at org.restlet.resource.ServerResource.doConditionalHandle(ServerResource.java:348)|at org.restlet.resource.ServerResource.handle(ServerResource.java:1020)| - - - 6489.014
> 
> 2022-07-07 17:20:39 CST comment server ERROR 500 - REST API: Connect Stream file: null - - - 6489.014

My WSE version is 4.8.18+1

Server.xml

```
<RESTInterface>
                        <Enable>true</Enable>
                        <IPAddress>*</IPAddress>
                        <Port>8087</Port>
                        <!-- none, basic, digest, remotehttp, digestfile-->
                        <AuthenticationMethod>basic</AuthenticationMethod>
                        <!-- cleartext, digest, bcrypt -->
                        <PasswordEncodingScheme>bcrypt</PasswordEncodingScheme>
                        <DiagnosticURLEnable>true</DiagnosticURLEnable>
                        <SSLConfig>
                                <Enable>false</Enable>
                                <KeyStorePath></KeyStorePath>
                                <KeyStorePassword></KeyStorePassword>
                                <KeyStoreType>JKS</KeyStoreType>
                                <SSLProtocol>TLS</SSLProtocol>
                                <Algorithm>SunX509</Algorithm>
                                <CipherSuites></CipherSuites>
                                <Protocols></Protocols>
                        </SSLConfig>
                        <IPWhiteList>127.0.0.1</IPWhiteList>
                        <IPBlackList></IPBlackList>
                        <EnableXMLFile>false</EnableXMLFile>
                        <DocumentationServerEnable>false</DocumentationServerEnable>
                        <DocumentationServerPort>8089</DocumentationServerPort>
                        <!-- none(only) -->
                        <DocumentationServerAuthenticationMethod>none</DocumentationServerAuthenticationMethod>
                        <Properties>
                        </Properties>
 </RESTInterface>

```

so how to solve this problem?

---

<div class="post-metadata">

**Author:** ![HanChang\_Cheng](https://avatars.discourse-cdn.com/v4/letter/h/8dc957/32.png) [@HanChang\_Cheng](https://community.wowza.com/u/HanChang_Cheng)\
**Post date:** [July 8, 2022, 5:23am UTC](https://community.wowza.com/t/wse-rest-api-connect-a-stream-file-not-working/95119/2 "2022-07-08T05:23:00Z")

</div>

problem solved.

The “” of the URL cannot be omitted when calling this API

**“[http://localhost:8087/v2/servers/](http://localhost:8087/v2/servers/) _defaultServer_ /vhosts/ _defaultVHost_ /applications/L\_A/streamfiles/B0\_B10\_166/actions/connect?connectAppName=L\_A&appInstance= _definst_ &mediaCasterType=rtp”**

---

<div class="post-metadata">

**Author:** ![Rose\_Power-Wowza\_Com](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/rose_power-wowza_com/32/431_2.png) [@Rose\_Power-Wowza\_Com](https://community.wowza.com/u/Rose_Power-Wowza_Com)\
**Post date:** [July 8, 2022, 3:54pm UTC](https://community.wowza.com/t/wse-rest-api-connect-a-stream-file-not-working/95119/3 "2022-07-08T15:54:58Z")

</div>

Thank you so much @HanChang_Cheng for sharing what the problem and solution was. Really appreciate it since these forums get so many visitors a month.
