Skip to content

Communication Ads

Yoli uses the Communication Ads api to provide the functionality to switch phone contracts. These come either bundled with a phone or not.

The api provides really detailed filtering options and data about the offers. You should decide how much of them is necessary to provide a good user experience.

Error handling

The only error that is expected to occur is an internal server error when comads is down.

Phone plans

You can use the comAdsPhonePlans query to search for available plans.

There are a number of filtering options available, a few common one are shown below.

{
  comAdsPhonePlans(input: {limit: 1, minDataVolume: 10000, noSetupFee: true, withLTE: true, networks: [O2]}) {
    name
    company {
      name
    }
    cost {
      setup
    }
    networkProvider {
      name
    }
    dataDetails {
      volume
    }
    link
  }
}

```json
{
  "data": {
    "comAdsPhonePlans": [
      {
        "name": "LTE 10000",
        "company": {
          "name": "rainbow"
        },
        "cost": {
          "setup": 0
        },
        "networkProvider": {
          "name": "o2"
        },
        "dataDetails": {
          "volume": "10 GB"
        },
        "link": "https://www.communicationads.net/tc.php?t=10811C10807004D&product=3987&subid=0S5c0d3f69ea22f112deee3b34"
      }
    ]
  }
}

Use the link to link out the user to the page where the contract will actually be switched.

Phone plan & device bundles

The user bundle query comAdsPhoneBundles query is similar to the query for just phone plans. However there are a few extra options to filter for devices and/or manufacturers of devices.

The comAdsManufacturers and comAdsDevices can be used to build a search for all available ones.

Query all available devices:

{
  comAdsDevices {
    name
    id
  }
}
{
  "data": {
    "comAdsDevices": [
      {
        "name": "Rainbow Bowphone 123o",
        "id": 1
      },
      ...
    ]
  }
}

Query all available manufacturers:

{
  comAdsManufacturers {
    name
    id
  }
}
{
  "data": {
    "comAdsManufacturers": [
      {
        "name": "Rainbow",
        "id": 1
      },
      ...
    ]
  }
}

You can then use the ids in the comAdsPhoneBundles query

{
  comAdsPhoneBundles(input: {deviceGroupIds: [1, 7]}) {
    device {
      name
    }
    link
  }
}

A device group is the id of a manufacturer.

{
  "data": {
    "comAdsPhoneBundles": [
      {
        "device": {
          "name": "Rainbow Bowphone 123o"
        },
        "link": "https://www.communicationads.net/tc.php?t=aaaaaaaa&deeplink=bundle&product=bbbbbb&subid=ccccccccc"
      },
      ...
    ]
  }
}