Hey Guys I'm new to Angular, can somebody help me how to fetch the data and display it in a component with the following details, just a format will help me.
curl -X GET -H "Content-Type: application/json" -H "Authorization:
Token a41d2b39e3b47412504509bb5a1b66498fb1f43a" -H "Cache-Control:
no-cache" "https://api.mywebsite.co.in/v1/mf/?key=118656INF204K01E05"
Thanks in Advance.
if you want get the full response from the api you need to use HttpClient module.
getting full response from api Working example Check this:https://stackblitz.com/edit/angular-64qrhq?file=app%2Fdata.service.ts
Related
I want to list (count actually) the comments made on a GitHub pull request.
As per the documentation, I am using the following curl command to hit the GitHub API
curl -H "Accept: application/vnd.github+json" -H "Authorization: token abcdefg123457" https://api.github.com/repos/MyOrg/MyRepo/pulls/2/comments
The result is the following:
[
]
despite me seeing comments on #PR2.
What am I missing?
A backend API generates JIRA-ISSUE ID.
How do I close the jira ticket through REST API calls?
Can somebody help me as to how to proceed with this?
What are the requirements and steps to follow?
first list the next transition id
https://yourServer/rest/api/3/issue/FOO-123/transitions?expand=transitions.fields
and then use your transition id (212) to update
curl -u $JIRA_TOKEN -X POST --data '{ "transition": {"id": "212"} }' -H "Content-Type: application/json" https://yourServer/rest/api/3/issue/FOO-123/transitions?expand=transitions.fields
I'm developing an app, for store fronts and want to get some analytics in checkout. So I want to inject a script in that scope of checkout. When I try to insert it I'm getting "You don't have a required scope to access the endpoint" but I have updated the scopes to checkoutcontent to modify. Not sure what else is wrong
Trying to insert script via an app, getting 403 even though I updated the OAuth scopes to include, Check out content and Checkout
curl --request POST \
--url https://api.bigcommerce.com/stores/{store_hash}/v3/content/scripts \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'x-auth-client: XXXXX' \
--header 'x-auth-token: XXXXX' \
--data '{"name":"Test Scripts Tag","description":"Test Scripts Tag","html":"<script src=\\\"https://Somedestination/Test.js\\\"></script>","src":"https://Somedestination/Test.js","auto_uninstall":true,"load_method":"default","location":"footer","visibility":"checkout","kind":"src"}'
Getting below error, while expecting a status=200
status: 403,You don't have a required scope to access the endpoint
The html field shouldn't be included when using src, could you try removing it?
The only errors I was receiving in testing were due to malformed HTML in the html field with the error code 422. It may also be worth trying to create a new API account to rule out scoping causing this.
using this URL as a reference and attempting token exchange with client ID and secret:
https://developers.onelogin.com/api-docs/1/oauth20-tokens/generate-tokens
I get a 404 error for the URL provided. I'm using:
https://api.us.onelogin.com/auth/oauth2/token
Am I missing something from the docs? Thanks!
The API is working for me. Just curious - are you using the POST method?
Have you tried the CURL example at the bottom of the doc page?
Just to be clear, you need to sub in your shard, which is prob us.
Like
curl -X POST -H "Authorization: client_id:{enteryours}, client_secret:{enteryours}" -H "Content-Type: application/json" -d '{ "grant_type":"client_credentials" }' 'https://api.us.onelogin.com/auth/oauth2/token'
I'm working on an app using Pushbullet's API, but I'm running into odd errors when running through the sample code at https://docs.pushbullet.com/v2/pushes/.
I'm executing the following cURL command (in Windows):
curl -k -u <MY_API_KEY>: -X POST https://api.pushbullet.com/v2/pushes --header 'Content-Type: application/json' --data-binary '{"type": "note", "title": "Note Title", "body": "Note Body"}'
...but it keeps generating the following error:
{"error": {"type":"invalid_request","message":"The param 'type' has an invalid value.","param":"type","cat":"\u003e:3"}}
It also produces this error:
The other commands for the other endpoints in the documentation work fine...it's just this one.
Got any suggestions? Thanks for the help! :)
It looks like windows doesn't support those kinds of quotes on the command line. Here's an example that works:
curl https://api.pushbullet.com/v2/pushes -X POST -u <access token>: --header "Content-Type: application/json" --data-binary "{\"type\": \"note\", \"title\":\"Note Title\", \"body\": \"Note Body\"}"
I think I'm going to try to replace the curl examples with something that has less confusing behavior.
I figured it out - I don't really know why, but the cURL command wasn't working through the DOS prompt, and also wasn't working using the Postman REST client for Chrome, but I got it working in the DHC extension for Chrome. The trick was setting the Authorization header to "Basic", which resolves the Pushbullet access token to some other form, and makes a successful the HTTP request.
Hope this helps someone down the road if they run into this on Windows!