Not Able to see messages for particular intents [Chatbase] - chatbot

We just started integrating Chatbase for one of our Bot's and I'm sending messages to Chatbase, but I'm not able to view messages for specific intents on the dashboard. The specific case pertains to messages which are related to dates.
Here is a curl request.
curl -X POST \
https://chatbase-area120.appspot.com/api/message \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-H 'postman-token: f82cc2de-4514-8055-c28e-8746fce002c9' \
-d '{
"api_key": "xxxxxxxx",
"type": "user",
"platform": "mobile",
"message":"19-06-2017",
"intent": "EndDate",
"version": "1.0",
"user_id": "user-26",
"time_stamp": "1515492147",
"not_handled": false
}'
This is the view in the dashboard.
Also, I find it strange that the messages for another intent show up correctly on the dashboard.
Is there a format in which date has to sent to Chatbase for it to be shown on the dashboard? By the way, this happens with other intents also which are related to mobile numbers, email, and address.

I am Sean from Chatbase customer support. Thank you for your detailed question and interest in Chatbase.
We filter message content that may be used to identify a particular person, such as an account number, phone number, email address, or SSN. It looks like your date formats are being confused with SPI (sensitive personal information). I have raised the issue with our backend development team and will respond as soon as we have a solution for you.
Thank you.

Related

Facebook Graph API Messenger integration - The parameter recipient is required

I'm trying to create a bot which interacts with Facebook Messenger. I've set up my webhook and can receive messages coming from Facebook. However, when I try to send a message, I get the following error back from Facebook:
{"error":{"message":"(#100) The parameter recipient is required","type":"OAuthException","code":100,"fbtrace_id":"F3iVNecj10i"}}
However, I've definitely got the recipient ID in my request. I've sent the request with my bot, cURL and the Chrome Poster extension and get the same result each time. The JSON I send is:
{"recipient":{"id":"XXXXXXXXXXXXXX"},"message":{"text":"hello, world!"}}
When using cURL, I took the example directly from the Facebook documentation and send this:
curl -k -X POST -H "Content-Type: application/json" -d '{"recipient":{"id":"XXXXXXXXXXXXXXXX"},"message":{"text":"hello, world!"}}' "https://graph.facebook.com/v2.6/me/messages?access_token=ACCESS_TOKEN"
The only difference between this and the example on Facebook is the -k which stops cURL from checking the SSL certificate. I'm tunneling through to my app using ngrok for the incoming messages but sending my requests direct to the Facebook Graph API. The fact that it's happening in my app, cURL and Chrome Poster makes me think that it's something to do with the request (but I can't see what) or my Facebook app setup. Any help is greatly appreciated.
Turns out there were a few issues. The cURL request didn't include the quotes in the JSON so the quotes had to be escaped with \ characters. The Chrome Poster request didn't work because "content-type: application/json" wasn't set in the header. And my webapp didn't work because the JSON had a ";" at the end of it.
So, the Facebook message was an indication of poorly formatted JSON, just not a very direct one!
Check that the JSON payload is well formed.
I used the Postman.app to help me out with this — it's also available on Windows.
Steps
Copy the URL into the "Enter request URL field". This would include the access_token
Change the HTTP verb to GET
Under the "Headers" header, set Content-Type to application/json
Under the "Body" header, select "raw" and paste your JSON payload there. Make sure that this JSON payload is well formed by watching the error indicator displayed beside the line numbers.
Once I got this fixed, I was able to move on to the next step.
I got similar error some time back. Try using Postman. I tried the same request and replaced the user id and the page access token. It works fine.
Click on the Import button on the top and paste your curl request under raw. Then try running the call. If you get the same error, go to the body and modify it. Make sure you put this in the body part of the Postman request. Replace the recipient id with yours.
{
"recipient":
{
"id":"123456789"
},
"message":
{
"text":"hello, world!"
}
}
This is the full cURL call : Change Recipient ID and Page Access Token
curl -X POST -H "Content-Type: application/json" -d '{ "recipient":{"id":"1234567" }, "message":{ "text":"hello from bot" }}' "https://graph.facebook.com/v2.6/me/messages?access_token=PASTETHETOKENHERE"

Get multiple songs by foreing_ids

I'm building an spotify-echonest app using the web apis from both. I'm using spotify api to get as many songs as I can from user input, what I need now is to get information about these songs from echonest but as far as I can see you can only set one filter as foreing_id in the rest service.
http://developer.echonest.com/api/v4/artist/similar?api_key=YOUR_API_KEY&id=spotify:artist:4Z8W4fKeB5YxbusRsdQVPb&bucket=id:spotify
I'm using the Java API from Echonest, anyway any help is usefull.
You should query audio features from Spotify's Web API instead as Spotify doesn't support echonest anymore. I think you've already known how to get track IDs from the API, all you need to do is use the track IDs to query audio features.
Example:
Step 1: Get track id
curl -X GET "https://api.spotify.com/v1/search?q=track%3Anumb+artist%3Alinkin+park&type=track" -H "Accept: application/json"
Step 2: Get access token
curl H "Authorization: Basic YOUR_CLIENT_CREDENTIALS" -d grant_type=client_credentials https://accounts.spotify.com/api/token
Step 3: Get audio features
curl -X GET "https://api.spotify.com/v1/audio-features/YOUR_TRACK_ID" -H "Authorization: Bearer {YOUR_ACcess-TOKEN}"

How do I add a relation to my parse.com object using the REST API?

I have two classes, the standard User and my custom class Story.
Every User can have one or more Story. I can save a new User, I can save a new Story (from my .net application using parse.com REST API), but how do I create a relation between them?
I see this example in the documentation:
curl -X PUT \
-H "X-Parse-Application-Id: MY APP KEY" \
-H "X-Parse-REST-API-Key: MY REST KEY" \
-H "Content-Type: application/json" \
-d '{"User":{"__op":"AddRelation","objects":[{"__type":"Pointer","className":"_User","objectId":"Vx4nudeWn"}]}}'
https://api.parse.com/1/classes/Story/Ed1nuqPvcm
How do I "put" this in using POSTMAN (chrome addon) for instance? What is "-d" in this case, it doesnt seem to be a normal url parameter?
Thanks!
I'm not sure but it seems you have a double question there. The first one, on how to create a parse relation via rest api, you answered with the curl example.
About using postman, you can specify the json content under the raw tab (check the image bellow). Also make sure the content type is set to JSON (application/json), in the blueish dropdown next to the tabs.
I've tested and worked fine. Hope it helps.
Cheers.

Partial refund with PayPal Refund API for adaptive payments returns Internal Error (520002)

I am trying to write code to do partial refunds for adaptive payments.
I've read though https://developer.paypal.com/docs/classic/api/adaptive-payments/Refund_API_Operation/
and this is what my request looks like
curl -s --insecure
-H "X-PAYPAL-SECURITY-USERID: api_username"
-H "X-PAYPAL-SECURITY-PASSWORD: api_password"
-H "X-PAYPAL-SECURITY-SIGNATURE: api_signature"
-H "X-PAYPAL-REQUEST-DATA-FORMAT: NV"
-H "X-PAYPAL-RESPONSE-DATA-FORMAT: NV"
-H "X-PAYPAL-APPLICATION-ID: your_app_id "
https://svcs.sandbox.paypal.com/AdaptivePayments/Refund -d
"requestEnvelope.errorLanguage=en_US
&requestEnvelope.detailLevel=ReturnAll
&transactionId=xxxxxxxxxx
&currencyCode=USD
&receiverList.receiver(0).amount=10.00"
The original transaction has amount > 10.00 and I am trying to partially refund this payment
The response is just basically 'Internal Error' with error code 520002
Any ideas?
figured this out. basically I also have to specify
receiverList.receiver(0).email in my request
The crazy thing is, in PayPal's documentation, it clearly says
receiverList.receiver(n).email is The identified receiver's email address
receiverList.receiver(n).amount is Amount to refund to the identified receiver
since I am partially refunding to user, the email should be user's email, right?
Wrong, the email must be my PayPal's account email instead
Don't ask me why and if you can make sense from this madness, please let me know.
PS. thanks PayPal, for returning a very useful error called internal error

Can I change a date on shopify blog using api?

I must be brief, not much time left...
I'm trying to backdate some blog posts that were written in the run-up to our store launch.
I'm using curl from the command line and I can POST new blog articles, and I can PUT changes to existing blog articles, but I can't adjust the date of the existing articles yet.
Can you help me?
Thanks!
Here's my curl request...
curl -i -H "Content-Type: application/json" -H "Accept: application/json" -X PUT -d '{ "article": {"id": xxxxxx, "created_at": "2012-08-25"}}' https://key:passwordlongstringhere#storename.myshopify.com/admin/blogs/#blogID/articles/#articleID.json
And yes, all the appropriate xxxx and #blogID have the right info in my request.
Created at dates can not be set through the API or admin.
The created_at field is read-only, as mentioned by John. However, you can change the published_at date to backdate the post as you desire.
The connection will fail with "curl: (35) Unknown SSL protocol error in connection to shopname.myshopify.com:443" unless you add --sslv3 to the curl parameters. I have successfully used your example with this parameter to change the published date on a blog post via the api.