MyRapidi
MyRapidi

Search our Wiki

Create Connection

Below you see an example of how to create a 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:

In this example, we are creating a NAV SQL connection with RapidiConnector.

curl 
  -H "Authorization: Bearer [API SECURITY TOKEN]"
  -H "Content-Type: application/json" 
  -H "Accept: application/json"
  -X POST
  data = "{\"code\":\"CONN_NAVSQL\",\"description\":\"my new navsql connection with RapidiConnector\",\"connection_type\":\"ms_dynamics_nav_sql\",
           \"server_connect\":\"WIN-XXX\NAVDEMO\",\"database\":\"Demo Database NAV (X-0-X)\",\"account\":\"Cronus\",
           \"use_windows_authentication\": true, \"rapidiconnector\":{\"password\":\"\"}}"
  https://api.myrapidi.com/api/v2/service/[SERVICE ID]/connections

The out-put for this example would be:

{
  "id": "5",
  "code": "CONN_NAVSQL",
  "description": "my new navsql connection with RapidiConnector",
  "connection_type": "ms_dynamics_nav_sql",
  "server_connect": "WIN-XXXNAVDEMO"'
  "database": "Demo Database NAV (X-0-X)",
  "account": "Cronus",
  "use_windows_authentication": true,
  "user_id": null,
  "rapidiconnector": {
    "user_id": "CONN_NAVSQL_R",
    "password": "ECz2xxxxx"
  },
  "comments": []
}

The user_id for the RapidiConnector will automatically be generated and if you leave the password blank it will also be generated automatically else it will set the password you specify.

JSONAPI:

In this example, we are creating a salesforce.com connection.

curl 
  -H "Authorization: Bearer [API SECURITY TOKEN]"
  -H "Content-Type: application/vnd.api+json" 
  -H "Accept: application/vnd.api+json"
  -X POST
  data = "{\"data\":{\"type\":\"connections\",\"attributes\":{\"code\":\"CONN_SFDC\",\"description\":\"SFDC connection\", 
           \"connection_type\":\"salesforce_com\", \"user_id\":\"admin@demo.com\",\"password\":\"xxx\",
           \"use_ssl\":true,\"sandbox\":true }} }"
  https://api.myrapidi.com/api/v2/service/[SERVICE ID]/connections

The out-put for this example would be:

{
  "data":{
    "id": "2",
    "type": "connections",
    "attributes": {
      "code": "CONN_SFDC",
      "description": "SFDC connection",
      "connection_type": "salesforce_com",
      "user_id": "admin@demo.org",
      "use_ssl": true,
      "sandbox": true
    },
    "relationships": {
      "comments": {
        "data": []
      }
    }
  }
}