Day Zero
Design Your Architecture
Define Organizational Standards
Codify Standards with Plugins
Establish Golden Paths
Integrate with IDPs
Integrating Amplication with Other IDPs
Learn how to integrate Amplication with other Internal Developer Platforms (IDPs)
Amplication can be integrated with any Internal Developer Platform (IDP).
Prerequisites
- A workspace in Amplication
- An API token for the workspace
Amplication + GraphQL
Amplication is built with GraphQL in mind. This means that you can easily integrate Amplication with any IDP using by calling the GraphQL API.
Authentication
Your calls to the Amplication GraphQL API will need to be authenticated. You should use the API token to authenticate your calls. This is done by sending the token in the Authorization
header of your request:
{
Authorization: "Bearer YOUR_API_TOKEN"
Content-Type: "application/json"
}
Requests
Since we’re working with GraphQL, you’ll need to make requests to the GraphQL endpoint. The endpoint is https://server.amplication.com/graphql
and it will accept POST requests for queries and mutations.
This is a sample query:
const query = `
query searchCatalog($where: ResourceWhereInputWithPropertiesFilter) {
catalog(where: $where) {
totalCount
data {
id
name
}
}
}
`;
const variables = {
take: 100,
skip: 0,
where: {
resourceType: { in: ["ServiceTemplate"] }
}
};
fetch('https://server.amplication.com/graphql', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({
query,
variables
})
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
Get Requests
This is how you fetch templates.
query searchCatalog($where: ResourceWhereInputWithPropertiesFilter, $take: Int, $skip: Int) {
catalog(where: $where, take: $take, skip: $skip) {
totalCount
data {
id
name
description
resourceType
project {
id
name
}
blueprint {
id
name
}
}
__typename
}
}
{
"take": 100,
"skip": 0,
"where": {"resourceType": {"in": ["ServiceTemplate"]}},
}
{
data: {
catalog: {
data: {
{
"id": "cm6zln01a0209utjtlorazri1",
"name": "Node.js Template",
"description": "Template created from an existing resource",
"resourceType": "ServiceTemplate",
"project": {
"id": "cm6zlfk2o01liutjtdw8xj7f0",
"name": "Base Project"
},
"blueprint": {
"id": "cm6gb3j00000p14gz2n11otq4",
"name": "Node.js Service (Amplication's Standard)"
}
},
{
"id": "u1z6ijno0lrzmlra1ta9c200t",
"name": ".Net Template",
...
}
}
}
}
}
This is how you fetch templates.
query searchCatalog($where: ResourceWhereInputWithPropertiesFilter, $take: Int, $skip: Int) {
catalog(where: $where, take: $take, skip: $skip) {
totalCount
data {
id
name
description
resourceType
project {
id
name
}
blueprint {
id
name
}
}
__typename
}
}
{
"take": 100,
"skip": 0,
"where": {"resourceType": {"in": ["ServiceTemplate"]}},
}
{
data: {
catalog: {
data: {
{
"id": "cm6zln01a0209utjtlorazri1",
"name": "Node.js Template",
"description": "Template created from an existing resource",
"resourceType": "ServiceTemplate",
"project": {
"id": "cm6zlfk2o01liutjtdw8xj7f0",
"name": "Base Project"
},
"blueprint": {
"id": "cm6gb3j00000p14gz2n11otq4",
"name": "Node.js Service (Amplication's Standard)"
}
},
{
"id": "u1z6ijno0lrzmlra1ta9c200t",
"name": ".Net Template",
...
}
}
}
}
}
This is how you fetch resources.
query searchCatalog($where: ResourceWhereInputWithPropertiesFilter, $take: Int, $skip: Int) {
catalog(where: $where, take: $take, skip: $skip) {
totalCount
data {
id
name
description
resourceType
project {
id
name
}
blueprint {
id
name
}
serviceTemplate {
id
name
projectId
}
gitRepository {
name
gitOrganization {
name
provider
}
}
}
__typename
}
}
{
"take": 100,
"skip": 0,
"where": {"resourceType": {"in": ["Service", "Component"]}},
}
{
data: {
catalog: {
data: {
"id": "cm6gr9t4s0000jx5t8l8prvik",
"name": "Sample Resource Name",
"description": "General description for the resource",
"resourceType": "Service",
"project": {
"id": "cm6gb3j0a000q14gzlq9m7h1o",
"name": "Sample Project"
},
"blueprint": {
"id": "cm6gb3j00000p14gz2n11otq4",
"name": ".Net Service (Amplication's Standard)"
},
"serviceTemplate": null,
"gitRepository": {
"name": "example-repo",
"gitOrganization": {
"name": "example-company",
"provider": "Github"
}
},
{
"id": "9i0rc6km088vr0j0gt4lst5xp",
"name": "Another Sample Resource",
...
}
}
}
}
}
This is how to fetch outdated version alerts
The returned type
could be one of the three:
- CodeEngineVersion
- PluginVersion
- TemplateVersion
fragment OutdatedVersionAlertFields on OutdatedVersionAlert {
id
createdAt
updatedAt
resourceId
blockId
block {
id
displayName
}
type
outdatedVersion
latestVersion
status
}
query getOutdatedVersionAlerts(
$where: OutdatedVersionAlertWhereInput
$orderBy: OutdatedVersionAlertOrderByInput
$take: Int
$skip: Int
) {
outdatedVersionAlerts(
where: $where
orderBy: $orderBy
take: $take
skip: $skip
) {
...OutdatedVersionAlertFields
}
_outdatedVersionAlertsMeta(where: $where) {
count
}
}
{
"take": 100,
"skip": 0,
"orderBy": {"createdAt": "Desc"}
}
{
data: {
outdatedVersionAlerts: {
{
"id": "cm71nzqfh00lftp1dh9bslk0n",
"createdAt": "2025-02-18T10:07:00.022Z",
"updatedAt": "2025-02-18T10:07:00.022Z",
"resourceId": "cm71nzdyn00kltp1dyoe4abpu",
"blockId": "cm67mln9k004k55uul3j4ywww",
"block": {
"id": "cm67mln9k004k55uul3j4ywww",
"displayName": "Resource Template Version"
},
"type": "TemplateVersion",
"outdatedVersion": "0.1.0",
"latestVersion": "0.2.0",
"status": "New"
},
{
"id": "90pdh0t1fmk0lqnsh7nblcz1f",
...
}
}
}
}
Post Requests
Scaffolding a resource from an existing template is something we can do often.
mutation createServiceFromTemplate($data: ResourceFromTemplateCreateInput!) {
createResourceFromTemplate(data: $data) {
id
name
description
__typename
}
}
{
"data": {
"name": "Resource Name",
"description": "Resource Description",
"project": {
"connect": {
"id": "cm6zlfk2o01liutjtdw8xj7f0"
}
},
"serviceTemplate": {
"id": "cm6zln01a0209utjtlorazri1"
}
}
}
{
"data": {
"createResourceFromTemplate": {
"id": "cm7hf6bd20000r00ucwlkads3",
"name": "Resource Name",
"description": "Resource Description",
"__typename": "Resource"
}
}
}
Scaffolding a resource from an existing template is something we can do often.
mutation createServiceFromTemplate($data: ResourceFromTemplateCreateInput!) {
createResourceFromTemplate(data: $data) {
id
name
description
__typename
}
}
{
"data": {
"name": "Resource Name",
"description": "Resource Description",
"project": {
"connect": {
"id": "cm6zlfk2o01liutjtdw8xj7f0"
}
},
"serviceTemplate": {
"id": "cm6zln01a0209utjtlorazri1"
}
}
}
{
"data": {
"createResourceFromTemplate": {
"id": "cm7hf6bd20000r00ucwlkads3",
"name": "Resource Name",
"description": "Resource Description",
"__typename": "Resource"
}
}
}
Trigger a resource to re-build and commit its code to git.
mutation commit($data: CommitCreateInput!) {
commit(data: $data) {
id
builds {
id
resourceId
status
__typename
}
__typename
}
}
{
"data": {
"message": "feat(server): work in progress",
"project": {
"connect": {
"id": "cm6zlfk2o01liutjtdw8xj7f0"
}
},
"resourceIds": [
"cm7hf6bd20000r00ucwlkads3"
],
"bypassLimitations": true,
"commitStrategy": "Specific",
"resourceTypeGroup": "Services"
}
}
{
"data": {
"commit": {
"id": "cm7hfbv0g000nr00u61tlp735",
"builds": null,
"__typename": "Commit"
}
}
}
Was this page helpful?