Endpointproxy - Execute Service Endpoint Request
Proxy for a GET request defined by a service endpoint.
POST https://dev.azure.com/{organization}/{project}/_apis/serviceendpoint/endpointproxy?endpointId={endpointId}&api-version=7.1
URI Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
|
organization
|
path | True |
string |
The name of the Azure DevOps organization. |
|
project
|
path | True |
string |
Project ID or project name |
|
api-version
|
query | True |
string |
Version of the API to use. This should be set to '7.1' to use this version of the api. |
|
endpoint
|
query | True |
string |
Id of the service endpoint. |
Request Body
| Name | Type | Description |
|---|---|---|
| dataSourceDetails |
Gets or sets the data source details for the service endpoint request. |
|
| resultTransformationDetails |
Gets or sets the result transformation details for the service endpoint request. |
|
| serviceEndpointDetails |
Gets or sets the service endpoint details for the service endpoint request. |
Responses
| Name | Type | Description |
|---|---|---|
| 200 OK |
successful operation |
Security
oauth2
Type:
oauth2
Flow:
accessCode
Authorization URL:
https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
Token URL:
https://app.vssps.visualstudio.com/oauth2/token?client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer&grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer
Scopes
| Name | Description |
|---|---|
| vso.serviceendpoint_query | Grants the ability to read and query service endpoints. |
Examples
Execute service endpoint request
Sample request
POST https://dev.azure.com/fabrikam/DefaultAgileGitProject/_apis/serviceendpoint/endpointproxy?endpointId=96e0fef2-3aaf-456f-bba0-920731ecab83&api-version=7.1
{
"dataSourceDetails": {
"dataSourceName": "Jobs",
"parameters": {}
},
"resultTransformationDetails": {
"resultTemplate": "{{#addField jobs 'parentPath' 'name' '/'}}{{#recursiveSelect jobs}}{{#notEquals _class 'com.cloudbees.hudson.plugins.folder.Folder'}}{{#notEquals _class 'org.jenkinsci.plugins.workflow.job.WorkflowJob'}}{ \"Value\" : \"{{#if parentPath}}{{parentPath}}/{{/if}}{{name}}\", \"DisplayValue\" : \"{{#if parentPath}}{{parentPath}}/{{/if}}{{{displayName}}}\" }{{/notEquals}}{{/notEquals}}{{/recursiveSelect}}{{/addField}}"
}
}
Sample response
{
"result": [
"{ \"Value\" : \"UnitTestJob\", \"DisplayValue\" : \"UnitTestJob\" }",
"{ \"Value\" : \"TestProj\", \"DisplayValue\" : \"TestProj\" }",
"{ \"Value\" : \"PortTests\", \"DisplayValue\" : \"PortTests\" }",
"{ \"Value\" : \"LoadTests\", \"DisplayValue\" : \"LoadTests\" }",
"{ \"Value\" : \"ArtifactJob\", \"DisplayValue\" : \"ArtifactJob\" }"
],
"statusCode": "ok",
"errorMessage": ""
}
Definitions
| Name | Description |
|---|---|
|
Authorization |
Represents the header of the REST request. |
|
Data |
Represents details of the service endpoint data source. |
|
Endpoint |
Represents the authorization used for service endpoint. |
|
Http |
Gets or sets the status code of the service endpoint request result. |
| JToken |
Represents an abstract JSON token. |
|
Result |
Represents template to transform the result data. |
|
Service |
Represents details of the service endpoint. |
|
Service |
|
|
Service |
Represents result of the service endpoint request. |
AuthorizationHeader
Represents the header of the REST request.
| Name | Type | Description |
|---|---|---|
| name |
string |
Gets or sets the name of authorization header. |
| value |
string |
Gets or sets the value of authorization header. |
DataSourceDetails
Represents details of the service endpoint data source.
| Name | Type | Description |
|---|---|---|
| dataSourceName |
string |
Gets or sets the data source name. |
| dataSourceUrl |
string |
Gets or sets the data source url. |
| headers |
Gets or sets the request headers. |
|
| initialContextTemplate |
string |
Gets or sets the initialization context used for the initial call to the data source |
| parameters |
object |
Gets the parameters of data source. |
| requestContent |
string |
Gets or sets the data source request content. |
| requestVerb |
string |
Gets or sets the data source request verb. Get/Post are the only implemented types |
| resourceUrl |
string |
Gets or sets the resource url of data source. |
| resultSelector |
string |
Gets or sets the result selector. |
EndpointAuthorization
Represents the authorization used for service endpoint.
| Name | Type | Description |
|---|---|---|
| parameters |
object |
Gets or sets the parameters for the selected authorization scheme. |
| scheme |
string |
Gets or sets the scheme used for service endpoint authentication. |
HttpStatusCode
Gets or sets the status code of the service endpoint request result.
| Value | Description |
|---|---|
| continue | |
| switchingProtocols | |
| ok | |
| created | |
| accepted | |
| nonAuthoritativeInformation | |
| noContent | |
| resetContent | |
| partialContent | |
| multipleChoices | |
| ambiguous | |
| movedPermanently | |
| moved | |
| found | |
| redirect | |
| seeOther | |
| redirectMethod | |
| notModified | |
| useProxy | |
| unused | |
| temporaryRedirect | |
| redirectKeepVerb | |
| badRequest | |
| unauthorized | |
| paymentRequired | |
| forbidden | |
| notFound | |
| methodNotAllowed | |
| notAcceptable | |
| proxyAuthenticationRequired | |
| requestTimeout | |
| conflict | |
| gone | |
| lengthRequired | |
| preconditionFailed | |
| requestEntityTooLarge | |
| requestUriTooLong | |
| unsupportedMediaType | |
| requestedRangeNotSatisfiable | |
| expectationFailed | |
| upgradeRequired | |
| internalServerError | |
| notImplemented | |
| badGateway | |
| serviceUnavailable | |
| gatewayTimeout | |
| httpVersionNotSupported |
JToken
Represents an abstract JSON token.
| Name | Type | Description |
|---|---|---|
| first |
Get the first child token of this token. |
|
| hasValues |
boolean |
Gets a value indicating whether this token has child tokens. |
| item |
Represents an abstract JSON token. |
|
| last |
Get the last child token of this token. |
|
| next |
Gets the next sibling token of this node. |
|
| parent |
string (JContainer) |
Gets or sets the parent. |
| path |
string |
Gets the path of the JSON token. |
| previous |
Gets the previous sibling token of this node. |
|
| root |
Gets the root JToken of this JToken. |
|
| type |
string (JTokenType) |
Gets the node type for this JToken. |
ResultTransformationDetails
Represents template to transform the result data.
| Name | Type | Description |
|---|---|---|
| callbackContextTemplate |
string |
Gets or sets the template for callback parameters |
| callbackRequiredTemplate |
string |
Gets or sets the template to decide whether to callback or not |
| resultTemplate |
string |
Gets or sets the template for result transformation. |
ServiceEndpointDetails
Represents details of the service endpoint.
| Name | Type | Description |
|---|---|---|
| authorization |
Gets or sets the authorization of service endpoint. |
|
| data |
object |
Gets or sets the data of service endpoint. |
| type |
string |
Gets or sets the type of service endpoint. |
| url |
string |
Gets or sets the connection url of service endpoint. |
ServiceEndpointRequest
| Name | Type | Description |
|---|---|---|
| dataSourceDetails |
Gets or sets the data source details for the service endpoint request. |
|
| resultTransformationDetails |
Gets or sets the result transformation details for the service endpoint request. |
|
| serviceEndpointDetails |
Gets or sets the service endpoint details for the service endpoint request. |
ServiceEndpointRequestResult
Represents result of the service endpoint request.
| Name | Type | Description |
|---|---|---|
| callbackContextParameters |
object |
Gets or sets the parameters used to make subsequent calls to the data source |
| callbackRequired |
boolean |
Gets or sets the flat that decides if another call to the data source is to be made |
| errorMessage |
string |
Gets or sets the error message of the service endpoint request result. |
| result |
Gets or sets the result of service endpoint request. |
|
| statusCode |
Gets or sets the status code of the service endpoint request result. |