Why is smooch api rejecting any image is post as mediaUrl on post message conversation api - smooch

Here's the error message, for message type "image" and "file"
{"error": { "code":"invalid_file",
"description":"File rejected. File type not allowed"}
}

Your file upload was most likely rejected because of a disallowed file extension. The whitelist of file extensions accepted by Smooch is documented here.

Related

Logic Apps + Form Recognizer unable to send PDF to service

I have an Azure Logic App that uses a Analyze Document for Prebuilt or Custom models (v3.0 API) action. The Custom Model is good, I can hit it with Postman with no issue.
When I try to get a PDF from Sharepoint and send it to the service, I get an error saying:
{
"error": {
"code": "InvalidRequest",
"message": "Invalid request.",
"innererror": {
"code": "InvalidContent",
"message": "The file is corrupted or format is unsupported. Refer to documentation for the list of supported formats."
}
}
}
I've tried:
Passing the Get file content directly to the Document/Image File Content input
Passing body('Get_file_content)['$content']
Passing concat('data:application/pdf;base64,',body('Get_file_content')['$content']
This one converts to PDF in a Base64-to-PDF tool so I know the Base64 is good
Then I found out that the service wants binary format:
Passing base64ToBinary(body('Get_file_content')['$content'])
Still no go
Why can I not send the file to the Form Recognizer service?
EDIT:
Thank you to #vijaya. They helped me see that the Document/Image URL parameter was not necessary. Leaving that blank and using the original Get File Content worked!
Issue is with content-type. You need to pass content-type along with content for analyze document. I have reproduced issue from my side and below are steps I followed,
Initially created logic app as shown below,
Logic app failed with error,
The file is corrupted or format is unsupported. Refer to documentation for the list of supported formats.
Next modified logic app as shown below,
In Compose action setting content as
outputs('Get_blob_content_(V2)')?['body']?['$content'] and passing content-type as application/pdf as we are dealing with pdf files.
In Analyze Document for Prebuilt or Custom models (v3.0 API) action, using outputs of compose in Document/Image File Content.
Logic app ran successfully as shown below,
Output of Analyze Document is as shown below,

How to send Whatsapp message using MessageBird from Firebase cloud function?

I have installed MessageBird Firebase Extension.
I want to send Whatsapp template(template has Button with website link) message from Firebase Cloud Functions.
To send a Whatsapp message, I need to create a document in Firebase 'messages' collection, so that MessageBird extension processes it.
What should be the format of Firebase document to send Whatsapp message? I have attached the Whatsapp template
I have tried creating Firebase document similar to this API request format - https://developers.messagebird.com/quickstarts/whatsapp/send-message-with-buttons/, but I got delivery error 'Error: api error(s): JSON is not a valid format (code: 21)'.
Thank you.
You are right, you need to put a document with content into Firestore message collection that is accepted by ConversationsAPI, and then the message should be sent and the document should be updated with delivery details (response from MessageBird Conversations API).
This is example of the document that you will need to put to be able to send WA template message:
db.collection('YOUR_DOCUMENT_COLLECTION').add({
channelId: 'YOUR_CHANNEL_ID',
type: 'hsm',
content: {
hsm: {
namespace: 'YOUR_WA_ACCOUNT_NAMESPACE_ID',
templateName: 'YOUR_WA_TEMPLATE_NAME',
params: [{ default: 'YOU_PARAM_VALUE' }],
language: { code: 'en_US', policy: 'deterministic' }
}
},
to: 'RECIPIENT_OF_THE_MESSAGE',
});
You can find more details about HSM object and what each field means here: https://developers.messagebird.com/api/conversations/#messagehsm-object
I hope that helps.

NetSuite RESTlet NLAuth using Postman

I'm new in NetSuite and I tried to make a REST request using Postman I've write in header the NLAuth authorization like the line above:
Authorization : NLAuth nlauth_account=0000000, nlauth_email=at#at.com, nlauth_signature=mypassworld,nlauth_role=3
And i follow the process of this tutorial: https://community.boomi.com/docs/DOC-2676#jive_content_id_To_call_the_getRecord_RESTlet
But I receive the following response:
{
"error": {
"code": "INVALID_LOGIN_ATTEMPT",
"message": "Invalid login attempt."
}
}
Use Postman's built-in Authorization tools to build the correct OAuth1 header: https://www.getpostman.com/docs/v6/postman/sending_api_requests/authorization
It's best practice to use OAuth so credentials are not exposed. NS uses OAuth 1.0.
Realm = NS Account number
Signature Method can be SHA1 or SHA256
Make sure the "Add params to header" is checked.
Always "Update Request" before sending in order to generate proper Nonce/Timestamp
Add the Content-Type = application/json to the headers
Body must be a valid JSON object.
I've used the following doc and it help me: If the URL above don't work click in this link.
URL https://system.xx.netsuite.com/app/help/helpcenter.nl?fid=section_1530099787.html

Error when getting angular-translate JSON files in angular app

I have an angular app with some i18n JSON files. The files work fine- the language of the site is changed perfectly depending on which one is selected. However, I get a funny console error which I can't figure out-
Uncaught SyntaxError: Unexpected token : at en.json: 2
Resource interpreted as Script but transferred with MIME type application/octet-stream
The same error appears in the console for each file.
Is there something wrong with the way my file is structured?
example of data in en.json:
{
"WELCOME" : "Welcome",
"HOME" : "Home",
"GO" : "Go",
"LOGOUT" : "Log Out"
}
There's nothing wrong with your JSON file but, according to the console log, it seems your web server does not set correct response header Content-Type which should be application/json.
So your browser tries to interpret your file as a JavaScript file and find an invalid token.
For instance with Nginx, you could use mime type configuration file provided by HTML5-Boilerplate project (https://github.com/h5bp/server-configs-nginx/blob/master/mime.types) and include it into your Nginx configuration:
include /etc/nginx/mime.types;
It contains the following directive setting application/json as content type for JSON:
types {
application/json json;
}

API 2.0 how to upload file with POSTMAN?

I'm reading API 2.0 documentation and try using POSTMAN (recommended in the documentation).
In "Upload a file" section, I got "404 not found" error.
for example:
{"type":"error","status":404,"code":"not_found","help_url":"","message":"Unknown Error","request_id":"11139828924fa91c0d283d2"}
POSTMAN window image is here.
Base URL is tring "upload.box.com/api/2.0" (temporary, according to the document).
What's wrong?
One more point, your POSTMAN request misses to indicate folder_id in its form data . You need that "folder_id" value for the request to work .
The domain specific Upload issues have all been resolved. You can now direct all API requests, including uploads, to https://api.box.com/2.0