Agora cloud recording is not saving file in S3 when streaming from android - agora.io

I have already viewed this question
I followed the procedure, first called acquire then start then stop
I followed the procedure , first called acquire then start then stop
Here is my acquire call
https://api.agora.io/v1/apps/{{APPID}}/cloud_recording/acquire
Request body
{
"cname": "{{AccessChannel}}",
"uid": "{{RecordingUID}}",
"clientRequest":{
}
}
The response
{
"resourceId": "nUwUbQf9Zg6tsgtLslGnDg0lk8RYaUE09pqOuSIgwfzZ8g-RNe4wP9vsFnBhU785sHbxN0_dI8MVBqLWrCy7TCUo4U3XXne-2hA7expaSg-NgpZ5PcnFK-IrNSvmFNJqL4PGS9hw2q7lDYEtJH_0VgBG4Qdsg2TofWuF2DW7IMAt8NYBp9Hh_06d1K3pIcMJFPUWvfV7fInPDrecYuDmZdiRS9AYydjQlHa6jb51S0sKXzTVYELCJZAXP-ALS_whAh_ojFeltKLKzOC9iYodyAAwq4QnclbL3LKvBeVtCEfS9WjyYzyHDhCngJ-JrIwW"
}
Then I call start
URL : https://api.agora.io/v1/apps/{{APPID}}/cloud_recording/resourceid/{{resourceId}}/mode/mix/start
Body:
{
"cname":"{{AccessChannel}}",
"uid":"{{RecordingUID}}",
"clientRequest":{
"recordingConfig":{
"maxIdleTime":300,
"streamTypes":2,
"channelType":1,
"videoStreamType":0,
"transcodingConfig":{
"height":640,
"width":360,
"bitrate":500,
"fps":15,
"mixedVideoLayout":1,
"backgroundColor":"#FF0000"
},
"subscribeVideoUids":[
"123",
"456"
],
"subscribeAudioUids":[
"123",
"456"
],
"subscribeUidGroup":0
},
"storageConfig":{
"vendor":1,
"region":0,
"bucket":"{{Bucket}}",
"accessKey":"{{AccessKey}}",
"secretKey":"{{SecretKey}}",
"fileNamePrefix":[
"directory1",
"directory2"
]
},
"recordingFileConfig":{
"avFileType":[
"hls"
]
}
}
}
Response
{
"resourceId": "nUwUbQf9Zg6tsgtLslGnDg0lk8RYaUE09pqOuSIgwfzZ8g-RNe4wP9vsFnBhU785sHbxN0_dI8MVBqLWrCy7TCUo4U3XXne-2hA7expaSg-NgpZ5PcnFK-IrNSvmFNJqL4PGS9hw2q7lDYEtJH_0VgBG4Qdsg2TofWuF2DW7IMAt8NYBp9Hh_06d1K3pIcMJFPUWvfV7fInPDrecYuDmZdiRS9AYydjQlHa6jb51S0sKXzTVYELCJZAXP-ALS_whAh_ojFeltKLKzOC9iYodyAAwq4QnclbL3LKvBeVtCEfS9WjyYzyHDhCngJ-JrIwW",
"sid": "6068aec4fd4fc47b623bceaf1f2c8f6b"
}
And finally I called stop
URL: https://api.agora.io/v1/apps/{{APPID}}/cloud_recording/resourceid/{{resourceId}}/sid/{{sid}}/mode/mix/stop
Body:
{
"cname": "{{AccessChannel}}",
"uid": "{{RecordingUID}}",
"clientRequest": {}
}
And the response is
{
"resourceId": "nUwUbQf9Zg6tsgtLslGnDg0lk8RYaUE09pqOuSIgwfzZ8g-RNe4wP9vsFnBhU785sHbxN0_dI8MVBqLWrCy7TCUo4U3XXne-2hA7expaSg-NgpZ5PcnFK-IrNSvmFNJqL4PGS9hw2q7lDYEtJH_0VgBG4Qdsg2TofWuF2DW7IMAt8NYBp9Hh_06d1K3pIcMJFPUWvfV7fInPDrecYuDmZdiRS9AYydjQlHa6jb51S0sKXzTVYELCJZAXP-ALS_whAh_ojFeltKLKzOC9iYodyAAwq4QnclbL3LKvBeVtCEfS9WjyYzyHDhCngJ-JrIwW",
"sid": "6068aec4fd4fc47b623bceaf1f2c8f6b",
"code": 435
}
I am not sure what did I do wrong ?
My streaming is running on a android device , only one broadcaster no audience
And I called the API from postman
I have double checked every parameter

Please make sure you are passing the authentication token in the request body of start API.
Here is sample
{
"cname":"{{AccessChannel}}",
"uid":"{{RecordingUID}}",
"clientRequest":{
"token": "<place token here>",
"recordingConfig":{
"maxIdleTime":300,
"streamTypes":2,
"channelType":1,
"videoStreamType":0,
"transcodingConfig":{
"height":640,
"width":360,
"bitrate":500,
"fps":15,
"mixedVideoLayout":1,
"backgroundColor":"#FF0000"
},
"subscribeVideoUids":[
"123",
"456"
],
"subscribeAudioUids":[
"123",
"456"
],
"subscribeUidGroup":0
},
"storageConfig":{
"vendor":1,
"region":0,
"bucket":"{{Bucket}}",
"accessKey":"{{AccessKey}}",
"secretKey":"{{SecretKey}}",
"fileNamePrefix":[
"directory1",
"directory2"
]
},
"recordingFileConfig":{
"avFileType":[
"hls"
]
}
}
}

Related

Bad Request: One or more of the contents is not owned by the author. All contents must be owned by the author

I've been trying to POST an image to linkedin via the API given by linkedin: https://api.linkedin.com/v2/ugcPosts
Here are some of the steps I followed according to their documentation:
Step 1: Register the image,
Response I get:
{
"value": {
"mediaArtifact": "urn:li:digitalmediaMediaArtifact:(urn:li:digitalmediaAsset:C4D22AQHnSETazVUUiw,urn:li:digitalmediaMediaArtifactClass:feedshare-uploadedImage)",
"uploadMechanism": {
"com.linkedin.digitalmedia.uploading.MediaUploadHttpRequest": {
"uploadUrl": "https://api.linkedin.com/mediaUpload/C4D22AQHnSETazVUUiw/feedshare-uploadedImage/0?ca=vector_feedshare&cn=uploads&m=AQKy8KTj9ZExhAAAAYUvD_6GEclpKOZdwJvPF682Ld1UUb6h0V7VvAtpuA&app=206373578&sync=0&v=beta&ut=3dh6EETZGM5WA1",
"headers": {
"media-type-family": "STILLIMAGE"
}
}
},
"asset": "urn:li:digitalmediaAsset:C4D22AQHnSETazVUUiw",
"assetRealTimeTopic": "urn:li-realtime:digitalmediaAssetUpdatesTopic:urn:li:digitalmediaAsset:C4D22AQHnSETazVUUiw"
}
}
Step 2: Upload the image using upload URL from Step 1
Response: 201 Created status code with no message
Checked the status, it's says available: https://api.linkedin.com/v2/assets/C4D22AQHnSETazVUUiw
{
"recipes": [
{
"recipe": "urn:li:digitalmediaRecipe:feedshare-image",
"status": "AVAILABLE"
}
],
"serviceRelationships": [
{
"relationshipType": "OWNER",
"identifier": "urn:li:userGeneratedContent"
}
],
"mediaTypeFamily": "STILLIMAGE",
"created": 1671531855410,
"id": "C4D22AQHnSETazVUUiw",
"lastModified": 1671531901231,
"status": "ALLOWED"
}
Now when I am trying to POST it to the endpoint: https://api.linkedin.com/v2/ugcPosts
It's giving 400 bad Request with the following Error:
{
"errorDetailType": "com.linkedin.common.error.BadRequest",
"message": "com.linkedin.content.common.exception.BadRequestResponseException: One or more of the contents is not owned by the author. All contents must be owned by the author",
"errorDetails": {
"inputErrors": [
{
"description": "Content(s) you provided must be owned by post author",
"input": {},
"code": "INVALID_CONTENT_OWNERSHIP"
}
]
},
"status": 400
}
I've given all permissions to it:
r_emailaddress, r_liteprofile, w_member_social

How to receive the media id from the Whatsapp Business Cloud API?

I have deployed my webhook and connected my WABA. Once I send an image to this business account. It did not return the media id from the response. Actually, the JSON returned to me like this:
{
"entry": [
{
"changes": [
{
"field": "messages",
"value": {
"contacts": [
{
"profile": {
"name": "XXXXXXX"
}
}
],
"messages": [
{
"from": "XXXXXXXXXX",
"id": "wamid.aisjdoiajsodiajsodasd\u003d",
"timestamp": "1657527108",
"type": "image"
}
],
"metadata": {}
}
}
],
"id": "124071984791824"
}
],
"object": "whatsapp_business_account"
}
Or should I try the Whatsapp On-premises API? https://developers.facebook.com/docs/whatsapp/on-premises/reference/media/media-id
You have to chooose the image_id from the request you receive.
like , let media_id=req.body.entry[0].changes[0].value.messages[0].image.id;
you can store this id in DB and use the endpioint where you can get the url for media_id.
Then you can download the image from the URL received and uploaded it anywhere you want.

paypal-checkout-component for vue stays in sandbox mode

I'm struggling to go live. It's weird how something works in sandbox mode but then either there is no documented way to switch to production or it just does not work.
So here is what I got:
<template lang="pug">
.paypal
Spinner(:size="8" :thickness="3")
PaypalButtons.buttons(
:env="env"
:style="style"
:createOrder="order"
:onInit="init"
:onClick="validate"
:onApprove="approve"
:onError="error"
)
</template>
<script>
export default {
name: 'PayPal',
props: {
env: {
type: String,
default: 'sandbox',
validator: value => ['sandbox', 'production'].includes(value)
},
},
// ...
}
</script>
I've tried to set the env prop to production and removing it completely. I can not find any documentation on how to set the environment. I must miss something fundamental.
The error:
As I mentioned the sandbox mode works fine, but as soon as I go live (server side using PayPals production URL and client side with the corresponding env prop), I'm getting the following errors
Request
URL: https://www.sandbox.paypal.com/graphql?UpdateClientConfig.
BODY:
{
"query": "\n mutation UpdateClientConfig(\n $orderID : String!,\n $fundingSource : ButtonFundingSourceType!,\n $integrationArtifact : IntegrationArtifactType!,\n $userExperienceFlow : UserExperienceFlowType!,\n $productFlow : ProductFlowType!,\n $buttonSessionID : String\n ) {\n updateClientConfig(\n token: $orderID,\n fundingSource: $fundingSource,\n integrationArtifact: $integrationArtifact,\n userExperienceFlow: $userExperienceFlow,\n productFlow: $productFlow,\n buttonSessionID: $buttonSessionID\n )\n }\n ",
"variables": {
"orderID": "17884710UT885974F",
"fundingSource": "paypal",
"integrationArtifact": "PAYPAL_JS_SDK",
"userExperienceFlow": "INCONTEXT",
"productFlow": "SMART_PAYMENT_BUTTONS"
}
}
Response:
{
"data": {
"updateClientConfig": null
},
"errors": [
{
"_name": "RESOURCE_NOT_FOUND",
"checkpoints": [
"patchClientConfig"
],
"contingency": true,
"data": {
"message": "The specified resource does not exist."
},
"message": "RESOURCE_NOT_FOUND",
"meta": {},
"path": [
"updateClientConfig"
],
"statusCode": 200
}
],
"extensions": {
"correlationId": "464b1d56d4581",
"tracing": {
"duration": 98157194,
"endTime": "2021-09-06T16:29:45.133Z",
"execution": {
"resolvers": [
{
"duration": 96271082,
"fieldName": "updateClientConfig",
"parentType": "Mutation",
"path": [
"updateClientConfig"
],
"returnType": "Boolean",
"startOffset": 1222180
}
]
},
"startTime": "2021-09-06T16:29:45.035Z",
"version": 1
}
}
}
There is another request to https://www.sandbox.paypal.com/graphql?GetCheckoutDetails with a similar response.
As far as I can tell the request URL should not be www.sandbox.paypal...
I have also commented on an existing issue on GitHub, but I believe it will take too long to get an answer that way.
You are using a sandbox client ID.
Change to a live client ID, from an app in the "Live" tab of your Applications in developer.paypal.com

MFP 8 - error parsing JSON object when using MobileFirst Push API

I am getting the following error when I tried to used the push API to send a notification. The JSON object works in version V7.1
{
"code": "FPWSE0011E",
"message": "Bad Request - The JSON validation failed at 'target'.",
"productVersion": "8.0.0.00-20161122-1902"
}
Here is my JSON object
{
"message": {
"alert": "hello"
},
"settings": {
"apns": {
"badge": 1,
"iosActionKey": "Ok",
"payload": {
"messageType": "HELLO",
"detail": "Here's your message details."
},
"sound": "song.mp3"
},
"gcm": {
"payload": {},
"sound": "song.mp3"
}
},
"target": {
"consumerIds": [],
"deviceIds": ["4A1086CF-873A-4404-BE2D-200EA6BDA8AD"],
"platforms": [
"A","G"
]
}
}
I am using the admin RestAPi interface
https://myserver/mfpadmin/management-apis/2.0/runtimes/mfp/notifications/applications/com.myjobs/messages
I followed the format from the documentation
http://www.ibm.com/support/knowledgecenter/SSHS8R_8.0.0/com.ibm.worklight.apiref.doc/apiref/r_restapi_send_message_post.html
Thanks for your help
According to the v8.0 documentation only 1 property is allowed in target. In your JSON I see several properties are defined.
See example JSON here: https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/notifications/sending-notifications/#sending-notifications
And as can be seen:
target" : {
// The list below is for demonstration purposes only - per the documentation only 1 target is allowed to be used at a time.
"deviceIds" : [ "MyDeviceId1", ... ],
"platforms" : [ "A,G", ... ],
"tagNames" : [ "Gold", ... ],
"userIds" : [ "MyUserId", ... ],
},

Pushwoosh create message get 200, but say UnknownDevices

My system running at least two years. Most push notification requests got 200. But, recently, I found I got 500 frequently.
Nealy 10% push notifications got 500.
Please HELP!!!
I have resend the problem messages, every thing is fine.
Example:
Request is:
{
"request": {
"application": "3DXXX-59XXX",
"username": "MyXXXXX",
"password": "********",
"notifications": [
{
"send_date": "now",
"content": {
"en": "Subscriber ID. 9000 Close User 01"
},
"link": "",
"data": {
"userID": "12345"
},
"wp_type": "",
"wp_background": "",
"wp_count": "",
"ios_badges": 51,
"ios_sound": "short-tone.caf",
"devices": [
"APA91bHZHEhIMjVYwxyMk-4-YObazHfcxlQq7CmYto930nuIqHlQGCdzUQsnDcnHTB78wUcTlm-qhV3ipMqe9HO3kTqD9j_zgzSUUAdoGK0fbeRRGMNn69Z63BlQ9RqIdioZ4J2NFA0DLOUkroImk-it8p_3Glr5bRlnrl1_wT3ycXfsgvQZq4g"
],
"page_id": "0",
"android_sound": "five_sectoneone"
}
]
}
}
Response is:
{"status_code":500,"status_message":"Invalid devices list"}
==============================================================
========================= Update =============================
After I upgrade Pushwoosh API from V1.2 to V1.3, the problem is gone.
However, new problem comes.
My sample is:
request :
{
"request": {
"application": "3DXXX-59XXX",
"auth": "*********WqLiS5ZM2****************************************9eib******",
"notifications": [
{
"send_date": "now",
"content": {
"en": "Jones Residence Tue,17Jul 12:12 Test from Robbie......."
},
"link": "",
"data": {
"userID": "12345"
},
"wp_type": "",
"wp_background": "",
"wp_count": "",
"ios_badges": 39,
"ios_sound": "short-tone.caf",
"devices": [
"298eeXXXXa26849cc77da16adXXXXc1c801df12e79bad1e724829aXXXXcbe07d" //I hashed real ID here
],
"page_id": "0",
"android_sound": "five_sectoneone"
}
]
}
}
Response is:
{
"status_code": 200,
"status_message": "OK",
"response": {
"Messages": [
"D954-3C45B1AA-AA6293E5"
],
"UnknownDevices": {
"D954-3C45B1AA-AA6293E5": [
"298eeXXXXa26849cc77da16adXXXXc1c801df12e79bad1e724829aXXXXcbe07d" //I hashed real ID here
]
}
}
}
I see you already wrote the question in Pushwoosh community. I'll post the answer here as well.
The "UnknownDevice" warning indicates that the push token that you have put in the "devices" section of the createMessage request isn't in our databases.
There are several reasons for that:
1) The application was deleted from the device.
2) The push token was renewed. APNs/GCM/etc. tends to change push tokens from time to time, and we remove outdated push tokens from our servers. (This happens VERY rarely)
3) There is a misprint in your request. (I'm sure this is not the case)
Please note that in order to keep your userbase up-to-date you can use getUnregisteredDevices method, which would return a last thousand of removed push tokens. You will need to call this on a regular basis.
P.S. https://community.pushwoosh.com/questions/998/pushwoosh-create-message-get-200-but-says-unknowndevices
P.P.S. Do not use 1.2 API, it is very old and will be deprecated soon.
I think, you use wrong device token. Don't use device UUID. You can send device token to your database after put it deviceArray in the Java code.
Edit PushwooshiOS.js file;
pushNotification.registerDevice(
function(status)
{
var deviceToken = status['deviceToken'];
console.warn('registerDevice: ' + deviceToken);
$.ajax({
url : "http://ip:port/deviceid/"+deviceToken,
dataType : "json",
success : function(a, b, c) {
console.log("send tokens to server after call t in your json array");
},
error : function(a, b, c) {
console.log("err a ", a);
console.log("err b ", b);
console.log("err c ", c);
console.log("err c ", c);
}
});
onPushwooshiOSInitialized(deviceToken);
},
function(status)
{
console.warn('failed to register : ' + JSON.stringify(status));
//alert(JSON.stringify(['failed to register ', status]));
}
);
Java code
String method = "createMessage";
URL url = new URL(PUSHWOOSH_SERVICE_BASE_URL + method);
JSONArray deviceArray = new JSONArray();
// put your device tokens
deviceArray.put(deviceToken);
JSONArray notificationsArray = new JSONArray()
.put(new JSONObject().put("send_date", "now")
.put("content", "A test push")
.put("devices",deviceArray));
JSONObject requestObject = new JSONObject()
.put("application", APPLICATION_CODE)
.put("auth", AUTH_TOKEN)
.put("notifications", notificationsArray);
JSONObject mainRequest = new JSONObject().put("request", requestObject);
JSONObject response = SendServerRequest.sendJSONRequest(url, mainRequest.toString());