Graypen API Documentation

Get Company Details

The following API enables you to get information about the group company including the subsidiaries.

GET http://api.graypen.com/v1/companies/{optional_company_id}

When specifying the optional company identifier the response will simply contain data for this one company.

Response

Please note that the logos returned are types, you can retrieve the actual raw logo data by calling the API as per below. The available types are:

GET http://api.graypen.com/v1/company_logo/{company_id}/{type_id}/{optional_string_download}

When you specify the string "download" as the optional final parameter, the logo will be downloaded rather than inline displayed.

          {
  "id": "GPN",
  "name": "Graypen Group",
  "telephone": "",
  "email": "",
  "strapline": "",
  "domain": "",
  "company_registration_number": "",
  "description": "",
  "logo_types_available": [],
  "promotion_button": {
    "name": "24 Hour Support",
    "telephone": "+44 (0) 1469 565025",
    "email": "[email protected]",
    "description": "Lorem ipsum dolor sit amet",
    "logo_type": ""
  },
  "companies": [
    {
    "id": "GRA",
    "name": "Graypen",
    "telephone": "+44 (0)1469 565000",
    "email": "[email protected]",
    "strapline": "",
    "domain": "",
    "company_registration_number": "",
    "description": "Graypen Limited",
    "logo_types_available": [
      "light_hor",
      "light_ver"
    ],
    "promotion_button": {
      "name": "24 Hour Support",
      "telephone": "+44 (0) 1469 565025",
      "email": "[email protected]",
      "description": "Lorem ipsum dolor sit amet",
      "logo_type": "promotion"
      }
    },
    {
    "id": "GPS",
    "name": "GP Shipping",
    "telephone": "+44 (0)1469 565000",
    "email": "[email protected]",
    "strapline": "",
    "domain": "",
    "company_registration_number": "",
    "description": "",
    "logo_types_available": [],
    "promotion_button": {
      "name": "24 Hour Support",
      "telephone": "+44 (0) 1469 565025",
      "email": "[email protected]",
      "description": "Lorem ipsum dolor sit amet",
      "logo_type": ""
      }
    }
  ]
}
        

Get Location Details

Retrieve the locations handled by the given company identifier. The search term is optional and will allow you to filter down the result set.

GET http://api.graypen.com/v1/locations/{company_id}/{optional_search_term}

Alternatively you can retrieve a list of locations handling services for a company by running the below API call.

GET http://api.graypen.com/v1/locations_by_service/{company_id}/{service_id}/{optional_search_term}

Response

Each object contains a locations and teams array. This will allow us to append our global coverage HUB team onto location searches that might not be covered by any of our regular offices.
The API calls performed to retrieve either location or team data are different

          [
  {
    "group_name": "Belgium",
    "locations": [
      {
        "id": 29,
        "location": "Antwerpen"
      },
      {
        "id": 31,
        "location": "Zeebrugge"
      }
    ],
    "teams": []
  },
  {
    "group_name": "Ireland",
    "locations": [
      {
        "id": 27,
        "location": "Bantry"
      }
    ],
    "teams": []
  },
  {
    "group_name": "Global Coverage",
    "locations": [],
    "teams": [
      {
        "id": 11,
        "name": "Tanker Hub Agency"
      }
    ]
  }
]
        


You can also retrieve a list of locations where the ports handled are grouped per said location. The result set is ordered by country with the most locations.
Head offices are displayed first within the country followed by the other locations in alphabetical order.

GET http://api.graypen.com/v1/locations_grouped/{company_id}

Response

          [
  {
    "group_name": "United Kingdom",
    "locations": [
      {
        "id": 1,
        "location": "Immingham",
        "address": "",
        "head_office": true,
        "lat": 53.616052,
        "lng": -0.186006,
        "ports": [
          "Grimsby",
          "Immingham",
          "King's Lynn",
          "South Killingholme",
          "Tetney Terminal"
        ]
      },
      {
        "id": 11,
        "location": "Avonmouth",
        "address": "",
        "head_office": false,
        "lat": 0,
        "lng": 0,
        "ports": [
          "Avonmouth",
          "Portbury",
          "Sharpness",
          "Swansea"
        ]
      }
    ]
  }
]
        

Get Service Details

Retrieve the services provided by the given company identifier. The location identifier is optional and will filter down the result set.

GET http://api.graypen.com/v1/services/{company_id}/{optional_location_id}

Alternatively, you can select just one single service via the API call below:

GET http://api.graypen.com/v1/service/{service_id}

Response

You can retrieve the service icon using the below API call when boolean "icon_present" is true.

GET http://api.graypen.com/v1/service_icon/{service_id}/{optional_string_download}

When you specify the string "download" as the optional final parameter, the icon will be downloaded rather than inline displayed.

          [
  {
    "id": 7,
    "name": "Customs",
    "description": "",
    "icon_present": true,
    "icon_extension": "svg",
    "generic_telephone": "",
    "generic_email": ""
  },
  {
    "id": 5,
    "name": "Hub Agency",
    "description": "",
    "icon_present": false,
    "icon_extension": "",
    "generic_telephone": "",
    "generic_email": ""
  },
  {
    "id": 6,
    "name": "Husbandry",
    "description": "",
    "icon_present": false,
    "icon_extension": "",
    "generic_telephone": "",
    "generic_email": ""
  },
  {
    "id": 4,
    "name": "Port Agency",
    "description": "",
    "icon_present": true,
    "icon_extension": "png",
    "generic_telephone": "",
    "generic_email": ""
  }
]
        

Get Team Details

Retrieve the team information. The location and service identifiers are optional but they have to be specified. Leave as 0 when not in required.
It's possible for multiple teams to be returned!

GET http://api.graypen.com/v1/teams/{company_id}/{location_id}/{service_id}

Alternatively you can retrieve a single team's data by running the below API call.

GET http://api.graypen.com/v1/team_by_id/{team_id}

Response

You can retrieve the person's avatar using the below API call when boolean "avatar_present" is true.

GET http://api.graypen.com/v1/person_avatar/{person_id}/{optional_string_download}

When you specify the string "download" as the optional final parameter, the avatar will be downloaded rather than inline displayed.

          [
  {
    "id": 11,
    "name": "Tanker Team",
    "telephone": "+44 (0) 01469 565025",
    "email": "[email protected]",
    "description": "In response to the increasing demands of our customers for improved operational efficiencies and financial savings Graypen has created a dedicated Husbandry Services Team.",
    "address": "The Bridge\r\nOne Graypen Way\r\nQueens Road\r\nImmingham\r\nDN40 1QN\r\nUnited Kingdom",
    "members": [
      {
        "id": 1,
        "firstname": "Adam",
        "lastname": "Cooper",
        "position": "Senior Ships Agent",
        "avatar_present": false
      },
      {
        "id": 2,
        "firstname": "Robert",
        "lastname": "Dickie",
        "position": "Business Analyst",
        "avatar_present": false
      },
      {
        "id": 3,
        "firstname": "Scott",
        "lastname": "Kelly",
        "position": "General Manager - 24/7 Hub Agency, EU-ACD and Ship-to-Ship Operations",
        "avatar_present": true
      }
    ]
  }
]
        


You can also get a list of all team members on the system, this list is currently used on the About Us page.

GET http://api.graypen.com/v1/team_members/{company_id}

Response

          [
    {
      "id": 820,
      "firstname": "Adam",
      "lastname": "Cooper",
      "location": "Immingham",
      "position": "Senior Ships Agent",
      "email": "[email protected]",
      "telephone": "00441469565025",
      "mobile": "",
      "avatar_present": true,
      "social": [
        {
          "name": "Ice",
          "value": "adamcooper8"
        }
      ],
      "teams": [
        {
          "name": "Tanker Team",
          "flattened": "tankerteam"
        }
      ]
    },
    {
      "id": 8801,
      "firstname": "Adam",
      "lastname": "Ross",
      "location": "Grangemouth",
      "position": "Operations Co-Ordinator",
      "email": "[email protected]",
      "telephone": "00441324318033",
      "mobile": "",
      "avatar_present": true,
      "social": [],
      "teams": [
        {
          "name": "Tanker Team",
          "flattened": "tankerteam"
        }
      ]
    }
  ]
        

Get News

Retrieve the news articles by the given company identifier.

GET http://api.graypen.com/v1/news/{company_id}/{optional_page_number}

Alternatively you can retrieve a single news article by running the below API call.

GET http://api.graypen.com/v1/news_by_slug/{company_id}/{slug}

Response

          {
  "previous_page": 0,
  "next_page": 1,
  "current_page": 0,
  "total_items": 242,
  "items_per_page": 10,
  "items": [
    {
      "category_slug": "events",
      "category_title": "Events",
      "category_description": "The latest shipping industry news & events from Graypen tanker agency.",
      "slug": "london-tanker-ops-party-(ltops)",
      "title": "London Tanker Ops Party (LTOPS)",
      "description": "<br />
<p>Graypen hosted its annual Pre-LTops drinks reception in London on Friday 27th January, 2017.</p><br />
<p>This gathering has now become a traditional part of the shipping calendar in the run up to LTops and one which is highly anticipated by our friends and supporters.</p><br />
<p>We are delighted to say this year it was a bigger than ever success with over 125 friends, colleagues and business associates in attendance who all enjoyed a fantastic evening, prior to moving on to the main evening event.</p><br />
<p>Philip Johnson, Graypen Group Director said;<br /><br />
	<span style="font-size: 14.4px;">"Everyone had a great time and were in high spirits, it was a pleasure to see so many in attendance. The market has been tough for many people in 2016, therefore, we feel this gesture from our side is upheld as it is importantly our way of saying 'Thank You' for all the fantastic support that we receive in UK and ARA Ports.</span></p>",
      "created_at": "2017-01-27 10:24:00",
      "created_by": "",
      "modified_at": "",
      "modified_by": ""
    },
    {
      "category_slug": "port",
      "category_title": "Port",
      "category_description": "The latest shipping industry news & events from Graypen tanker agency.",
      "slug": "underwater-cleaning-has-returned-to-portland",
      "title": "Underwater cleaning has returned to Portland",
      "description": "<br />
<p>We are pleased to advise that Sea Tech Commercial Divers carried out the first hull clean at Portland on the mv ‘Aragonborg’ on 26th November. The operation progressed quickly and smoothly and the vessel sailed to her next port the same day. Following on from cleaning of the vessel’s sides the Master reported a significant improvement in vessel’s performance and reduction in fuel consumption.</p><br />
<p>For more information and quotations for hull cleaning and propeller polishing please email [email protected]</p><br />
<p><img src="http://www.graypen.com//graypen/media/blog/aragonborghullcleaningatportland1116.jpg" title="" alt="" /><br /><br />
	</p>",
      "created_at": "2017-01-16 10:30:00",
      "created_by": "",
      "modified_at": "",
      "modified_by": ""
    }
  ]
}