Skip to main content

Notifications

Power Automate - Using Connectors
Unanswered

Two actions using the same URL, or one action action (and URL) with two different request bodies

(0) ShareShare
ReportReport
Posted on by 166

So Intuit built their QBO Customer API to use the same URL for two distinctly different actions: Create (POST) and Update (also, POST for some reason).

Create a customer

 

 

#Request URL
POST /v3/company/<realmID>/customer

Content type:application/json
Production Base URL:https://quickbooks.api.intuit.com
Sandbox Base URL:https://sandbox-quickbooks.api.intuit.com

#Request Body
{
 "FullyQualifiedName": "King Groceries", 
 "PrimaryEmailAddr": {
 "Address": "jdrew@myemail.com"
 }, 
 "DisplayName": "King's Groceries", 
 "Suffix": "Jr", 
 "Title": "Mr", 
 "MiddleName": "B", 
 "Notes": "Here are other details.", 
 "FamilyName": "King", 
 "PrimaryPhone": {
 "FreeFormNumber": "(555) 555-5555"
 }, 
 "CompanyName": "King Groceries", 
 "BillAddr": {
 "CountrySubDivisionCode": "CA", 
 "City": "Mountain View", 
 "PostalCode": "94042", 
 "Line1": "123 Main Street", 
 "Country": "USA"
 }, 
 "GivenName": "James"
}

 

 

Full update a customer

 

 

# Request URL
POST /v3/company/<realmID>/customer

Content type:application/json
Production Base URL:https://quickbooks.api.intuit.com
Sandbox Base URL:https://sandbox-quickbooks.api.intuit.com

# Request Body
{
 "domain": "QBO", 
 "PrimaryEmailAddr": {
 "Address": "Surf@Intuit.com"
 }, 
 "DisplayName": "Bill's Windsurf Shop", 
 "PreferredDeliveryMethod": "Print", 
 "GivenName": "Bill", 
 "FullyQualifiedName": "Bill's Windsurf Shop", 
 "BillWithParent": false, 
 "Job": false, 
 "BalanceWithJobs": 85.0, 
 "PrimaryPhone": {
 "FreeFormNumber": "(415) 444-6538"
 }, 
 "Active": true, 
 "MetaData": {
 "CreateTime": "2014-09-11T16:49:28-07:00", 
 "LastUpdatedTime": "2015-07-23T11:07:55-07:00"
 }, 
 "BillAddr": {
 "City": "Half Moon Bay", 
 "Line1": "12 Ocean Dr.", 
 "PostalCode": "94213", 
 "Lat": "37.4307072", 
 "Long": "-122.4295234", 
 "CountrySubDivisionCode": "CA", 
 "Id": "3"
 }, 
 "MiddleName": "Mac", 
 "Taxable": false, 
 "Balance": 85.0, 
 "SyncToken": "3", 
 "CompanyName": "Bill's Windsurf Shop", 
 "FamilyName": "Lucchini", 
 "PrintOnCheckName": "Bill's Wind Surf Shop", 
 "sparse": false, 
 "Id": "2"
}

 

 

Really, it looks like it determines if it is an update if the "Id" key is present in the body. That is the only distinction as to if it should update a record.

So, at any rate, I need a Create and an Update action. The Customer Connector will not allow this because they share the same URL.

What are my options here?

  • Make a separate custom connector? (That would be pretty stupid if I have to do this.)
  • Is there a way to force Power Automate to accept two Actions with the same URL? (I honestly don't see why this shouldn't be allowed. The action name being called should delineate the URL and Body to use. What difference does it make if it is the same URL.)
  • Is there a way to have two distinct bodies per one action in the custom connector?
  • Or, do I just have to build the body in the Flow with Compose and only have one generic action in the customer connector called "Create and Update Customers"?

Seems like the last option is going to be the case. If so, how do I add a request body from a Flow?

  • ishraqiyun77 Profile Picture
    ishraqiyun77 166 on at
    Re: Two actions using the same URL, or one action action (and URL) with two different request bodies

    Ok, submitted a ticket. But my work around for the time being is in the custom connector, when I declare the request, I just have the body as:

    {
    }

    That way, I can write out the request body in the flow. Kind of a hassle, but the issue as far as I can tell are two things:

    1. Swagger's design only supports one path + verb per their own own words
    2. Intuit just designed their API really poorly... seriously, an update should be a PUT or PATCH, not a POST and it shouldn't be left up to the request body to determine the action. The fact that the "Id" in the request body is what delineates that it is an update, should have been a good indicator that the URL should have been more RESTful like v3/company/<realmID>/customer/<Id> or at least a query parameter like ?Id=<Id>.

    At any rate...

  • alrezac Profile Picture
    alrezac on at
    Re: Two actions using the same URL, or one action action (and URL) with two different request bodies

    Hi,

     

    Looking at both of your issues here, it seems like you have some kind of overall issue wit how you have your custom connector set up. I'm not certain exactly if there is something wrong with how you have it set up or if its a limitation with the connection itself. I would recommend creating a Microsoft Support request on this. I'll include a link below; on how to do so if you would like to go down that route. Otherwise if any communities members might know what the issue feel free to chime in.

     

    If you would like to create a ticket with Microsoft Customer Support here is a link on how to do so: https://docs.microsoft.com/en-us/power-platform/admin/get-help-support

     

    Regards,

     

    Alex

     

    -------

     

    Community Support Team _ Alex Rezac
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,580

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,909

Leaderboard

Featured topics