TFS API Json Documentation - json

I use the the TFS Builds in my application and was wondering if there is a documentary for the json response which i get from the TFS API. Especially for the field "AuthoredBy".
Here an example of the response json.

Yes there is documentation (https://www.visualstudio.com/en-us/docs/integrate/extensions/reference/client/api/tfs/build/contracts/builddefinitionreference) but it is not kept up to date, is incomplete and wrong on many instances unfortunately :(
Edit: i noticed the link i posted at that time now forwards to a different api... here is the updated link -> https://learn.microsoft.com/en-us/rest/api/azure/devops/build/builds?view=azure-devops-rest-5.0

Related

Why am I getting XML results from the Exact Online API where I used to get JSON results?

Just started working on an existing project making use of the Exact Online API.
While I was debugging the project I suddenly only started receiving XML results instead of JSON results from the API. I did not change anything about the endpoints being queried I was just running the existing queries trying to figure some things out.
These are the REST API docs: https://start.exactonline.nl/docs/HlpRestAPIResources.aspx
These are the XML docs: https://support.exactonline.com/community/s/knowledge-base#All-All-DNO-Content-xmlsamplecode
Typical REST API endpoints look like this:
https://start.exactonline.be/api/v1/xxxxxx/salesinvoice/SalesInvoices
Typical XML endpoints look like this:
https://start.exactonline.be/docs/XMLDownload.aspx
I also did not change any settings. I only have access to the tokens and api. I don't have access to the account.
This is an example of an endpoint and query where I previously received JSON but am now receiving XML:
https://start.exactonline.be/api/v1/xxxxxx/salesinvoice/SalesInvoices?$filter=InvoiceID eq guid'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx'&$select=InvoiceID
I tried this manually with Postman and also using the existing code from the project.
Is there some setting I am unaware of? Am i querying the wrong way? Maybe there have been some changes to the API I am unaware of that aren't listed in the release notes?
Please provide the request header Accept in your HTTP request that specifies what content format you prefer to receive: application/json. The default of Exact Online APIs is XML (but seldom to never used).

SoundCloud /resolve API endpoint returns JSON instead of JSONP

Related to this question, Soundcloud recently started returning JSON at /resolve instead of JSONP as documented.
Here is a JSBin that demonstrates this issue. IT attempts to resolve a track URL, but the Soundcloud API returns JSON rather than JSONP.
https://jsbin.com/fixabomefe/edit?html,console
(The client ID used there is used in the test environment for an OSS Soundcloud library so it's safe to leak here).
Does anyone (preferably at Soundcloud) know what's going on with the resolve endpoint and jsonp?
Happy to switch to json, but some communication / context about why this change happened would be helpful.
This was due to a bug that made it into production in the last few days. We've just deployed a fix, and it looks like the JSBin is working again. Apologies for the inconvenience!

Apache Nifi, how to get JSON from API

I've started using Apache Nifi and I'm still learning it and experimenting with it. I really want to use Nifi to get JSON documents from API's and put them in my Elasticsearch database. So far using the built-in getTwitter and putElasticsearch controllers this works.
However now I want to do this with other APIs than Twitter, and I'm kinda stuck here. First off I really don't even know which controller to use? I would think getHttp or invokeHttp even with 'GET' as http verb then but it doesn't seem to work. If I use the getHttp I have to give an SSL service with keystore and truststore .. like why would I have to do that?
Apache Nifi is still quite new so hard to find decent guides / information about these kinds of things. I have read and searched the documentation but haven't gotten the wiser.
An example JSON to pick up from an API is:
https://api.ssllabs.com/api/v2/getEndpointData?host=www.bnpparibasfortis.be&s=193.58.4.82
Thanks in advance for anyone that can offer some help / insight.
What processor you use to get the JSON data is entirely dependent on the API you want to hit. The GetHttp or InvokeHttp processors should work to grab the data from a URL. If you'll notice, the SSL service is an optional property for both GetHttp and InvokeHttp so you only need to you use it when you want to communicate via HTTPS. Also, from the UI you can right click on a processor and then click "usage" to bring up the documentation for that processor.
At this link[1] you can find a NiFi template that uses GetHttp to get JSON data from randomuser.me and does various processing on it. It's primarily a template to show-case the different Avro processors but the method of grabbing the JSON should be relevant.
[1] https://github.com/hortonworks-gallery/nifi-templates/blob/master/templates/Convert_To_Avro_From_CSV_and_JSON.xml

Comprehensive CEP (Proton) REST API documentation

I've searched the repo + FiWare Wikis and was unable to find any detailed API documentation.
I saw this: http://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/Complex_Event_Processing_Open_RESTful_API_Specification
I'm running a CEP instance on Fiware Cloud, and keep getting 500's and 405's for the calls I'm trying.
Yet it often references the user guide for more details on each endpoint parameter. Is there a more recent version?
Last release was more than a year ago, according to that spec. Are the docs up to date with the latest API version?
Else I'll have to reverse-engineer the API...
PS: CEP instance is running # http://130.206.117.120:8080/
Let me know if there are some sanity checks I can make ;)
I'm also using CEP and for REST API I haven't found newer specs (from the doc you linked). However, I didn't have any problems getting the resources.
You can try
GET: http://130.206.117.120:8080/ProtonOnWebServerAdmin/resources/instances/ProtonOnWebServer
It shows state and definitions-url of the engine.
I found it helpful to browse through examples from engine also, or from tuts.
I saw that your instance uses DoSAttack definition and I have tried POSTing to engine: POST: http://130.206.117.120:8080/ProtonOnWebServer/rest/events, header: Content-Type: application/json, payload: {"Name":"TrafficReport","volume":"22"} and got 200 OK.
For more complex tasks (apart from REST API) this PAGE lists latest specs.
Hope it helps!

WSo2 API Manager 1.8.0 - JSON parsing issue

I am new to wso2 API Manager, trying to set it up expose my plain HTTP POST back end calls as a REST API. I am sure this is not a new pattern that I am trying to achieve here. The requirement is to convert the JSON data coming in (has array structures) into the HTTP URL query string parameters.
After some research through the documentation and other posts on this forum, decided to go with the script mediator that would parse the JSON data and convert it to a string that can be appended to the endpoint URL. Some how I am not able to achieve this.
I have followed the following post that seems to be very straight forward. As the original poster suggested, I am also not able to use getPayloadJSON() method. Even have trouble using the work around suggested there due to JSON.parse() not working.
Link
Also, this approach of editing the service bus configuration from source view does not sound like the correct option. Is there another elegant solution to achieve this? Thanks for the help in advance.
I was able to get both methods working by using an external script instead of the inline java script. Thanks