How to create a Connector using REST URL having headers? - mcs

I have a REST URL that has header parameters.How can I create a REST connector using that REST URL in oracle MCS.
The REST URL is POST method.

Presumably this is the same question asked and answered on the OTN Forums: https://community.oracle.com/thread/4023706

I have seen your question on OTN forum .
Please add the endpoint specified on the "Rules" section of Connector creation while testing .(as per your screen shot uploaded on OTN forum)

Related

Authorisation Key in Karate API [duplicate]

I would like to update my common headers (Accept and Content-Type) just in one feature file. however, I would like to use Authorization token which already configured in Karate.config.cs file.
Could you please help me with this?
This is explained in detail in the docs: https://github.com/intuit/karate#configure-headers
* configure headers = read('classpath:my-headers.js')
And you can refer to variables declared in karate-config.js anywhere in Karate. Again read the docs, and there are multiple examples. Next time please ask a more specific question: https://stackoverflow.com/help/minimal-reproducible-example

What does "consume an API" mean?

Here is an excerpt from an assignment I am currently doing:
Build a dummy app that:
Contains a REST API that operates over a single resource.
Contains a Backbone client that consumes that API and can list, show, create, update, and remove that resource.
My understanding was that the term "consume" implies total coverage of the API's exposed ressources. However, the assignment says "consumes that API and can [CRUD] that resource".
Is that sentence redundant or is my understanding of the term wrong?
(Bonus question: why searching Google for this question returns countless language-specific tutorials for "consuming an API" but none explain what the term actually means?).
To consume an API means to basically use any part of it from your application.
Consuming an API here means creating a client which can send requests to the API that you build.
It appears that you need to create and API which can handle Create, retrieve, update and delete (CRUD) of a resource. For instance if your REST api is to create a blog, your API should handle CRUD functions for the object/resource blogpost.
POST - Create a blog post
GET - Retrieve a blog post
PUT - Update a blog post
DELETE - Delete a blog post.
It is about the direction of the app's interaction with API - it either provides an API, or consumes it, so there are providers and consumers of API, and this is just a less general and ambiguous term than 'using'.
Simply consuming an API means using it in your application.
For, e.g., GET request to https://someapi/Users will give you all the users.
You need to request this URL https://someapi/Users to get all the users and then you can use it into your application.
I always think about Albert Einstein's quote of "If you can’t explain it to a six year old, you don’t understand it yourself." when someone asks a question that you might take for granted due to technical experience you have on a subject.
I think the following medium.com article does an excellent job explaining it: How do you explain API to a 5-year-old?
simply means : using the API.
You can do it with HTTP method (GET, POST, PUT, DELETE..) using something like Postman (Tool) or maybe you have a client app/library that calls these methods implicitly.

How can I change the base url shown in the store?

I'm using WSO2 API Manager.
In an API, in User Overview tab below url is shown as Production and Sandbox URLs which are correct
http://myapistore.com:8280/railway/2.0
But in the same api under API console tab below url is shown as base url which is incorrect
http://myapistore.com/store:8280
But actually the base url should be http://myapistore.com:8280
So altogether API url would be
http://myapistore.com:8280/railway/2.0/station/getAll
How can I change the base url?
In my WSO2 API Store my services are shown correctly. When I click on the tab sheet, the URLS are shown correctly even when I hover over these links.
Did you register the service correctly?
You probably already figured out the answer to your question, but I came here looking for how to change the production URL of an API, and thought I would share the answer to that question here, for any future googlers :)
This is the view we're talking about, the API overview. Notice that the Production Endpoint is wrong (should be worldbank, not worldbanks).
Click on Edit API in the top blue bar, and in the second step you'll be able to change it.
(notice the corrected URL)
I hope this will help someone in the future :)

Twitter API oAUTH

I have implemented twitter API (oAUTH) by going through this tutorial http://net.tutsplus.com/tutorials/php/how-to-authenticate-users-with-twitter-oauth/ . Its working and I can update my status (which I am guessing its kinda sharing) . The problem I am facing now is how can I add pictures , few words and a link to this $twitteroauth->post('statuses/update', array('status' => 'Hello Nettuts+'));. Something like twitter cards.
Is there another good tutorial which explains and demonstarte all the functions of Twitter API (oAUTH).
Thanks. :)
You can include a link/URL in your status update in the same way that you have included the other words (Hello Nettuts+).
However, you cannot add pictures in this manner - you will need to use the statuses/update_with_media endpoint as opposed to the statuses/update endpoint that you are using in your existing code. You can learn more about how to do this by reading Twitter's API documentation:
https://dev.twitter.com/docs/api/1.1/post/statuses/update_with_media
And you can see some example code here:
https://dev.twitter.com/discussions/1059

Disqus api: count the number of comments on each page of my blog

I would like to create a list with the number of comments on each page of my blog.
Is possible with the Disqus API?
There is a call that counts comments starting from the URL of the page?
Thanks.
The Disqus API has an endpoint called threads/list which returns the details for a thread, including the number of comments. You can learn about this method here: http://disqus.com/api/docs/threads/list/
You can see a code example illustrating how to use the endpoint here: https://github.com/disqus/DISQUS-API-Recipes/blob/master/php/get-thread-details.php