# REST api: Facebook live from wowza to my page on facebook

**URL:** <https://community.wowza.com/t/rest-api-facebook-live-from-wowza-to-my-page-on-facebook/53502>\
**Category:** Wowza Streaming Engine\
**Tags:** rest-api\
**Created:** [June 12, 2019, 2:56pm UTC](https://community.wowza.com/t/rest-api-facebook-live-from-wowza-to-my-page-on-facebook/53502 "2019-06-12T14:56:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pavlo\_Reznik](https://avatars.discourse-cdn.com/v4/letter/p/5f9b8f/32.png) [@Pavlo\_Reznik](https://community.wowza.com/u/Pavlo_Reznik)\
**Post date:** [June 12, 2019, 2:56pm UTC](https://community.wowza.com/t/rest-api-facebook-live-from-wowza-to-my-page-on-facebook/53502/1 "2019-06-12T14:56:09Z")

</div>

Dear, Friends.

I need help. We try to create a stream target and send a stream to Facebook via REST api.

We already created an application on Facebook and got next permissions:

manage\_pages

publish\_pages

publish\_video

And one feature:

Live Video API

And now we try to create a stream target via REST. We have access token to application on facebook it looks like “id\_app|token” and we get an access token when client login to facebook – it looks like “EAAMJyMNMrW4BALI5MKFCElVhkST86wLPSdrgY2wa1ZCJvz7T7zfvgtMWO…”

We use last one, when we create a stream target via REST.

We build a json in that way:

public static String JSON\_Stream\_target\_reznik ="{ “application”: “stream”, " + ““enabled”: true,” + "“entryName”: “facebook\_test\_timeline”, " + ““facebook.accessToken”: “%s”,” + ““facebook.description”: “this stream is good”,” + ““facebook.destId”: “580359529057496”,” + ““facebook.destName”: “page”,” + ““facebook.destType”: “page”,” + ““facebook.privacy”: “onlyMe”,” + ““facebook.title”: “Live Test”,” + ““facebook.useAppSecret”: “false”,” + ““profile”: “rtmp-facebook”,” + ““sourceStreamName”: “cam.stream”}”;

We created a login button to Facebook:

\<fb:login-button

data-use-continue-as=“false”

data-size=“large”

scope=“email, public\_profile,email,publish\_video,publish\_pages,manage\_pages”

onlogin=“checkLoginState();”

data-auto-logout-link=“true”

\</fb:login-button\>

If I use Facebook api I can get an access token to page I do it with GET

FB.api( ‘/580359529057496/?fields=access\_token’, ‘GET’, function(response) {

console.log(response)

});

And I got a response - access token to my page.

We got next Errors in logs of our new stream target on wowza streaming engine:

PushPublishFacebookHandler.FBMonitor.run(facebook\_test\_timeline:stream/_definst_/cam.stream) : com.wowza.wms.pushpublish.protocol.facebook.FacebookAuthorizationException|at com.wowza.wms.pushpublish.protocol.facebook.PushPublishFacebookUtil.a(PushPublishFacebookUtil.java:559)|at com.wowza.wms.pushpublish.protocol.facebook.PushPublishFacebookUtil.getPageToken(PushPublishFacebookUtil.java:373)|at com.wowza.wms.pushpublish.protocol.facebook.PushPublishFacebook.a(PushPublishFacebook.java:373)|at com.wowza.wms.pushpublish.protocol.facebook.PushPublishFacebook.f(PushPublishFacebook.java:15)|at com.wowza.wms.pushpublish.protocol.facebook.PushPublishFacebook$FBMonitor.run(PushPublishFacebook.java:185)| PushPublishFacebookUtil.detectAuthError[getPageToken]: Please Edit the stream target in WSEM and re-login to Facebook to acquire a new access token and then Save the target PushPublishFacebookUtil.detectAuthError[getPageToken]: Authentication issue. [OAuth “Facebook Platform” “invalid\_request” “Invalid appsecret\_proof provided in the API argument”] PushPublishFacebookUtil.getPageToken: POST path:v3.0/580359529057496 result:400 PushPublishFacebookUtil.getPageToken-response: code: 400, payload: null, headers:{x-fb-request-id=[An72Gfyk622xasEljfjcJ5Y], x-fb-trace-id=[DDY59XbUbhb], null=[HTTP/1.1 400 Bad Request], Access-Control-Allow-Origin=[\*], WWW-Authenticate=[OAuth “Facebook Platform” “invalid\_request” “Invalid appsecret\_proof provided in the API argument”], Connection=[keep-alive], x-fb-rev=[1000818979], Pragma=[no-cache], Date=[Wed, 12 Jun 2019 09:57:55 GMT], Strict-Transport-Security=[max-age=15552000; preload], Cache-Control=[no-store], x-app-usage=[{“call\_count”:1,“total\_cputime”:0,“total\_time”:0}], Expires=[Sat, 01 Jan 2000 00:00:00 GMT], Content-Length=[144], X-FB-Debug=[/tra/6oYoyj1lJi6faL3NJq6ZgG9CYuWTW6BPS1jdtX8uV2XzlRWk1rdbmvWDMGoaMhOhnBjUNppaJUM4XYLfg==], Content-Type=[application/json; charset=UTF-8]} PushPublishFacebookUtil.getPageToken: url [https://graph.facebook.com:443/v3.0/580359529057496?fields=access\_token&access\_token=&appsecret\_proof=](https://graph.facebook.com:443/v3.0/580359529057496?fields=access_token&access_token=&appsecret_proof=) PushPublishFacebookHandler.createChildConfig(facebook\_test\_timeline:stream/_definst_/cam.stream) Acquiring page token

Thank you, for your help

WIth best regards Pavlo Reznik.

UPD:

my PushPublishMap.txt:

cam.stream={“entryName”:“facebook\_test\_timeline”, “profile”:“rtmp-facebook”, “facebook.destName”:“page”, “debugLogChildren”:“true”, “facebook.accessToken”:“EAAMJyMNMrW4BAOZCt0sgb6HN9HqhIeZCZA51cIie…”, “facebook.privacy”:“onlyMe”, “facebook.destType”:“page”, “application”:“stream”, “facebook.description”:“this stream is good”, “debugLog”:“true”, “destinationName”:“facebook”, “facebook.title”:“Live Test”}

as you can see, I can’t find “facebook.useAppSecret”: false, however json has it.

If I add in custom properties facebook.useAppSecret false type Boolean I have next error in my logs:

PushPublishFacebookHandler.init(facebook\_test\_timeline:stream/_definst_/cam.stream) Unsupported map key for profile:facebook.useAppSecret

and now I can see in PushPublishMap.txt:

cam.stream={“entryName”:“facebook\_test\_timeline”, “profile”:“rtmp-facebook”, “facebook.destName”:“page”, “debugLogChildren”:“true”, “facebook.accessToken”:“EAAMJyMNMrW4BAOZCt0sgb6HN9HqhIeZCZA51cIie…”, “facebook.destId”:“580359529057496”, “facebook.privacy”:“onlyMe”, “facebook.useAppSecret”:“false”, “facebook.destType”:“page”, “application”:“stream”, “facebook.description”:“this stream is good”, “debugLog”:“true”, “destinationName”:“facebook”, “facebook.title”:“Live Test”}

I think it’s a problem with a parser, because it can’t find a map key.

---

<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:** [June 12, 2019, 8:13pm UTC](https://community.wowza.com/t/rest-api-facebook-live-from-wowza-to-my-page-on-facebook/53502/2 "2019-06-12T20:13:22Z")

</div>

Hi @Pavlo Reznik, you’re on the right path, but our engineers would like you to submit a support ticket so they view all your log files, upload them and run some tests to find the issue. They’ll get you all set up and running- thanks.

[https://www.wowza.com/support/open-ticket](https://www.wowza.com/support/open-ticket)

---

<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:** [December 16, 2020, 9:46pm UTC](https://community.wowza.com/t/rest-api-facebook-live-from-wowza-to-my-page-on-facebook/53502/3 "2020-12-16T21:46:36Z")

</div>

When using the REST API to configure Wowza Streaming Engine to send a stream to Facebook Live, you must first use an external Facebook application that you’re developing to acquire a Facebook access token. Note the following requirements for the external Facebook application:

- The app must have the required user and account permissions to post live videos to Facebook Live.
- The app’s **Require App Secret** option must be disabled.  
  

[https://www.wowza.com/docs/send-a-stream-to-facebook-with-wowza-streaming-engine-rest-api](https://www.wowza.com/docs/send-a-stream-to-facebook-with-wowza-streaming-engine-rest-api)
