How to call Web API call inside custom module Magento 2 The Next CEO of Stack OverflowMagento 2 Custom Web Api callUnit test case for custom module REST APICall custom module API in magento2Is It possible if I will not add product in Magento2 database?How to get pdf file in response for Magento 2 rest api?Magento 2 Add third party library and how to call that File in Controller?How to get CustomerId in API in magento 2? and how magento gets customerId for the same?custom api to create customer in Magento2Magento2 Rest api without any moduleMagento 2 - Rest API add new custom request for home page slider

Is there an equivalent of cd - for cp or mv

How do I fit a non linear curve?

"Eavesdropping" vs "Listen in on"

How to get the last not-null value in an ordered column of a huge table?

Towers in the ocean; How deep can they be built?

Man transported from Alternate World into ours by a Neutrino Detector

A question about free fall, velocity, and the height of an object.

Is it convenient to ask the journal's editor for two additional days to complete a review?

Computationally populating tables with probability data

Why don't programming languages automatically manage the synchronous/asynchronous problem?

Physiological effects of huge anime eyes

Can I calculate next year's exemptions based on this year's refund/amount owed?

Which one is the true statement?

Is fine stranded wire ok for main supply line?

Traveling with my 5 year old daughter (as the father) without the mother from Germany to Mexico

Is it okay to majorly distort historical facts while writing a fiction story?

Is a distribution that is normal, but highly skewed, considered Gaussian?

Yu-Gi-Oh cards in Python 3

Can this note be analyzed as a non-chord tone?

Why is the US ranked as #45 in Press Freedom ratings, despite its extremely permissive free speech laws?

Help understanding this unsettling image of Titan, Epimetheus, and Saturn's rings?

TikZ: How to fill area with a special pattern?

Purpose of level-shifter with same in and out voltages

Players Circumventing the limitations of Wish



How to call Web API call inside custom module Magento 2



The Next CEO of Stack OverflowMagento 2 Custom Web Api callUnit test case for custom module REST APICall custom module API in magento2Is It possible if I will not add product in Magento2 database?How to get pdf file in response for Magento 2 rest api?Magento 2 Add third party library and how to call that File in Controller?How to get CustomerId in API in magento 2? and how magento gets customerId for the same?custom api to create customer in Magento2Magento2 Rest api without any moduleMagento 2 - Rest API add new custom request for home page slider










0















How can we call Web API in a custom module?



I have a third party module, in which they are sending a request with API calls. I have custom functionality where I have to redirect my page to that Web API link, so everything works smoothly



Can anyone here tell, how we can do that in Magento2? Some step by step guide?



Thanks!










share|improve this question
























  • what is your exact requirement ? You need just to redirect on a link ? Means say you have a controller from there you want to redirect on a link or call an API ?

    – Narendra Vyas
    2 days ago












  • Ya, If i use the default module they are using this link ttp://m2.example.com/rest/no/V1/guest-carts/uDa31URAYN4ZGmrgPlxEHTHJdrSLR34Z/test/checkout/authorize.

    – Daniel_12
    2 days ago











  • I have one button where I want to redirect to this url

    – Daniel_12
    2 days ago











  • See my answer. If it help you

    – Narendra Vyas
    2 days ago
















0















How can we call Web API in a custom module?



I have a third party module, in which they are sending a request with API calls. I have custom functionality where I have to redirect my page to that Web API link, so everything works smoothly



Can anyone here tell, how we can do that in Magento2? Some step by step guide?



Thanks!










share|improve this question
























  • what is your exact requirement ? You need just to redirect on a link ? Means say you have a controller from there you want to redirect on a link or call an API ?

    – Narendra Vyas
    2 days ago












  • Ya, If i use the default module they are using this link ttp://m2.example.com/rest/no/V1/guest-carts/uDa31URAYN4ZGmrgPlxEHTHJdrSLR34Z/test/checkout/authorize.

    – Daniel_12
    2 days ago











  • I have one button where I want to redirect to this url

    – Daniel_12
    2 days ago











  • See my answer. If it help you

    – Narendra Vyas
    2 days ago














0












0








0








How can we call Web API in a custom module?



I have a third party module, in which they are sending a request with API calls. I have custom functionality where I have to redirect my page to that Web API link, so everything works smoothly



Can anyone here tell, how we can do that in Magento2? Some step by step guide?



Thanks!










share|improve this question
















How can we call Web API in a custom module?



I have a third party module, in which they are sending a request with API calls. I have custom functionality where I have to redirect my page to that Web API link, so everything works smoothly



Can anyone here tell, how we can do that in Magento2? Some step by step guide?



Thanks!







magento2 rest-api programmatically webapi






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 2 days ago









Amrit Pal Singh

798523




798523










asked 2 days ago









Daniel_12Daniel_12

16810




16810












  • what is your exact requirement ? You need just to redirect on a link ? Means say you have a controller from there you want to redirect on a link or call an API ?

    – Narendra Vyas
    2 days ago












  • Ya, If i use the default module they are using this link ttp://m2.example.com/rest/no/V1/guest-carts/uDa31URAYN4ZGmrgPlxEHTHJdrSLR34Z/test/checkout/authorize.

    – Daniel_12
    2 days ago











  • I have one button where I want to redirect to this url

    – Daniel_12
    2 days ago











  • See my answer. If it help you

    – Narendra Vyas
    2 days ago


















  • what is your exact requirement ? You need just to redirect on a link ? Means say you have a controller from there you want to redirect on a link or call an API ?

    – Narendra Vyas
    2 days ago












  • Ya, If i use the default module they are using this link ttp://m2.example.com/rest/no/V1/guest-carts/uDa31URAYN4ZGmrgPlxEHTHJdrSLR34Z/test/checkout/authorize.

    – Daniel_12
    2 days ago











  • I have one button where I want to redirect to this url

    – Daniel_12
    2 days ago











  • See my answer. If it help you

    – Narendra Vyas
    2 days ago

















what is your exact requirement ? You need just to redirect on a link ? Means say you have a controller from there you want to redirect on a link or call an API ?

– Narendra Vyas
2 days ago






what is your exact requirement ? You need just to redirect on a link ? Means say you have a controller from there you want to redirect on a link or call an API ?

– Narendra Vyas
2 days ago














Ya, If i use the default module they are using this link ttp://m2.example.com/rest/no/V1/guest-carts/uDa31URAYN4ZGmrgPlxEHTHJdrSLR34Z/test/checkout/authorize.

– Daniel_12
2 days ago





Ya, If i use the default module they are using this link ttp://m2.example.com/rest/no/V1/guest-carts/uDa31URAYN4ZGmrgPlxEHTHJdrSLR34Z/test/checkout/authorize.

– Daniel_12
2 days ago













I have one button where I want to redirect to this url

– Daniel_12
2 days ago





I have one button where I want to redirect to this url

– Daniel_12
2 days ago













See my answer. If it help you

– Narendra Vyas
2 days ago






See my answer. If it help you

– Narendra Vyas
2 days ago











1 Answer
1






active

oldest

votes


















-1














you can call to external API from inside Magento 2. Just use MagentoFrameworkHTTPZendClient inside your class.



Read more here.



A sample project here in Github






share|improve this answer























  • MagentoFrameworkHTTPAdapterCurl should be used

    – Philipp Sander
    2 days ago











  • can you give me pseudocode how to use that one

    – Daniel_12
    2 days ago











Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f267943%2fhow-to-call-web-api-call-inside-custom-module-magento-2%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









-1














you can call to external API from inside Magento 2. Just use MagentoFrameworkHTTPZendClient inside your class.



Read more here.



A sample project here in Github






share|improve this answer























  • MagentoFrameworkHTTPAdapterCurl should be used

    – Philipp Sander
    2 days ago











  • can you give me pseudocode how to use that one

    – Daniel_12
    2 days ago















-1














you can call to external API from inside Magento 2. Just use MagentoFrameworkHTTPZendClient inside your class.



Read more here.



A sample project here in Github






share|improve this answer























  • MagentoFrameworkHTTPAdapterCurl should be used

    – Philipp Sander
    2 days ago











  • can you give me pseudocode how to use that one

    – Daniel_12
    2 days ago













-1












-1








-1







you can call to external API from inside Magento 2. Just use MagentoFrameworkHTTPZendClient inside your class.



Read more here.



A sample project here in Github






share|improve this answer













you can call to external API from inside Magento 2. Just use MagentoFrameworkHTTPZendClient inside your class.



Read more here.



A sample project here in Github







share|improve this answer












share|improve this answer



share|improve this answer










answered 2 days ago









Narendra VyasNarendra Vyas

35911




35911












  • MagentoFrameworkHTTPAdapterCurl should be used

    – Philipp Sander
    2 days ago











  • can you give me pseudocode how to use that one

    – Daniel_12
    2 days ago

















  • MagentoFrameworkHTTPAdapterCurl should be used

    – Philipp Sander
    2 days ago











  • can you give me pseudocode how to use that one

    – Daniel_12
    2 days ago
















MagentoFrameworkHTTPAdapterCurl should be used

– Philipp Sander
2 days ago





MagentoFrameworkHTTPAdapterCurl should be used

– Philipp Sander
2 days ago













can you give me pseudocode how to use that one

– Daniel_12
2 days ago





can you give me pseudocode how to use that one

– Daniel_12
2 days ago

















draft saved

draft discarded
















































Thanks for contributing an answer to Magento Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f267943%2fhow-to-call-web-api-call-inside-custom-module-magento-2%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Sum ergo cogito? 1 nng

419 nièngy_Soadمي 19bal1.5o_g

Queiggey Chernihivv 9NnOo i Zw X QqKk LpB