Restful API
Restful API
RESTful API is an application program interface (API) that uses HTTP requests to GET,
PUT, POST and DELETE data. An API for a website is code that allows two software programs
to communicate with each other. a RESTful API will define one or more URL endpoints with a
domain, port, path, and/or querystring — for example, https://mydomain/user/123?format=json .
The HTTP method. The primary or most-commonly-used HTTP verbs (or methods, as they are
properly called) are POST, GET, PUT, PATCH, and DELETE. These correspond to create,
read, update, and delete (or CRUD) operations, respectively.
General Notes
This setup is for unique Pagination Rest scenarios where the next page URL isn't returned in
the response. For Pagination Rest APIs where the next page URL is returned, look into Azure
built in support for Pagination Azure Data Factory Documentation
Setup Steps
Database Setup
Refer to database section Database Setup
Trigger Setup
Refer to trigger section Trigger Setup
Dataset Setup
1. Create a new Dataset in the Author section by clicking the three dots next to Datasets.
5. Setup the Relative URL using the relative path and Page Parameter.
Example Dynamic content:
Template: @concat('api/v2/advisors/report/{reportID}?
api_key={apiKey}&username={userName}&page=',dataset().Page)
Example: @concat('api/v2/advisors/report/25268?
api_key=123&username=name&page=',dataset().Page)
Pipeline Setup
1. Create a new Pipeline in the Author section by clicking the three dots next to Pipelines.
1. Page [Used as a parameter to hit the API, also used to set PageCounter]
2. PageCounter [Used to set Page variable]
3. RecordCount [Used to check if ADF is at the end of API pages]
9. Edit the Until Activity and change the Expression to the following:
@lessOrEquals(int(variables('RecordCount')),0)
This expression will check if there are more records left from the API.
To add that value click on the edit Code button on the pipeline.
@string(activity('CopyData').output.rowsCopied)
1. SetRecordCount
2. SetPageCounter
3. SetPage
19. Move the newly created Pipeline and Datasets to a the BU folder.
Folder Naming Strategy
20. Added the needed trigger to the pipeline.