Export-API

Tjänsteguiden har ett API för att exportera ut hela informationen från Tjänsteguiden till externa system, t ex en egen webbsajt eller en aktiveringsportal
För att använda Export-API:et för tjänsteguiden måste ni teckna avtal med eklundh.com om licens till datat för Tjänsteguiden och hur det får användas.

Lathund för att börja använda API:et

api_svealand

Skicka in avtalet

Vi måste ha ett underskrivet avtal för det här API:et för att säkerställa kvalitén på information. Be att få ett avtal via supportloggen. Var noga med att ange organisationsnummer och firmatecknare
Screenshot2014-09-22105727

Lägg upp API-användare

Om ni inte redan har det så måste ni ha en API-användare upplagd i systemet. Skapa en via användarmodulen med de rätta kontaktuppgifterna till den som är tekniskt ansvarig för implementationen, det är via den här kontaktytan nyheter och förändringar kommer annonseras bland annat
Screenshot2014-09-22115113

Lägg upp API-rättigheter

I "API Credentials"-modulen så länkar ni den nya API-användare till en API-applikation (i det här fallet "Service Guide - Export")

Läs specifikationen

Sedan är det bara att läsa specifikationen och använda API:Et för att exportera

Methods
API Endpoint: Export
Export-API för hela Tjänsteguiden
Endpoint URL https://www.example.com/admin/edit/services/plain/api
Note that this API requires authenticated user id and IP address and a hashed api credential Note that this API requires authenticated user id and IP address and a hashed api credential
  • Method: list_categories

  • Parameters
    1 hash string green abcd Your login hash from api_login()
    2 target string green consumers consumers, companies, property, students, seniors
    Endpoint example:
    https://www.example.com/admin/edit/services/plain/api?method=list_categories&hash=abcd&target=consumers
  • success response


       <list_categories>
          <response>
             <categories>
                <category>
                   <name>Via fiber</name>
                   <id>39</id>
                </category>
                <category>
                   <name>Via telefonjacket</name>
                   <id>7</id>
                </category>
                <category>
                   <name>Via kabeltvnätet</name>
                   <id>92</id>
                </category>
                <category>
                   <name>Trådlöst</name>
                   <id>8</id>
                </category>
                <category>
                   <name>Telefoni Prio</name>
                   <id>3</id>
                </category>
                <category>
                   <name>Telefoni Standard</name>
                   <id>5</id>
                </category>
             </categories>
          </response>
          <status>success</status>
       </list_categories>
  • Method: list_offers

  • value is information about the value of the campaign
    valuemonthly the value of how much the monthly price is affected by the campaign
    valuemonthly_qualifier In what way the value is affected by valuemonthly, "amount" for specific value, "percentage" for a percentage of the original monthly price
    valuemonthly_type Decides how the price should be affected, "rebate" for a reduction, "addon" for an added value and "fixed price" if the value of valuemonthly is the new monthly price

    In the example output below, the monthly price of the service is 100 SEK during the offer period. If monthly, qualifier and type is set to "50", "percentage" and "rebate" then the monthly price of the service should be shown to be 50% cheaper than the original value.

    valueaddedvalue Used to signify if the offer provides an added value, and what that is in currency, such as a wifi-router.
    valuestart Used to set a new start fee that is active during the offer period
    valuecommitment And for commitment time
    valuequit And for quit time
  • Parameters
    1 hash string green abcd Your login hash from api_login()
    Endpoint example:
    https://www.example.com/admin/edit/services/plain/api?method=list_offers&hash=abcd
  • success response


       <list_offers>
          <response>
             <offers>
                <offer>
                   <id>9</id>
                   <headline>3 månader halva priset!</headline>
                   <shortheadline>3 månader halva priset!</shortheadline>
                   <shorttext>
    
                   </shorttext>
                   <text>Kampanj 3 månader halva priset....</text>
                   <url>http://www.bredband2.com</url>
                   <image>/media/modules/serviceimages/SNF/2011/01/13/10/kampanj.jpg</image>
                   <banner>/media/modules/serviceimages/SNF/2011/01/13/10/banner.jpg</banner>
                   <start>2012-01-31</start>
                   <stop>2012-12-31</stop>
                   <xsp>29933</xsp>
                   <link>/serviceguide/campaigns.php?id=9</link>
                   <value>
                      <monthly>100</monthly>
                      <monthly_qualifier>amount</monthly_qualifier>
                      <monthly_type>fixed price</monthly_type>
                      <monthly_period>3</monthly_period>
                      <addedvalue>777</addedvalue>
                      <start>120</start>
                      <commitment>3</commitment>
                      <quit>1</quit>
                   </value>
                   <services>
                      <service>
                         <id>195</id>
                      </service>
                      <service>
                         <id>196</id>
                      </service>
                      <service>
                         <id>198</id>
                      </service>
                      <service>
                         <id>207</id>
                      </service>
                      <service>
                         <id>212</id>
                      </service>
                      <service>
                         <id>216</id>
                      </service>
                   </services>
                </offer>
             </offers>
          </response>
          <status>success</status>
       </list_offers>
  • Method: list_services

  • Parameters
    1 hash string green abcd Your login hash from api_login()
    2 category int green 39 ID for category from list_categories()
    Endpoint example:
    https://www.example.com/admin/edit/services/plain/api?method=list_services&hash=abcd&category=39
  • success response


       <list_services>
          <response>
             <services>
                <service>
                   <name>10/10 Mbit/s + Telefoni Standard</name>
                   <id>8</id>
                </service>
                <service>
                   <name>30/30 Mbit/s + Telefoni Standard</name>
                   <id>9</id>
                </service>
                <service>
                   <name>100/10 Mbit/s + Telefoni Standard</name>
                   <id>10</id>
                </service>
             </services>
          </response>
          <status>success</status>
       </list_services>
  • Method: list_xsp

  • Parameters
    1 hash string green abcd Your login hash from api_login()
    Endpoint example:
    https://www.example.com/admin/edit/services/plain/api?method=list_xsp&hash=abcd
  • success response


       <list_xsp>
          <response>
             <providers>
                <xsp>
                   <id>26570</id>
                   <name>GameConnect</name>
                </xsp>
                <xsp>
                   <id>29910</id>
                   <name>Office IT-Partner</name>
                </xsp>
             </providers>
          </response>
          <status>success</status>
       </list_xsp>
  • Method: service_info

  • Service description, all information should be shown with the service

    informationxsp ID for the service provider, more info under xsp_info()
    informationlocal_information Local information about the service
    informationlocal_id Local ID for service in local provisioning system
    informationlink Link to the service in the Atlas Service guide.
  • Parameters
    1 hash string green abcd Your login hash from api_login()
    2 sid int green 42 ID for service from list_services()
    Endpoint example:
    https://www.example.com/admin/edit/services/plain/api?method=service_info&hash=abcd&sid=42
  • success response


       <service_info>
          <response>
             <information>
                <name>1/1 Mbit/s</name>
                <categories>39,1</categories>
                <xsp>31679</xsp>
                <speed>1/1 Mbit/s</speed>
                <local_information>
    
                </local_information>
                <local_id>
    
                </local_id>
                <link>/serviceguide/service.php?id=6</link>
                <created>2013-06-28 15:54:00</created>
                <activated>2013-07-03 14:43:00</activated>
                <updated>2013-10-14 22:07:00</updated>
             </information>
             <categories>
                <category>
                   <name>Via fiber</name>
                   <id>39</id>
                </category>
                <category>
                   <name>Internet</name>
                   <id>1</id>
                </category>
             </categories>
             <data>
                <monthly>
                   <value>134 kr</value>
                </monthly>
                <commitment>
                   <value>3 månader</value>
                </commitment>
                <description>
                   <value>Supersnabbt bredband till superpris!...</value>
                </description>
                <homepage>
                   <value>yes</value>
                </homepage>
                <mail>
                   <value>yes</value>
                   <comment>Total lagringskapacitet på 2GB. I tjänsten ingår ett grundskydd mot spam&virus</comment>
                </mail>
                <storage>
                   <value>no</value>
                </storage>
                <firewall>
                   <value>addon</value>
                   <comment>I samarbete med F-secure erbjuder vi Bahnhof Internet Security.(brandvägg och virusskydd)</comment>
                </firewall>
                <virus>
                   <value>addon</value>
                   <comment>I samarbete med F-secure erbjuder vi Bahnhof Internet Security.(brandvägg och virusskydd)</comment>
                </virus>
                <url>
                   <value>http://www.bahnhof.se/net/vasteras/net</value>
                </url>
                <start>
                   <value>199 kr</value>
                </start>
                <quit>
                   <value>1 månad</value>
                </quit>
                <order_email>
                   <value>order@bahnhof.se</value>
                </order_email>
             </data>
          </response>
          <status>success</status>
       </service_info>
  • Method: xsp_info

  • Basic information about the service provider, shown with their services. Some infromation is divided into several target categories

    baseimage URL to the service provider logo
    support array of all the support information for all target groups
    supportcompanycustomeropenhours (Ex.) open hours for custimer service for company services.
    invoices list of accepted invoice options to be presented to the customer
  • Parameters
    1 hash string green abcd Your login hash from api_login()
    2 xid int green 12 The XSP id from list_xsp()
    Endpoint example:
    https://www.example.com/admin/edit/services/plain/api?method=xsp_info&hash=abcd&xid=12
  • success response


       <xsp_info>
          <response>
             <base>
                <name>Bredband2</name>
                <image>/media/modules/memberpics/SNF/2013/09/23/14/fabriken2.png</image>
                <about>Bredband2</about>
                <order_email>bredband2@obc.bosscrm.se</order_email>
             </base>
             <support>
                <consumers>
                   <customer>
                      <phone>0770-81 10 00</phone>
                      <email>helpdesk@bredband2.com</email>
                      <fax>040-12 58 90</fax>
                      <openhours>
                         <mon_start>8</mon_start>
                         <mon_end>19</mon_end>
                         <tue_start>8</tue_start>
                         <tue_end>19</tue_end>
                         <wed_start>8</wed_start>
                         <wed_end>19</wed_end>
                         <thu_start>8</thu_start>
                         <thu_end>19</thu_end>
                         <fri_start>8</fri_start>
                         <fri_end>19</fri_end>
                         <sat_start>10</sat_start>
                         <sat_end>14</sat_end>
                         <sun_start>10</sun_start>
                         <sun_end>14</sun_end>
                      </openhours>
                   </customer>
                   <support>
                      <phone>0770-81 10 00</phone>
                      <email>helpdesk@bredband2.com</email>
                      <fax>040-12 58 90</fax>
                      <openhours>
                         <mon_start>8</mon_start>
                         <mon_end>19</mon_end>
                         <tue_start>8</tue_start>
                         <tue_end>19</tue_end>
                         <wed_start>8</wed_start>
                         <wed_end>19</wed_end>
                         <thu_start>8</thu_start>
                         <thu_end>19</thu_end>
                         <fri_start>8</fri_start>
                         <fri_end>19</fri_end>
                         <sat_start>10</sat_start>
                         <sat_end>14</sat_end>
                         <sun_start>10</sun_start>
                         <sun_end>14</sun_end>
                      </openhours>
                   </support>
                </consumers>
                <companies>
                   <customer>
                      <phone>0770-81 10 20</phone>
                      <email>sales@bredband2.com</email>
                      <fax>040-12 58 90</fax>
                      <openhours>
                         <mon_start>8</mon_start>
                         <mon_end>18</mon_end>
                         <tue_start>8</tue_start>
                         <tue_end>18</tue_end>
                         <wed_start>8</wed_start>
                         <wed_end>18</wed_end>
                         <thu_start>8</thu_start>
                         <thu_end>18</thu_end>
                         <fri_start>8</fri_start>
                         <fri_end>18</fri_end>
                      </openhours>
                   </customer>
                   <support>
                      <phone>0770-81 10 10</phone>
                      <email>foretag@bredband2.com</email>
                      <fax>040-12 58 90</fax>
                      <openhours>
                         <mon_start>8</mon_start>
                         <mon_end>18</mon_end>
                         <tue_start>8</tue_start>
                         <tue_end>18</tue_end>
                         <wed_start>8</wed_start>
                         <wed_end>18</wed_end>
                         <thu_start>8</thu_start>
                         <thu_end>18</thu_end>
                         <fri_start>8</fri_start>
                         <fri_end>18</fri_end>
                      </openhours>
                   </support>
                </companies>
                <property>
                   <customer>
                      <phone>0770-81 10 00</phone>
                      <email>helpdesk@bredband2.com</email>
                      <fax>040-12 58 90</fax>
                      <openhours>
                         <week_start>8</week_start>
                         <week_end>22</week_end>
                         <weekend_start>10</weekend_start>
                         <weekend_end>18</weekend_end>
                      </openhours>
                   </customer>
                   <support>
                      <phone>0770-81 10 00</phone>
                      <email>helpdesk@bredband2.com</email>
                      <fax>040-12 58 90</fax>
                      <openhours>
                         <week_start>8</week_start>
                         <week_end>22</week_end>
                         <weekend_start>10</weekend_start>
                         <weekend_end>18</weekend_end>
                      </openhours>
                   </support>
                </property>
             </support>
             <invoices>
                <invoice>
                   <name>Pappersfaktura</name>
                   <cost>39</cost>
                </invoice>
                <invoice>
                   <name>Autogiro</name>
                   <cost>0</cost>
                </invoice>
                <invoice>
                   <name>E-faktura via bank</name>
                   <cost>0</cost>
                </invoice>
                <invoice>
                   <name>Faktura via e-post</name>
                   <cost>19</cost>
                </invoice>
             </invoices>
          </response>
          <status>success</status>
       </xsp_info>