how can post to other script and get returned data

5 years 10 months ago - 5 years 10 months ago #304708 by saman2
hi
A ) how can i post the data to some url and get returned data from that?for example i have phone number i cb and i want every time i call that AutoAction from, then i want
1-post that phone number to other url.
2-then that url return to me one token according user phone that i send in level 1.
the data will returned to me exactly like this:
{
    "code": 200,
    "data": {
        "token": "0b2d53b8-6401-585e-bf73-510fdc97109d"
    }
}
and i want get only token value from that

3-i want saved that returned token to some CB field of that user.
B )
other important question:how can i use url to fire the autoaction and post some parameter such as user id to that autoaction and how get user id via autoaction? is work [post] subsitiution or $_POST php global?
if is it possible reply me A ) section it is little emergency...thank you kyle..

Please Log in to join the conversation.

5 years 10 months ago #304714 by krileon
Use a Code action with Method set to PHP and code the entire interaction your self. There is no action type to handle what you're trying to do. As for executing an auto action from URL simple don't specify any Triggers, save the action, and under the Global tab is the URL to execute it manually. To specify a user for direct execution simply supply a user id to the "users" URL parameter. Other parameters in the URL can be accessed with [get_URL_PARAM_NAME]. Example URL as follows.

index.php?option=com_comprofiler&view=pluginclass&plugin=cbautoactions&action=action&actions=ACTION_ID_HERE&users=USER_ID_HERE&test=123

In the above using [get_test] will substitute in 123.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

5 years 10 months ago - 5 years 10 months ago #304717 by saman2

krileon wrote: There is no action type to handle what you're trying to do.

What is your mean about this? Is your mean my scenario can not implement? Can i get returned code from other site?
simply i want to know is it possible to request from my joomla to other site and get returned reply?

Please Log in to join the conversation.

5 years 10 months ago #304725 by krileon
You can send an HTTP request using the Request action type, but it can't do anything with the return data beyond display it. There is no code to handle storing the response. You maybe able to force some sort of storage behavior in the Output parameters by using PHP output and adding storage code there. But no there is no action type specifically designed for exactly what you're wanting; you're going to have to code some or all of it.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.150 seconds

Facebook Twitter LinkedIn