EndPoint Generic 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.
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:
Generic Request using API Source

Generic Request using API Destination

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"
}
}
}
]
'
)
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 [LINKED_SERVER_TO_AZURE_DEVOPS_IN_DATA_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 [LINKED_SERVER_TO_AZURE_DEVOPS_IN_DATA_GATEWAY];