Make Generic API Request
Name
generic_request
Description
This is generic endpoint. Use this endpoint when some actions are not implemented by connector. Just enter partial URL (Required), Body, Method, Header etc. Most parameters are optional except URL.
Related Tables
Parameters
Output Columns
Label | Data Type (SSIS) | Data Type (SQL) | Length | Raw | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
There are no Static columns defined for this endpoint. This endpoint detects columns dynamically at runtime. |
Input Columns
Label | Data Type (SSIS) | Data Type (SQL) | Length | Raw | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
There are no Static columns defined for this endpoint. This endpoint detects columns dynamically at runtime. |
Examples
SSIS
Use Azure DevOps Connector in API Source component to read data or in API Destination component to read/write data:
Read from Generic Table (Bulk Read / Write) table using API Destination
This Endpoint belongs to Generic Table (Bulk Read / Write) table, therefore you cannot work with it directly. Use this table and table-operation pair instead:

ODBC application
Use these SQL queries in your ODBC application data source:
Upload file (attachment)
SELECT *
FROM generic_request
WITH(
Url='YOUR_ORGANIZATION/YOUR_PROJECT/_apis/wit/attachments?api-version=7.0',
RequestMethod='POST',
RequestContentTypeCode='ApplicationOctetStream', --//Binary upload
--Headers='Content-Type: application/octet-stream', --//same as above
Body='@c:\temp\screeenshot-1.png',
IsMultiPart=1,
Meta='id:string(100);url:string(500)' --response columns you like to display
)
Add link to an exising WorkItem (add attachment as reference link)
If you know the attachment file URL you can use that in below query and attach a link to an exising WorkItem
SELECT *
FROM generic_request
WITH(
Url='YOUR_ORGANIZATION/YOUR_PROJECT/_apis/wit/workitems/WORK_ITEM_NUMBER?api-version=7.0',
RequestMethod='PATCH',
Headers='Content-Type: application/json-patch+json',
Meta='id:int; fields.System.Title:string; fields.System.State:string; fields.System.WorkItemType:string; relations:string(4000)',
Body='
[
{
"op": "add",
"path": "/fields/System.History",
"value": "Adding the necessary spec"
},
{
"op": "add",
"path": "/relations/-",
"value": {
"rel": "AttachedFile",
"url": "https://dev.azure.com/YOUR_ORGANIZATION/YOUR_PROJECT/_apis/wit/attachments/ATTACHMENT_ID?fileName=Screenshot.png",
"attributes": {
"comment": "Error screenshot"
}
}
}
]
'
)
generic_request
endpoint belongs to
__DynamicRequest__
table(s), and can therefore be used via those table(s).
SQL Server
Use these SQL queries in SQL Server after you create a data source in Data Gateway:
Upload file (attachment)
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT *
FROM generic_request
WITH(
Url=''YOUR_ORGANIZATION/YOUR_PROJECT/_apis/wit/attachments?api-version=7.0'',
RequestMethod=''POST'',
RequestContentTypeCode=''ApplicationOctetStream'', --//Binary upload
--Headers=''Content-Type: application/octet-stream'', --//same as above
Body=''@c:\temp\screeenshot-1.png'',
IsMultiPart=1,
Meta=''id:string(100);url:string(500)'' --response columns you like to display
)';
EXEC (@MyQuery) AT [LS_TO_AZURE_DEVOPS_IN_GATEWAY];
Add link to an exising WorkItem (add attachment as reference link)
If you know the attachment file URL you can use that in below query and attach a link to an exising WorkItem
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT *
FROM generic_request
WITH(
Url=''YOUR_ORGANIZATION/YOUR_PROJECT/_apis/wit/workitems/WORK_ITEM_NUMBER?api-version=7.0'',
RequestMethod=''PATCH'',
Headers=''Content-Type: application/json-patch+json'',
Meta=''id:int; fields.System.Title:string; fields.System.State:string; fields.System.WorkItemType:string; relations:string(4000)'',
Body=''
[
{
"op": "add",
"path": "/fields/System.History",
"value": "Adding the necessary spec"
},
{
"op": "add",
"path": "/relations/-",
"value": {
"rel": "AttachedFile",
"url": "https://dev.azure.com/YOUR_ORGANIZATION/YOUR_PROJECT/_apis/wit/attachments/ATTACHMENT_ID?fileName=Screenshot.png",
"attributes": {
"comment": "Error screenshot"
}
}
}
]
''
)';
EXEC (@MyQuery) AT [LS_TO_AZURE_DEVOPS_IN_GATEWAY];
generic_request
endpoint belongs to
__DynamicRequest__
table(s), and can therefore be used via those table(s).