Ionic 2.0 push security profile not found error - ionic-framework

I'm making android push service.
I enrolled security profile and add fcm server key and my keystore file
ionic security profiles list
name | tag | android | ios
skout90| skout90 | V |
And i requested below
curl -X POST -H "Authorization: Bearer my_api_key" -H "Content-Type:
application/json" -d '{
"tokens": ["my_device_key"],
"profile": "skout90",
"notification": {
"message": "Alert!"
}
}' "https://api.ionic.io/push/notifications"`
but
I got response
{
"meta": {
"request_id": "1b855552-195e-4dd3-cd36-ae49b19490a4",
"status": 400,
"version": "2.0.0-beta.0"
},
"error": {
"type": "BadRequest",
"link": null,
"message": "Security Profile 'skout90' not found."
}
}
I can't find what is wrong.
What do i have to?
please help me...

I solved this problem myself.
-H "Authorization: Bearer my_api_key"
I input wrong my_api_key.

Related

Invalid story format failed to parse story while posting Rasa X Http API

I am trying to create a story using POST in Postman tool and below is my story format .
I am using below format because in GET request I got the story in the same format.
{
"id": 65,
"name": "interactive_story_65",
"story": "35 interactive_story_65\n* emp_info\n - utter_employee",
"annotation": {
"user": "me",
"time": 1597919151.8836874962
},
"filename": "data\\stories.md"
}
But, I am getting below error:
{
"version": "0.31.0",
"status": "failure",
"message": "Failed to parse story.",
"reason": "StoryParseError",
"details": "Invalid story format. Failed to parse '## {\r\n \"id\": 65,\r\n \"name\": \"interactive_story_65\",\r\n \"story\": \"## interactive_story_65\\n* emp_info\\n - utter_employee\",\r\n \"annotation\": {\r\n \"user\": \"me\",\r\n \"time\": 1597919151.8836874962\r\n },\r\n \"filename\": \"data\\\\stories.md\"\r\n }'",
"help": null,
"code": 400
}
Attached is below screenshot:
enter image description here
Please help.
This endpoint is actually expecting plain markdown, with text/x-markdown as the content-type header. If you look closely at the docs, you'll see that you're using the response schema as the request schema - I did that too at first. The request schema is just a markdown string e.g.
curl --request PUT \
--url http://localhost:5002/api/stories \
--header 'authorization: Bearer <Token>' \
--header 'content-type: text/x-markdown' \
--data '## greet
* greet
- utter_greet\n'

How to access firebase bucket in google cloud API

I am working on google Speech to Text API. Where i am recording audio in iphone and saving it on Firebase bucket. than when i call api i get error 403.
curl -s -X POST -H "Content-Type: application/json" --data-binary #request.json \
"https://speech.googleapis.com/v1/speech:recognize?key=${API_KEY}"
content of request.json
{
"config": {
"encoding":"FLAC",
"languageCode": "en-US"
},
"audio": {
"uri":"gs://audiosave-9ec73.appspot.com/AudioFiles/audio.flac"
}
}
and response i am getting
{ "error": {
"code": 403,
"message": "Anonymous caller does not have storage.objects.get access to audiosave-9ec73.appspot.com/AudioFiles/audio.flac.",
"status": "PERMISSION_DENIED" } }

Google URL Shortner cURL returns error

I have a API Key and tried to use it for shortening URL. If I shorten google.com then I get shorten url
curl https://www.googleapis.com/urlshortener/v1/url?key=MYKEY -H 'Content-Type: application/json' -d '{"longUrl": "www.google.com"}'
{
"kind": "urlshortener#url",
"id": "shorten url",
"longUrl": "http://www.google.com/"
}
But if I use other URLs like yahoo.com then returns the error
curl https://www.googleapis.com/urlshortener/v1/url?key=MYKEY -H 'Content-Type: application/json' -d '{"longUrl": "www.yahoo.com"}'
{
"error": {
"errors": [
{
"domain": "global",
"reason": "forbidden",
"message": "Forbidden"
}
],
"code": 403,
"message": "Forbidden"
}
}
Not sure why?

Do Quick Replies Work in Messenger Bot Welcome Message?

Do quick replies work in Facebook Messenger Bot Welcome Message? This is the message that is displayed after you press the "Get Started" button.
It might not be supported, but if it is, am I doing something wrong?
Here's what I'm trying:
curl -X POST -H "Content-Type: application/json" -d '{
"setting_type":"call_to_actions",
"thread_state":"new_thread",
"call_to_actions":[
{
"message": {
"attachment": {
"type": "template",
"payload": {
"template_type": "generic",
"elements": [{
"title": "Hi dad",
"subtitle": "Hi mom",
"item_url": "www.google.com",
"image_url": "https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png",
}]
}
}
},
"quick_replies":[
{
"content_type":"text",
"title":"option1",
"payload":"option1payload"
},
{
"content_type":"text",
"title":"option2",
"payload":"option2payload"
}
]
}
]
}' "https://graph.facebook.com/v2.6/13333333337/thread_settings?access_token=THISISMYCOOLTOKEN"
The error I'm receiving is:
Invalid Keys \"message, quick_replies\" were found in param \"call_to_actions[0]\"."type":"OAuthException","code":100
Nope. payload is only for string text. see https://developers.facebook.com/docs/messenger-platform/thread-settings/get-started-button
curl -X POST -H "Content-Type: application/json" -d '{
"setting_type":"call_to_actions",
"thread_state":"new_thread",
"call_to_actions":[
{
"payload":"USER_DEFINED_PAYLOAD"
}
]
}' "https://graph.facebook.com/v2.6/me/thread_settings?access_token=PAGE_ACCESS_TOKEN"
call_to_actions is limited to 1 call_to_actions must contain at least
one payload string.
This data will be sent back to you via webhook.

Paypal Internal Server Error when capturing payment with rest api

I have this issue in a C#-based project, but I can reproduce it with curl as well. The code was working a few days ago but now it isn't and I'm pretty sure I haven't changed it.
I have a payment that has been authorized and I have its ID, which is correct (when I close the transaction with their online tool I get AUTHORIZATION_ALREADY_COMPLETED instead of Server 500 error).
Here's what I do with curl to repro it, sensitive info redacted:
// check if the AUTHIDHERE code is correct:
curl -v -X GET https://api.paypal.com/v1/payments/authorization/AUTHIDHERE -H "Content-Type:application/json" -H "Authorization:Bearer BEARER123"
the above call works and returns:
{
"id": "AUTHIDHERE",
"create_time": "2013-07-17T21:17:58Z",
"update_time": "2013-07-17T21:18:00Z",
"state": "authorized",
"amount": {
"total": "1.35",
"currency": "USD",
"details": {
"subtotal": "1.35"
}
},
"parent_payment": "PAY-SOMELONGIDHERE",
"valid_until": "2013-08-15T21:17:58Z",
"links": ...whole bunch here]}
}
then I call the capture
curl -v https://api.paypal.com/v1/payments/authorization/AUTHIDHERE/capture \
-H "Content-Type:application/json" -H "Authorization:Bearer BEARER123" \
-d '{"amount":{"currency":"USD","total":"1.32"},"is_final_capture":true}
and I get this with HTTP 500 status:
{
"name": "INTERNAL_SERVICE_ERROR",
"message": "An internal service error has occurred",
"information_link": "https://developer.paypal.com/webapps/developer/docs/api/#INTERNAL_SERVICE_ERROR",
"debug_id": "7edadeba20509"
}
Some other debug_id values are: 062fc6964d9a8, 6eebc751504eb
quick update: interestingly they all failed in the underlying acquirer call - trying to figure out what went wrong.
Are these all debug_ids associated with the same authorization_id ?