MyRapidi
MyRapidi

Search our Wiki

Update Connection

Below you see an example on how to update a specific connection. Examples both in JSON and JSONAPI are provided.

NOTE: Remember to substitute the token (after Bearer) and the service id (the "[SERVICE ID]" below) to your own token and service id.

JSON:

curl 
  -H "Authorization: Bearer [API SECURITY TOKEN]"
  -H "Content-Type: application/json" 
  -H "Accept: application/json"
  -X PATCH
  data = "{\"server_connect\":\"thisisthenewurl\",\"company\":\"CRONUS A/S\",\"user_id\":\"xxx\",\"password\":\"xxx\",
           \"resource\":\"long_resource_654654\",\"domain\":\"domainxxx\",\"metadata\":\"url_to_met/$metadata\"}"
  https://api.myrapidi.com/api/v2/service/[SERVICE ID]/connections/2

The out-put for this example would be:

{
  "id": "2",
  "code": "NAV002",
  "description": "NAV 2009 native",
  "connection_type": "ms_dynamics_nav",
  "driver": "nbcnd",
  "network_protocol": "",
  "server_connect": "thisisthenewurl",
  "database_path": "",
  "account":"CRONUS A/S",
  "use_windows_authentication": true,
  "user_id": "xxx",
  "use_codeunits_permissions": null,
  "installation_path": "C:\\Program Files\\Microsoft Dynamics NAV\\60\\Classic",
  "rapidiconnector": {
    "user_id": "NAV002_R",
    "password": "xxxxx"
  },
  "comments": []
}

JSONAPI:

curl 
  -H "Authorization: Bearer [API SECURITY TOKEN]"
  -H "Content-Type: application/vnd.api+json" 
  -H "Accept: application/vnd.api+json"
  -X PATCH
  data = "{\"data\":{\"id\":\"2\",\"type\":\"connections\",\"attributes\":{\"server_connect\":\"newrurl\",\"company\":\"Cronus UK\"} }}
  https://api.myrapidi.com/api/v2/service/[SERVICE ID]/connections/2

The out-put for this example would be:

{
  "data":{
  "id": "2",
  "type": "connections",
  "attributes": {
    "code": "NAV002",
    "description": "NAV 2009 native",
    "connection_type": "ms_dynamics_nav",
    "driver": "ndbnd",
    "network_protocol": "",
    "server_connect": "newurl",
    "database_path": "",
    "account": "Cronus UK",
    "use_windows_authentication": true,
    "user_id": "",
    "user_codeunits_permissions": null,
    "installation_path": "C:\\Program Files\\Microsoft Dynamics NAV\\60\\Classic"
    },
    "relationships": {
      "rapidiconnector": {
        "data": {
          "id":"55",
          "type": "rapidiconnector"
        }
      },
      "comments": {
        "data": []
      }
    }
  },
  "included": [
    {
    "id":"55",
    "type": "rapidiconnector",
    "attributes": {
      "user_id": NAV003_R",
      "password": "xxx"
    }
    } 
  ]
}