TYPO3 10.4 How to connect an API to typo3 - typo3

I have a postman collection with an API get request which contain some data.
On my TYPO3 extension, I need to get the data from this API on my Service, but I did not find in the doc, how to connect an API with a TYPO3 project.
I would like a basic example of how to plug an API into a TYPO3 or a guide if possible
thanks you

Can't comment but maybe this will help (example talentstorm API json request):
https://github.com/Hauer-Heinrich/hh_talentstorm_job_posts/blob/main/Classes/Http/TalentstormRequest.php
$talentstormRequest->setApiUrl("https://myApi.tld/v2/getData");
$talentstormRequest->setApiKey("myApiKey");
$data = $talentstorm->request();
For example like here:
https://github.com/Hauer-Heinrich/hh_talentstorm_job_posts/blob/main/Classes/EventListener/TalentstormJobpostsListener.php

Related

facebook4j post from is null

I am using the Facebook API from Java with Facebook4j.
I have two servers, on the one that uses Facebook 2.3 API when I get the from of a post,
Post post = connection.getFeed().get(0);
post.getFrom();
I get the user, but in the server that uses Facebook 2.4 API, the from is null.
Any idea? I don't see any documented change in the fb API.
As described in the Facebook Platform Changelog, as of v2.4, you now have to manually specify fields if you want them to be retrieved:
To try to improve performance on mobile networks, Nodes and Edges in
v2.4 requires that you explicitly request the field(s) you need for
your GET requests. For example, GET /v2.4/me/feed no longer includes
likes and comments by default, but GET
/v2.4/me/feed?fields=comments,likes will return the data. For more
details see the docs on how to request specific fields.
According to the docs on Post, the relevant field is named from. To request this field in the me feed using Facebook4J, you can use a Reading object, as follows:
facebook.getFeed(new Reading().fields("from"))

Get all status's from JIRA webservice

Is there a way to get all status types from the JIRA webservice, either through the api or through a JQL request? (The issue status is the field that is mapped to the swimlanes when the board is set up)
Whith JIRA REST API you can :
rest/api/2/status
or for each project :
rest/api/2/project/{projectIdOrKey}/statuses
see the online rest api browser : it's a wonderful tool :
https://jira.atlassian.com/plugins/servlet/restbrowser#/resource/api-2-status
For future reference, to see what's in a project's swimlanes for a JIRA agile board you make a request like this: https://jira.atlassian.com/rest/greenhopper/1.0/xboard/work/allData.json?rapidViewId=560 and it will return the relevant information.
Each board has a rapidViewId so you'll have to query for that yourself using a request like this: /rest/greenhopper/1.0/rapidview.
All this stuff can be found here: https://jira.atlassian.com/plugins/servlet/restbrowser#/resource/greenhopper-1-0-rapidview
This is for future reference so that people don't have to go through the same trouble I did when trying to figure this out. Hope it helps!

Drupal 7 - accessing content through url alias over ReST

I have a Drupal 7 with Pathauto and restws modules. I am able to configure Pathauto module to create a url alias for my content type so now the content that I could access with url http://mycms.org/mydrupal/node/4 is accessible using http://mycms.org/mydrupal/content/1-sampleID.
Also, I am able to access the content over ReST using http://mycms.org/mydrupal/node/4.json.
However i need to access the content over ReST api using the url alias, say, http://mycms.org/mydrupal/content/1-sampleID.json. When I try doing this, I get a 404 error.
I am new to Drupal and PHP. Can someone please help me fix this issue? Do I need some custom Drupal module that could help me expose my contents over ReST api through the defined url aliases.
I use the RESTful module, and here's a blog post on how to do what you need.

Typo3 extbase User Auth Service

I try to write a service module, that fetches userdata from a webservice. I found this tutorial, but it shows the 'old' way of building extensions. Is it possible to write a extbase-extension like this? How it should look like?
Extbase ("the new way") is about MVC, not about auth services, thus this tutorial is still valid.
Claus Due (an Extbase specialist) wrote an auth extension, maybe you want to study his code: https://github.com/NamelessCoder/google_auth

get customfield value for jira issue using JIRA SOAP API

I want to get the values of all custom fields for a particular JIRA issue using SOAP API. I have a custom field named 'Phase' having value Decision Pending for a JIRA issue JIRA-123.
I am using JIRA 5.1.3.
I am able to get all the properties of JIRA issue using SOAP API except the value of the custom field for above issue.
I tried following code, but I am not able to use ComponentManager in my code
IssueManager issueManager = ComponentManager.getInstance().getIssueManager();
CustomFieldManager customFieldManager = ComponentManager.getInstance().getCustomFieldManager();
Issue issue = issueManager.getIssueObject("JIRA-123");
CustomField customField = customFieldManager.getCustomFieldObjectByName("Phase");
Object customFieldValue = issue.getCustomFieldValue(customField);
I would highly appreciate if anyone can provide correct approach.
The SOAP API is deprecated by 5.1.3. I suggest you use the REST API - it is both more easy to use and implement.
What is REST?: read here. The basic idea is to bind HTTP request types to actions, it's quite obvious - check this table for a quick run-in.
Jira has a powerful REST API that you can use. This is the main documentation of the current release.
What do you need to do in some high-level steps?:
Set-Up some type of authentication with your JIRA instance. Be it:
Baisc - example
OAuth - example
Get a list of all fields via the API:
The /rest/api/2/field' [method returns a list of all fields][6] - both System and Custom.
Then when you identify the exact field use/rest/api/2/customFieldOption/{id}` to get the full
representation of the Custom Field Option.
I recommend you use a tools like Chrome REST Console ,or anything similar that you can easily make requests with, to get to know the API. The bonus is that you don't need to setUp authentication if you're logged in through the same browser. Your user will require full admin access though.
This is the root of all JIRA REST API docs. Check it out.
If you're doing this in PHP I would personally recommend using some kind of library. I've used
Guzzle (in a CakePHP environment) for this exact task and it turned out very well.
I'm not sure of how do you use the soap API, here is example of using it via the PHP-SOAP:
#!/usr/bin/php -q
<?php
$soapClient = new SoapClient("https://jira.com/rpc/soap/jirasoapservice-v2?wsdl");
$token = $soapClient->login('user', 'password');
$myIssue = $soapClient->getIssue($token,"TES-13");
print_r($myIssue); // all of the issue details
print_r($myIssue->customFieldValues); // get all custom fields
foreach ($myIssue->customFieldValues as $customFieldValue) {
// search for the right custom field
if ($customFieldValue->customfieldId == 'customfield_10402') {
echo $customFieldValue->values[0];
die();
}
}
?>
In case you want to use any other API, have a look at the JIRA Remote API Reference.
A remark regarding the REST and SOAP APIs -To quote from Jira's site the SOAP API "Supported but no future development". The Rest API is still a bit new and there are things you can't yet do with the REST API (example), and can be done easily using the SOAP API.