I am using curl command :
curl -X POST --user "apikey:xxx" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data-binary #profile.json \
"https://gateway-fra.watsonplatform.net/personality-insights/api"
and IBM is giving me response:
x{"code":404,"sub_code":"S00004","error":"Not Found"}%
anyone has idea why?
this is my .json file
https://watson-developer-cloud.github.io/doc-tutorial-downloads/personality-insights/profile.json
Try using the following curl command:
curl -X POST --user "apikey:xxxxxxxx" --header "Content-Type: application/json" --header "Accept: application/json" --data-binary #profile.json "https://gateway-fra.watsonplatform.net/personality-insights/api/v3/profile?version=2017-10-13&consumption_preferences=true&raw_scores=true"
Replace xxxxxxxx with your apikey. Please avoid using real apikey in public in the future. Anyone can use your key. I have edited the question to hide it.
Please follow the API reference for Personality Insights for more info.
Related
All, I am using REST API to add bitbucket branch URL into SAST scanner. When sending the REST API from postman, getting error message: "Failure occurred during GIT Browsing". The curl is:
curl --location --request POST 'http://<host name/IP>/cxrestapi/projects/{projectId}/sourceCode/remoteSettings/git' --header 'Authorization: Bearer --header 'Content-Type: application/x-www-form-urlencoded' --data-urlencode 'url=https://bitbucket.org//.git'
--data-urlencode 'branch=refs/heads/master' --data-urlencode 'username=' --data-urlencode 'password='
If I do the same for public Github (https://github.com//.git), curl works fine. Any suggestion is appreciated.
I'm looking at the JIRA api docs. Does anyone know where I can find these credentials?
-u charlie:charlie \
For the request
curl \
-D- \
-u charlie:charlie \
-X POST \
--data {see below} \
-H "Content-Type: application/json" \
http://localhost:8080/rest/api/2/issue/
I found it. Account Settings-> Security -> Create and Manage api tokens.
We try to exchange 'Sign in with apple' between 2 teams, we proceed as follows:
The old team generates a transfer_sub for the new team, the request (https://developer.apple.com/documentation/sign_in_with_apple/transferring_your_apps_and_users_to_another_team) here looks like this:
curl -sS --location --request POST "https://appleid.apple.com/auth/usermigrationinfo" \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' \
-d "sub=$oldUserSub&target=$newTeamId&client_id=$oldAppBundleID&client_secret=$oldSecret"
This works perfectly, the old team receives a transfer_sub and gives it to the new team.
{"transfer_sub":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"}
The new team gets the new ID with the following request (https://developer.apple.com/documentation/sign_in_with_apple/bringing_new_apps_and_users_into_your_team):
curl -sS --location --request POST "https://appleid.apple.com/auth/usermigrationinfo" \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' \
-d "transfer_sub=$transferSubFromOldTeam&client_id=$newAppBundleID&client_secret=$newSecret"
Unfortunately this does not work because there is an error return:
{"error":"invalid_request"}
Does anyone have an idea what to do to make the relegation valid?
Have you already transferred your app?
The same issue has already been resolved in the Developer Forums.
Referring to here may resolve this issue.
The answer says:
You cannot use the api "/auth/usermigrationinfo" of the URL before app transfer.
So, If you haven't transferred your app yet, you have to complete your app transfer first. Then the new team will be able to get the new ID with the following request:
curl -sS --location --request POST "https://appleid.apple.com/auth/usermigrationinfo" \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' \
-d "transfer_sub=$transferSubFromOldTeam&client_id=$newAppBundleID&client_secret=$newSecret"
Trying to use the reminders.app to post reminders via curl.
Getting the following error
{"ok":false,"error":"internal_error","warning":"missing_charset","response_metadata":{"warnings":["missing_charset"]}}
curl -X POST -H 'Authorization: Bearer secretsxxxxxxxxxxxxx' -H 'Content-type: application/json' --data \
'{
"ok": true,
"reminder": {
"text": "eat a banana",
"recurring": false,
"time": 1602288000
}
}' https://slack.com/api/reminders.add
You need to change the following line https://slack.com/api/reminders.add to https://slack.com/api/reminders.add?. Include the question mark at the end.
So your code should be:
curl -X POST -H 'Authorization: Bearer secretsxxxxxxxxxxxxx' \
-H "Content-type: application/json" \
--data '{"text": "I hope you eat your banana","time":1581447960}' \
https://slack.com/api/reminders.add
Is it possible to use content from a URL to do Curl -data-binary POST?
POST content from a file:
curl -X POST -H "Content-Type: plain/text" --data-binary "#file.txt" http://somewhere.com
Is there a curl command can do like
curl -X POST -H "Content-Type: plain/text" --data-binary "http://somefile.com/file" "http://somewhere.com"
suppose http://somefile.com/file is a binary text file
you can do the following:
curl -s http://somefile.com/file | curl --data-binary #- http://somewhere.com