Azure logic apps to return multiple response - response

I am trying to create a azure logic app. This logic app should return first response with status code 202 accepted, send it back with a id and then process remaining workflow and then return 200 status code with final response. I am new to logic apps. Can this be achieved in azure logic apps, Please guide.
Thanks.

That's how usually a logic app works. There is nothing like the whole logic app returning with an ID but it is the connector in the Logic app that returns the values and the flow is continued within the logic app.
The whole Logic App is a workflow which is a collection of connectors that works according to our requirement
For more information, you can refer to it from Azure Logic Apps documentation | Microsoft Docs and Introduction to Azure Logic Apps - Learn | Microsoft Docs.

As I understand, your Logic App has a "When a HTTP request is received" trigger.
If you add a "Response" action and trigger the Logic App, it will run synchronously and return what you call the "final response" to the caller.
If you enable the Asynchronous Response setting in your "Response" action and trigger the Logic App again, it will work as you expect it to:
when the Logic App is triggered it will return 202 immediately, and the Location header of the response will contain a URL.
when you send a GET request to the URL from the response's Location header, it will return either 202 (and the response body will show that the Logic App is still running) or 200 (if that's the status code you selected in your "Response" action) with the final response, as expected.

Related

Microsoft Graph Booking Businesses DELETE operations failing: 404 Http response code

I am using Postman to successfully create a booking business using a POST method Http request to:
https://graph.microsoft.com/beta/bookingBusinesses.
The request body is like:
{
"DisplayName" : "TEST",
"Email" : "orgmailbox#xxxbuisiness.onmicrosoft.com"
}
The response contains an id.
I am not succeeding when attempting to delete the booking using the REST API here: https://learn.microsoft.com/en-us/graph/api/bookingbusiness-delete?view=graph-rest-beta&tabs=http
The Id use in the DELETE request is that extracted from the response body when the booking business was created.
I get Response code 404 ("Unkown Error").
As per the documentation the registered App in Azure AD has the required Bookings.Manage.All permissions
Does anyone know what might be wrong / how to resolve?
I can reproduce your problem. If you have deleted it, you will get a 404 error when you run the delete again, so please make sure you have deleted it. There may be some delay.
By the way, when you request the api, do not supply a request body for this method, and do not add unnecessary request parameters.
You can use graph-explorer testing.
First delete request:
Second delete request:
The issue we had was due to MFA (Multi-Factor Authentication). When we disabled the requirement for MFA for the user, we were able to successfully make the calls to delete the entry using Postman.

Can I trigger an API call?

My boss tells me we're getting Zendesk. I have no experience with it. We want to have it notify our system, e.g. via a call to an API which our system could expose.
Can this be done? Would I instead have to poll the Zendesk API?
Push notifications in web-applications are also known as "Webhooks". Zendesk does have a Webhook API, documented here:
https://developer.zendesk.com/embeddables/docs/android/handle_push_notifications_wh
and
https://developer.zendesk.com/embeddables/docs/ios/handle_push_notifications_wh
(Ignore the iOS and Android references - it's platform agnostic)
You can set up a combination of a Trigger and and External HTTP Target that sends an HTTP request to your API.
It will basically works like this:
You configure the external target to direct requests to the url of your API.
You configure the trigger with:
some conditions to look for (such as a ticket being updated with a specific tag), and
an action to perform when the conditions are met. In this case the action will be to send an HTTP request (with a JSON body) to the external target mentioned above.
Then, when the trigger's conditions are met, the trigger will send an HTTP request to your API endpoint.
You can add dynamic data to the JSON body of the request, such as the ticket number, user data, etc.
This article also might be helpful:https://support.zendesk.com/hc/en-us/articles/204890268
Note: External Targets are not currently available on the "Essential" Zendesk product, only "Team", "Professional", and "Enterprise."

Facing issues while trying to receive Real Time Updates from Facebook

I have a Mvc-facebook Application. I have configured my Facebook-Sample app in the Facebook Site.
Purpose of Sample Facebook App
Whenever I make some change in the first Name. Facebook should send the changes to my Web-Server in the form of JSon.
I have successfully configured the Subscription.
Facebook sent the token. Matched it with my code and my code sent the same token to Facebook. It's very good so far.
Issues 1 - In my Web-Server, I have Fiddler installed. When Facebook sends token to my Web-Server IIS, Fiddler is not showing the request.
Issue 2 - when I made some changes in my First Name, Facebook is not sending the data to my Web Server.
Please tell me what is missing in these issues.
Code
[HttpGet]
[FacebookSubscriptionVerify("MyToken")]
public void Verify(FacebookClient fb)
{
Response.Write(fb.AccessToken);
var verifiedResult = new FacebookSubscriptionVerifiedResult();
verifiedResult.ExecuteResult(ControllerContext);
}
[HttpPost]
[FacebookSubscriptionReceived]
[ActionName("Verify")]
public void ReceiveUserUpdates(object subscription)
{
}
In my Web-Server, I have Fiddler installed. When Facebook sends token to my Web-Server IIS, Fiddler is not showing the request.
Well, that does not sound as if your debugging/monitoring was successful, does it? You say before, that Facebook has actually sent you the token.
Find other means of debugging, f.e. have a look into the server’s access log.
when I made some changes in my First Name, Facebook is not sending the data to my Web Server.
If you deduce that the same way as you did above, then you probably deduced wrong …?
Be aware, that the POST requests Facebook sends for Realtime Updates are not in the “normal” format you would expect from f.e. an HTML form post, that means not as Content-Type: application/x-www-form-urlencoded.
Use wireshark to check what is sent, that will give you a correct view. Just capture everything and check http protocol.

RestKit - Handling authentication

I've begun working on the proof-of-concept for an iOS application that we'll be developing that leverages REST-based web services (implemented in Java using restEASY). I will be using RestKit as my client-side services library, and have been reading up on the documentation and some examples.
The vast majority of the services will require that a user be authenticated with a username and password. We have authentication services in place that accept a JSON object containing the credentials, so that part is easy. My question is, how do we handle the iOS piece when a service says that authentication is required?
Imagine this scenario...
A user starts up our app and it recognizes that the user needs to authenticate. A modal view controller pops up, prompts the user for authentication, and submits the request. The user is then able to make a bunch of REST calls with no problem. Eventually, they turn off their phone (app is still active) and come back to it an hour or so later. They click a button to fire off another REST call, but by this time the server-side session has expired.
Ideally, we'd like to be able to recognize that the server has indicated authentication is required, and pop up the modal view controller again. But, does RestKit have support for this? Is there any way for us to register a "global response handler" that is able to recognize that the server has responded this way?
We can return a status code in JSON or use an HTTP status code. We have flexibility on our services. The real question is how to handle this in the ideal way on the client. And, once we've reauthenticated the user, is there any way to replay the request they originally tried to submit? Or, would they have to kick off the action again?
Sorry if this doesn't make sense or if it's a very simple problem to solve. As I'm just getting started with RestKit, I wanted to make sure I was doing this the right way to avoid future problems. Any advice, code samples, tutorials, etc. that you can provide would be GREATLY appreciated.
I would suggest that you make a request to the server in your AppDelegate
- (void)applicationDidBecomeActive:(UIApplication *)application or
- (void)applicationWillEnterForeground:(UIApplication *)application method that sends the old authentication token. The server can then provide a response if the token is valid or invalid.
If your AppDelegate adopts the RKObjectLoaderDelegate protocol then it can handle the response. That way, whenever the application becomes active, the user is prompted to re-authenticate if necessary.

not getting any response from Google Checkout after successfully payment

I am not getting any response by Google Checkout:
I have the sample code from http://code.google.com/p/google-checkout-php-sample-code/downloads/list .
I am using this code in cartdemo.php:
// Specify <edit-cart-url>
$cart->SetEditCartUrl("https://mydomain.com/checkout/demo/responsehandlerdemo.php");
// Specify "Return to xyz" link
$cart->SetContinueShoppingUrl("https://mydomain.com/checkout/demo/responsehandlerdemo.php");
And I am using following settings:
API callback URL (Level 2 integrations only) [?]
Specify a URL for Google to notify you of new orders and changes in order state. [?]
API callback URL:
Callback contents: http://mydomain.com/checkout/demo/responsehandlerdemo.php
**Notification Serial Number**
but not getting any response,after completation of payment.
I have also changed the settings with "Notification as XML" by using https.
actually the application require to integrate simple google checkout functionality.Which will have an checkout button and after successful payment the order history with payment detail will save in my database.
I don't know what is missing.
is there any way do implement it simply using 1-2 files not so bulky code?
thanks
The code you have above doesn't have anything to do with getting data from Google after completion of payment (Notification API).
The code you have above is for the Checkout API which is the flow that involves sending your shopping cart data to Google.
edit-cart-url is the url that is displayed to the customer on checkout if they want to go back to your site instead of placing the order/continuing with the checkout process.
continue-shopping-url is the link presented to the customer to go back to your web site after successful checkout.
You have to implement the Notification API (of which one option is serial number notification) to obtain data from Google. The url to your handler is set in your account (same place where you see the options you mention above).
If you want to see sample PHP code (I'm not a Php dev, am .Net) for a handler that implements serial number notification, see basicapiresponshandlerdemo.php

Resources