To monitor a reply - like a webhook or a json payload use this:
<MvAssign name="l.ok" value="{ miva_json_decode(s.content_data, respOut) }">
Announcement
Collapse
No announcement yet.
An incoming MvCall
Collapse
X
-
Pretty much. https://www.miva.com/apiguide lists all API functions. You'll be passed the screen code so you know whether to handle it or not. And as always the headers will be available to you through the system variables.
- 1 like
Leave a comment:
-
Thanks David.
"Implement the JSON feature?" Not sure of the context. Is this the module feature?
In your first response though, seem simple, MY_CUSTOM_SCREEN doesn't need to be an existing template page because the custom module needs to have a System module feature and the "SystemModule_Screen" function intercepts the SCREEN CGI variable? And, I don't actually need to parse the HTTP header because Empressa/merchant.mvc is doing this work?
Scott
Leave a comment:
-
You could also implement the JSON feature and have your callback URL point to your JSON function that would do the same thing as mentioned above.
Leave a comment:
-
You could implement the system API feature and then use the "SystemModule_Screen" to intercept the callback. You would set your callback to <your_domain>/merchant.mvc?Screen=MY_CUSTOM_SCREEN and then have that API function handle that screen code. The posted data will be in the s.content_data variable, but if the service sending the data sets the content-type to application/json, then s.json_data will be populated and already contain the data in a structure / array.
Leave a comment:
-
If the returning call back url can be specified, you can set it to :thisdomain.com/talk-to-momma.html?myStuff=notyours
and just monitor a system action for (or even logging i suppose) for g.myStuff
???
Leave a comment:
-
An incoming MvCall
So, I think is kind of the reverse, and I'm not sure how to capture incoming data, since I know hardly anything.
From the info I currently have (questions not answered yet by the service at the endpoint) the incoming payload is likely JSON. But, I'm not sure of that yet. The custom module will make a call with a REST API function where the request is a JSON string that has a return-callback URL element for error reporting presumably different from the starting point (the Miva admin, or a scheduled task). So, the return information doesn't appear to be available in the s.callvalue. This means I need to parse that information in the callback URL endpoint.
I don't recall having this scenario come up before. So, if I don't know what's coming, how do I capture that? I don't if there will be a URI to parse. Could "how" o "what" be included in an HTTP Header, such as the content is JSON, and how would deal with responding to this?
Thanks,
Scott
Tags: None
Leave a comment: