Sample code

Introduction

This section provides sample code for using the MovieGlu APIs.

  • curl
  • PHP
  • More coming soon.

curl

This is probably the most basic way for you to return data from our API.  It basically allows you to send the request and http headers via a command line.

If you haven’t used curl before, here are a couple of good introductions:

and you can download it from here:

Syntax

curl "https://api-gate2.movieglu.com/filmsComingSoon/?n=1" -H "api-version: [VERSION]" -H "Authorization: [BASIC AUTHENTICATION]" -H "x-api-key: [API-KEY]" -H "device-datetime: [DATE-TIME]" -H "territory: [TERRITORY]" -H "client: [USERNAME]"

Example

Don’t forget to your own credentials – these are just sample credentials.

curl "https://api-gate2.movieglu.com/filmsNowShowing/?n=1" -H "api-version: v200" -H "Authorization: Basic A1B2c3D4E5f6H7I8j911M12=" -H "x-api-key: IyrBUDT7CuTTc6LH85mI5aAoG8" -H "device-datetime: 2018-09-26T10:45:30.147Z" -H "territory: UK" -H "client: NGIS_UK"

PHP

Our PHP sample code can be found in our public github repository:

https://github.com/movieglu/movieglu-code-samples/tree/master/php