Azure Data Factory - Birdeye API POST

Chris Crichton-RA 1 Reputation point
2022-09-20T19:35:29.09+00:00

Hello,

I am looking for help to GET 'Customer' JSON from one API and POST to Birdeye API (RESTful). Curl example at the end. developers.birdeye.com

I know how to GET, but do not know how POST works. I recall there being more steps than just a GET.

The Sinks for Copy and Flow both have a POST option available for HTTP/REST Datasets.

How do I use these activities to POST data to an API Birdeye?
Does it matter if I use HTTP or REST datasets?
Can I format the Linked Services like the GET LS?

243050-screenshot-from-2022-09-20-09-03-48.png

243152-screenshot-from-2022-09-20-09-07-09.png

Example curl request
Customer can be created/updated using:

curl --location --request POST 'https://api.birdeye.com/resources/v1/customer-v2/external/saveCustomer?businessId=161322675307514&api_key=uaz9WymF7BbRUISTcqD1ALeyfYSNAfy4' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data-raw '{
"firstName": "Michael",
"lastName": "Scarn",
"email": "******@dm.com",
"phone": null,
"emailOptin":true,
"smsOptin":true,
"blocked": false,
"businessIds": [161322675307514, 161322681923726],
"tags": ["Tag One","Tag Two"],
"customFields": [
{
"fieldName": "Company",
"type": "text",
"fieldValue": "Dunder Mifflin"
},
{
"fieldName": "Product",
"type": "text",
"fieldValue": "Paper"
},
{
"fieldName": "Rating",
"type": "number",
"fieldValue": "5"
}
]
}'

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,624 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. ShaikMaheer-MSFT 38,546 Reputation points Microsoft Employee Moderator
    2022-09-22T14:19:01.983+00:00

    Hi @Chris Crichton-RA ,

    Thank you for posting query in Microsoft Q&A Platform.

    When you use REST API call as Sink in Copy activity, then from source dataset whatever the data we get that gets posted to REST API as request body. You need to consider using Mappings tab and schema mapping to define or shape your json as per demand of Sink REST API.

    If your source data returned is not in desired format of Sink REST API then this approach will not work. That case I would encourage you to get data from your Source first(using Web activity of its API or using Look up activity if its table of file) and then form your request json properly using set variable or other activities and then make API call to Sink API using web activity and supply request body accordingly.

    Please click here to know details about REST API as Sink properties in Copy and data flow.

    Hope this helps. Please let me know if any further queries.

    --------------

    Please consider hitting Accept Answer. Accepted answers help community as well.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.