- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2022
04:12 AM
07-05-2022
04:12 AM
How can i call external REST API from Magento 2.2.5
How can i call external REST API from Magento 2.2.5
Please tell me. https://hardwoodfloorrefinishingin.com/canada/calgary/
Thanks
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2022
11:29 PM
07-05-2022
11:29 PM
Re: How can i call external REST API from Magento 2.2.5
You can call any external API using a curl request.
Problem solved? Click Kudos and "Accept as Solution".
200+ Magento 2 Extensions for Enhanced Shopping Experience.
200+ Magento 2 Extensions for Enhanced Shopping Experience.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Saturday
Saturday
Re: How can i call external REST API from Magento 2.2.5
$ch = curl_init('YOUR_EXTERNAL_API_URL'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer YOUR_API_KEY']); $response = curl_exec($ch); curl_close($ch); $data = json_decode($response, true);
Replace YOUR_EXTERNAL_API_URL with the API URL and YOUR_API_KEY with the actual API key.
- « Previous
- Next »