MyRapidi
MyRapidi

Search our Wiki

Get Groups

Below you see an example on how to list groups. 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 GET
  https://api.myrapidi.com/api/v2/service/[SERVICE ID]/groups

The out-put for this example would be:

{
  {
    "id": "8",
    "code": "CONTACT",
    "description": "Contact Transfers",
    "comments": []
  },
  {
    "id":"2",
    "code": "CUSTOMER",
    "description": "Customer Transfers",
    "comments": [
      {
        "created_at": "2017-08-27T16:14:57Z",
        "created_by": "mibock",
        "comment": "updated group"
      },
      { 
        "created_at": "2017-08-28T15:19:34Z", 
        "created_by": "mibock",
        "comment": "<p>adjusted</p> - ready to run"
      }
    ]
  },
  {
    "id":"5",
    "code": "INVOICE",
    "description": "Invoice Transfers",
    "comments": []
  },
  {
    "id":"3",
    "code": "ITEM",
    "description": "Item related Transfers",
    "comments": []
  },
  {
    "id":"4",
    "code":"ORDER",
    "description":"Opportunity/Order Transfers"
    "comments": []
  }
}

JSONAPI:

curl 
  -H "Authorization: Bearer [API SECURITY TOKEN]"
  -H "Content-Type: application/vnd.api+json" 
  -H "Accept: application/vnd.api+json"
  -X GET
  https://api.myrapidi.com/api/v2/service/[SERVICE ID]/groups

The out-put for this example would be:

{
  "data": [
    {
      "id":"8",
      "type": "groups",
      "attributes":{
        "code": "CONTACT",
        "description": "Contact Tranfers"
      },
      "relationships": {
        "comments": {
          "data": [
            {
              "id":"10",
              "type": "comments"
            },
            {
            "id":"12",
            "type": "comments"
            }
          ] 
        }
      }
    },
    {
      "id": "2",
      "type": "groups",
      "attributes": {
        "code": "INVOICE",
        "description": "Invoice Transfers"
      },
      "relationships": {
        "comments": {
          "data": []
        }
      }
    },
    {
      "id": "3",
      "type": "groups",
      "attributes": {
        "code": "ITEM",
        "description": "Item related Transfers"
      },
      "relationships": {
        "comments": {
          "data": []
        }
      }
    },
    {
      "id": "4",
      "type": "groups", 
      "attributes": {
        "code":"ORDER",
        "description": "Opportunities/Order Transfers"
      },
      "relationships": {
        "comments": {
          "data": []
        }
      }
    }
  ],
  "included": [
    {
      "id": "10",
      "type": "comments",
      "attributes": {
        "created_at": "2015-07-27T16:14:57Z",
        "created_by": "mibock",
        "comment": "updated"
      }
    },
    {
      "id": "12",
      "type": "comments",
      "attributes": {
        "created_at": "2015-08-12T16:29:33Z",
        "created_by": "mibock",
        "comment": "<p>updated and ready</p>"
      }
    }
  ]
}