  Context. Observations of the effect of microlensing in gravitationally lensed
quasars could potentially be used to study the structure of the source on
distance scales down to the size of the supermassive black hole powering the
quasar activity.
  Aims. We search for the microlensing effect in the gamma-ray band using the
signal from a gravitationally lensed blazar B0218+357.
  Methonds. We develop a method of deconvolution of contributions of two images
of the source into the gamma-ray band flaring lightcurve. We use this method to
study the evolution of the magnification factor ratio between the two images
throughout the flaring episodes. We interpret the time variability of the ratio
as a signature of the microlensing effect and derive constraints on the
physical parameters of the gamma-ray source by comparing the observed
variability properties of the magnification factor ratio with those derived
from numerical simulations of the microlensing caustics networks.
  Results. We find that the magnification factor ratio has experienced a change
characteristic for a microlensing caustic crossing event during a 100 d flaring
period in 2012. It has further changed between 2012 and a recent flaring
episode in 2014. We use the measurement of the maximal magnification and
duration of the caustic crossing event to derive an estimate of the projected
size of the gamma-ray emission region in B0218+357, $R_\gamma \sim 10^{14}$ cm.
This estimate is compatible with a complementary estimate found from the
minimal variability time scale. The microlensing / minimal variability time
scale measurements of the source size suggest that the gamma-ray emission is
produced at the base of the blazar jet, in the direct vicinity of the central
supermassive black hole.
