Skip to end of banner
Go to start of banner

Location REST Services

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Next »

This page is about Assets & Inventory Plugin for Jira DC. Using Cloud? Click here.

Contents

Listing all locations

Method

GET

URL

/rest/jip-api/1.0/location.json

Sample Response

{
  "success" : true,
  "errorCode" : null,
  "errorMessage" : null,
  "data" : {
    "9" : {
      "id" : 9,
      "createdAt" : 1589361990532,
      "createdByUserKey" : "JIRAUSER10000",
      "updatedAt" : null,
      "updatedByUserKey" : null,
      "locationName" : "Storage",
      "street" : "Strawberry",
      "city" : "Istanbul",
      "province" : "Fruit",
      "postalCode" : "99999",
      "country" : "Turkey",
      "contactUserKey" : "JIRAUSER10100",
      "contactUser" : {
        "key" : "JIRAUSER10100",
        "username" : "armagan",
        "name" : "armagan",
        "directoryId" : 1,
        "emailAddress" : "armagan@example.com",
        "displayName" : "Armağan Çağlar",
        "avatarUrl" : "https://www.gravatar.com/avatar/f8575c1f149143c5d9e11a734d8dc29f?d=mm&s=48",
        "active" : true
      },
      "phone" : "05000000000",
      "email" : "armagan@snapbytes.com",
      "url" : "http://snapbytes.com",
      "description" : "Storage location",
      "active" : true,
      "external" : true,
      "createdByUser" : {
        "key" : "JIRAUSER10000",
        "username" : "admin",
        "name" : "admin",
        "directoryId" : 1,
        "emailAddress" : "admin@example.com",
        "displayName" : "admin",
        "avatarUrl" : "http://localhost:8080/secure/useravatar?ownerId=JIRAUSER10000&avatarId=10700",
        "active" : true
      },
      "updatedByUser" : null
    }
  },
  "pagingInfo" : null
}

Listing single location

Method

GET

URL

/rest/jip-api/1.0/location/[locationId].json

Sample Response

{
  "success": true,
  "errorCode": null,
  "errorMessage": null,
  "data": {
    "id": 9,
    "createdAt": 1589361990532,
    "createdByUserKey": "JIRAUSER10000",
    "updatedAt": null,
    "updatedByUserKey": null,
    "locationName": "Storage",
    "street": "Strawberry",
    "city": "Istanbul",
    "province": "Fruit",
    "postalCode": "99999",
    "country": "Turkey",
    "contactUserKey": "JIRAUSER10100",
    "contactUser": {
      "key": "JIRAUSER10100",
      "username": "armagan",
      "name": "armagan",
      "directoryId": 1,
      "emailAddress": "armagan@example.com",
      "displayName": "Armağan Çağlar",
      "avatarUrl": "https://www.gravatar.com/avatar/f8575c1f149143c5d9e11a734d8dc29f?d=mm&s=48",
      "active": true
    },
    "phone": "05000000000",
    "email": "armagan@snapbytes.com",
    "url": "http://snapbytes.com",
    "description": "Storage location",
    "active": true,
    "external": true,
    "createdByUser": {
      "key": "JIRAUSER10000",
      "username": "admin",
      "name": "admin",
      "directoryId": 1,
      "emailAddress": "admin@example.com",
      "displayName": "admin",
      "avatarUrl": "http://localhost:8080/secure/useravatar?ownerId=JIRAUSER10000&avatarId=10700",
      "active": true
    },
    "updatedByUser": null
  },
  "pagingInfo": null
}

Failure Message

{
  "success": false,
  "errorCode": "EntityNotFoundException",
  "errorMessage": "location",
  "data": null,
  "pagingInfo": null
}

Creating a new location

Important

  • While creating and updating locations with REST APIs, the "locationName" variable must be defined in the request body. Otherwise you will not be able to create or update locations.

  • Variables which is not defined in the request body will be considered null.

Method

POST

URL

/rest/jip-api/1.0/location.json

Request Body

{
"active": true,
"external": true,
"locationName": "Storage",
"contactUserKey": "JIRAUSER10100",
"street": "Strawberry",
"city": "Istanbul",
"province": "Fruit",
"postalCode": "99999",
"country": "Turkey",
"phone": "05000000000",
"email": "armagan@example.com",
"url": "http://snapbytes.com",
"description": "Storage location"
}

Sample Response

{
  "success" : true,
  "errorCode" : null,
  "errorMessage" : null,
  "data" : {
    "id" : 6,
    "createdAt" : 1589361261391,
    "createdByUserKey" : "JIRAUSER10000",
    "updatedAt" : null,
    "updatedByUserKey" : null,
    "locationName" : "Storage",
    "street" : "Strawberry",
    "city" : "Istanbul",
    "province" : "Fruit",
    "postalCode" : "99999",
    "country" : "Turkey",
    "contactUserKey" : "JIRAUSER10100",
    "contactUser" : {
      "key" : "JIRAUSER10100",
      "username" : "armagan",
      "name" : "armagan",
      "directoryId" : 1,
      "emailAddress" : "armagan@example.com",
      "displayName" : "Armağan Çağlar",
      "avatarUrl" : "https://www.gravatar.com/avatar/f8575c1f149143c5d9e11a734d8dc29f?d=mm&s=48",
      "active" : true
    },
    "phone" : "05000000000",
    "email" : "armagan@example.com",
    "url" : "http://snapbytes.com",
    "description" : "Storage location",
    "active" : true,
    "external" : true,
    "createdByUser" : {
      "key" : "JIRAUSER10000",
      "username" : "admin",
      "name" : "admin",
      "directoryId" : 1,
      "emailAddress" : "admin@example.com",
      "displayName" : "admin",
      "avatarUrl" : "http://localhost:8080/secure/useravatar?ownerId=JIRAUSER10000&avatarId=10700",
      "active" : true
    },
    "updatedByUser" : null
  },
  "pagingInfo" : null
}

Failure Message

{
  "success": false,
  "errorCode": "EntityExistsException",
  "errorMessage": "Storage",
  "data": null,
  "pagingInfo": null
}

Update location

Method

POST

URL

/rest/jip-api/1.0/location.json

Request Body

{
"id": 6,
"active": true,
"external": true,
"locationName": "Storage 1",
"contactUserKey": "JIRAUSER10100",
"street": "Strawberry",
"city": "Istanbul",
"province": "Fruit",
"postalCode": "99999",
"country": "Turkey",
"phone": "05000000000",
"email": "armagan@example.com",
"url": "http://snapbytes.com",
"description": "Storage location"
}

Sample Response

{
  "success" : true,
  "errorCode" : null,
  "errorMessage" : null,
  "data" : {
    "id" : 6,
    "createdAt" : 1589361261391,
    "createdByUserKey" : "JIRAUSER10000",
    "updatedAt" : 1589361578580,
    "updatedByUserKey" : "JIRAUSER10000",
    "locationName" : "Storage 1",
    "street" : "Strawberry",
    "city" : "Istanbul",
    "province" : "Fruit",
    "postalCode" : "99999",
    "country" : "Turkey",
    "contactUserKey" : "JIRAUSER10100",
    "contactUser" : {
      "key" : "JIRAUSER10100",
      "username" : "armagan",
      "name" : "armagan",
      "directoryId" : 1,
      "emailAddress" : "armagan@example.com",
      "displayName" : "Armağan Çağlar",
      "avatarUrl" : "https://www.gravatar.com/avatar/f8575c1f149143c5d9e11a734d8dc29f?d=mm&s=48",
      "active" : true
    },
    "phone" : "05000000000",
    "email" : "armagan@example.com",
    "url" : "http://snapbytes.com",
    "description" : "Storage location",
    "active" : true,
    "external" : true,
    "createdByUser" : {
      "key" : "JIRAUSER10000",
      "username" : "admin",
      "name" : "admin",
      "directoryId" : 1,
      "emailAddress" : "admin@example.com",
      "displayName" : "admin",
      "avatarUrl" : "http://localhost:8080/secure/useravatar?ownerId=JIRAUSER10000&avatarId=10700",
      "active" : true
    },
    "updatedByUser" : {
      "key" : "JIRAUSER10000",
      "username" : "admin",
      "name" : "admin",
      "directoryId" : 1,
      "emailAddress" : "admin@example.com",
      "displayName" : "admin",
      "avatarUrl" : "http://localhost:8080/secure/useravatar?ownerId=JIRAUSER10000&avatarId=10700",
      "active" : true
    }
  },
  "pagingInfo" : null
}

Failure Message

{
  "success" : false,
  "errorCode" : "EntityNotFoundException",
  "errorMessage" : "location",
  "data" : null,
  "pagingInfo" : null
}

Delete location

Method

DELETE

URL

/rest/jip-api/1.0/location./[locationId].json

Success Message

{
  "success" : true,
  "errorCode" : null,
  "errorMessage" : null,
  "data" : null,
  "pagingInfo" : null
}

Failure Message

{
  "success": false,
  "errorCode": "EntityNotFoundException",
  "errorMessage": "location",
  "data": null,
  "pagingInfo": null
}
  • No labels