How to create a simple webservice function in moodle? - moodle

i wants to create a simple function that prints a message hello world in moodle.
How can i create a simple webservice function in moodle.

Related

Bambora Payment Service + React Application integration

I'm trying to set up a third party payment service with my React application.
https://developer.bambora.com/europe/sdk/web-sdk/checkout-integration
I'm trying to figure out how to send form data onSubmit as an object to pre-populate form fields on the Bambora redirect URL page.
I'm thinking that I have to create a state object, populate it onSubmit of the fields, if valid pass it to the RedirectCheckout() somehow. I'm not sure how to do that last part.
import { RedirectCheckout } from "#bambora/checkout-sdk-web";
....
new RedirectCheckout("<<YOUR-SESSION-TOKEN-HERE>>")
This was solved by using the checkout link generator from Bambora and creating a hash function using the params they used in their hash function for validation for the link.

How to fetch content of Book created in Moodle using APIs?

How to fetch content of Book created in Moodle using APIs?
I have tested mod_book_view_book function, but I am only getting book name, not the content of book.
Use core_course_get_contents function, then take from response elements, where modname="book"
Example:
https://host/webservice/rest/server.php?wstoken=user_token&wsfunction=core_course_get_contents&moodlewsrestformat=json&courseid=31

MS Bot framework i want to put a form builder in an open conversation

I want to start Form conversation chat in Microsoft Bot framework.
if(user says hello)
{
reply = what u want to listen hi or hello
if(user says order)
{
reply= start a formbuilder.form with order form workflow
}
if(user says hello)
{
reply= hello
}
}
My problem is the first thing i do always works
example: if i say first chat line as order it starts order form but it never goes to the normal conversation mode even if the form ends.
if i start hi then it always goes in hi mode never goes or create order form on typing order.
Need it to be dynamic
you can use below code to end your conversation when you are in a dialog or a conversation flow ends.
context.Done<object>(new object());
or
context.Done(true);
do let me know if you need any help further
Per my understanding, you want start specific dialogs while triggering different words like "hollo" for greeting dialog, "order" for form dialog.
I think there are two methods to achieve this in C#:
You can leverage Recognize intents to implement LUIS, which can identify your users' intent from their spken or textual input, or utterances. Trigger specific dialogs for each LUIS intent.
For this solution you can refer to the official document Recognize intents and entities with LUIS using a prebuilt domain for details, and refer to https://github.com/Microsoft/BotBuilder-Samples/tree/master/CSharp/intelligence-LUIS for a sample for your reference.
You also can build Global message handlers using scorables in your bot application for yourself. With which, you can route users to certain fuctionality by using words like "help," "cancel," or "start over" in the middle of a conversation when the bot is expecting a different response.
Please refer to https://github.com/Microsoft/BotBuilder-Samples/tree/master/CSharp/core-GlobalMessageHandlers for the sample for this solution.
Hope it helps.

Infusionsoft Form Submission API

I have been using Infusionsoft form embedded in html page but now I want to send data to Infusionsoft form using their API. I checked their APIs but could not figure out which one should be used to submit data to the Infusionsoft form. Can someone please help me with this?
https://developer.infusionsoft.com/docs/xml-rpc/
Thanks for looking into this.
Thank you, Naresh
Try to use REST API instead of XML RPC. Developer center already marked XML RPC to "legacy" module, and I guess they will replace "XML RPC" sooner or later.
Regarding to your question, you will need to define what data set you want to update.
For example, if your form is going to insert a new contact, you will need 2 things from your code.
First, prepare the parameters such like "email_addresses", "phone_numbers" and "given_name".
Second, POST request with parameters to this URL "https://api.infusionsoft.com/crm/rest/v1/contact?access_token=123abc" after authentication.
Ways to test:
Try REST API calls on page https://developer.infusionsoft.com/docs/rest/
Good luck.
To pull Webformvia API you will have to use following method, this will pull the HTML form:
Retrieve a Form's HTML
to submit a data to Infusionsoft via API
You will have to use Create contact and update contact API:
Create Contact
Update COntact
XML RPC is still in use but Infusionsoft suggests to use REST API methods
Create a Contact
Update a Contact
Single API call for two methods: Create or Update a Contact

How to add applink to custom story via Object Browser? (hosted object)

I'm trying to post custom story with applink. I have defined action type complete and an object step - so user can "complete a step" inside app. Then I defined one step using Object Browser. How can I add applink via Object Browser?
There is a field al:android, which I assume needs to be filled with data. There is a hint stating that I should put there JSON object or array. So I did.
Tried with:
{"package":"com.example.myapp","class":"com.example.myapp.MainActivity","app_name":"My Example App"}
I've got error:
Is there a way to make this work?
You can use Facebook Mobile Hosting API to create App Link objects. Here is documentation: https://developers.facebook.com/docs/applinks/hosting-api
Should get in return something like this: {"id":"643402985734299"}, this is the ID of hosted applink - try with it.