api

Atlas API

API

Anslutmotorns API kan användas för att exportera, importera och uppdatera adresser, samt att importera och uppdatera anmälningar.
Alla anrop till API:et sker via documentation AXA: Atlas XML API och rättigeheter måste läggas upp i API Credentials-modulen hos er för att använda den. Alla anrop ska innehålla information om vilken API-användare som anropar som då ska ha rätt IP-nummer i API Credentials-modulen.

Methods
API Endpoint: Anslutamotorn
API för att hantera adresser och anmälningar i Anslutamotorn
Endpoint URL http://www.example.com/admin/edit/connect/plain/api
Note that this API requires an authenticated user id and IP address Note that this API requires an authenticated user id and IP address

Use the API Credentials module in admin to set up API access for this module
  • Method: application_data

  • Parameters
    1 api_user int green 1234 The ID for the API user in Atlas
    2 id int green 1234 What application to display data for
    Example Query:
    http://www.example.com/admin/edit/connect/plain/api?method=application_data&api_user=1234&id=1234
  • success response


       <application_data>
          <response>
             <agreement>/villabilder//SNFDMO/2015/06/18/16/Inbjudan_BBB_2015_-_1502.pdf</agreement>
             <bankid>5</bankid>
          </response>
       </application_data>
  • Method: bankid_data

  • Parameters
    1 api_user int green 1234 The ID for the API user in Atlas
    2 id int green 1234 Which bankid transaction to show info for
    Example Query:
    http://www.example.com/admin/edit/connect/plain/api?method=bankid_data&api_user=1234&id=1234
  • success response


       <bankid_data>
          <response>
             <socialsecurity>XXXXXXXXXXXX</socialsecurity>
             <name>NAMN NAMNSSON</name>
             <ip>123.123.123.123</ip>
             <signature>PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGlu....</signature>
             <ocsp>MIIFVAoBAKCCBU0wggVJBgkrBgEFBQcwAQEEggU6M...</ocsp>
             <date>2015-08-11 17:00:27</date>
          </response>
       </bankid_data>
  • Method: empty_addresses

  • Information


    "mode" can be "all", "admin", "web", "import" or "api", which means:

    all: Remove all addresses in the database
    admin: Remove all addresses created by an administrator using the web interface
    web: Remove all addresses created by visitors
    import: Remove all addresses created by file import
    api: Remove all addresses created by the API

    Note, however, that if you remove all addresses and then import new ones via the API, all those will be marked as "api" addresses and will no longer be identified as an address created by a visitor, for example
  • Parameters
    1 api_user int green 1234 The ID for the API user in Atlas
    2 mode string green admin What posts to delete, valid values are "all", "admin", "web", "import", "api"
    Example Query:
    http://www.example.com/admin/edit/connect/plain/api?method=empty_addresses&api_user=1234&mode=admin
  • Method: export_addresses

  • Information


    This function only returns the URL for exporting the database as used in the admin section, but with an added parameter to include the local ID for every post, for using with insert_address and insert_addresses
  • Parameters
    1 api_user int green 1234 The ID for the API user in Atlas
    2 mode string green all What scope of addresses to export
    Example Query:
    http://www.example.com/admin/edit/connect/plain/api?method=export_addresses&api_user=1234&mode=all
  • Method: export_applications

  • Information


    This function only returns the URL for exporting the applications as used in the admin section, but with an added parameter to include the local ID for every post, for using with insert_application.
  • Parameters
    1 api_user int green 1234 The ID for the API user in Atlas
    Example Query:
    http://www.example.com/admin/edit/connect/plain/api?method=export_applications&api_user=1234
  • Method: insert_address

  • Information


    The array must follow the specification for the connection engine import function. However, you can add an "id" field to the data array to specify what post to update. The id of any given post is obtained via the search_address function. Without the id field, the address will always be added to the address database even if it is a duplicate.
    When using the api to create addresses, the "origin" field will be set to "api" always,
  • Parameters
    1 api_user int green 1234 The ID for the API user in Atlas
    2 data array green Array An array of the address
    Example Query:
    http://www.example.com/admin/edit/connect/plain/api?method=insert_address&api_user=1234&data=Array
  • Method: insert_addresses

  • Information


    The data is an array of posts, max 100 posts in the array. All posts must follow the specification, but as with insert_address, can also contain an "id" field for updating existing posts. Consult the MdB import function for an example of using a similar API call.
    This is a shorthand for using the insert_address up to 100 times, so all info for insert_address applies here as well.
  • Parameters
    1 api_user int green 1234 The ID for the API user in Atlas
    2 data array green Array An array of arrays of the addresses
    Example Query:
    http://www.example.com/admin/edit/connect/plain/api?method=insert_addresses&api_user=1234&data=Array
  • Method: insert_application

  • Information


    The array must follow the specification for the connection engine import function. The array will be matched to existing posts and update if a duplicate exists.
  • Parameters
    1 api_user int green 1234 The ID for the API user in Atlas
    2 data array green Array An array of the application
    Example Query:
    http://www.example.com/admin/edit/connect/plain/api?method=insert_application&api_user=1234&data=Array
  • Method: object_info

  • Parameters
    1 api_user int green 1234 The ID for the API user in Atlas
    2 id int green 1234 The object id (OID)
    Example Query:
    http://www.example.com/admin/edit/connect/plain/api?method=object_info&api_user=1234&id=1234
  • success response


       <object_info>
          <response>
             <id>8919</id>
             <name>Barkarö Södra</name>
             <type>residential area</type>
             <options>
                <showpercentage>yes</showpercentage>
                <showdiagram>yes</showdiagram>
                <geocode_source>google</geocode_source>
                <restricted_addresses>auto</restricted_addresses>
                <threshold>50</threshold>
                <thresholdtype>percentage</thresholdtype>
                <thresholdorigin>order</thresholdorigin>
                <map>automap</map>
             </options>
             <map>https://www.google.com/maps/d/embed?mid=ze_HdggdXgUs.kSdnlWax1TpI</map>
             <origin>ADMIN</origin>
             <uid>auto</uid>
             <bankid>yes</bankid>
             <price>26500</price>
             <directorder>no</directorder>
          </response>
          <status>success</status>
       </object_info>
  • Method: object_list

  • Parameters
    1 api_user int green XXXX API User ID with privileges
    Example Query:
    http://www.example.com/admin/edit/connect/plain/api?method=object_list&api_user=XXXX
  • success response


       <object_list>
          <response>
             <object>
                <id>8918</id>
                <name>Västerås City</name>
                <type>residential area</type>
             </object>
             <object>
                <id>8919</id>
                <name>Barkarö Södra</name>
                <type>residential area</type>
             </object>
          </response>
          <status>success</status>
       </object_list>
  • Method: search_address

  • Information


    The search is always a direct search, searching for "Storgatan 2" and mode "address" will only show matches where address is exactly "Storgatan 2". This search function will never return more than 100 matches
  • Parameters
    1 api_user int green 1234 The ID for the API user in Atlas
    2 search string green Arholmagatan 12 The term to search for
    3 field string green address What to search, possible values are "address", "building" and "streetname"
    Example Query:
    http://www.example.com/admin/edit/connect/plain/api?method=search_address&api_user=1234&search=Arholmagatan+12&field=address
  • success response


       <search_address>
          <response>
             <matches>
                <post_1234>
                   <id>1234</id>
                   <oid>8918</oid>
                   <origin>import</origin>
                   <streetname>Annedalsgatan</streetname>
                   <streetnumber>4</streetnumber>
                   <address>Annedalsgatan 4</address>
                   <building>Annedal 2</building>
                   <zip>72460</zip>
                   <city>Stockholm</city>
                </post_1234>
             </matches>
          </response>
          <status>success</status>
       </search_address>
  • Method: search_application

  • Parameters
    1 api_user int green 1234 The ID for the API user in Atlas
    2 search string green Johan Bylund The term to search for
    3 field string green name What to search, possible values are "address", "building", "streetname", and "name"
    Example Query:
    http://www.example.com/admin/edit/connect/plain/api?method=search_application&api_user=1234&search=Johan+Bylund&field=name
  • success response


       <search_application>
          <response>
             <matches>
                <post_101841>
                   <id>101841</id>
                   <name>Johan Bylund</name>
                   <oid>8921</oid>
                   <streetname>Storgatan</streetname>
                   <streetnumber>31</streetnumber>
                   <streetletter>B</streetletter>
                   <premise>1023</premise>
                   <phone>08-12 34 56</phone>
                   <cell>070-123 45 67</cell>
                   <email>johan@stadsnatet.se</email>
                   <status>interest</status>
                   <date>2014-09-03</date>
                   <building>Storis 15:169</building>
                   <comment>Jag vill ha!</comment>
                   <origin>admin</origin>
                   <substatus>waiting</substatus>
                </post_101841>
             </matches>
          </response>
          <status>success</status>
       </search_application>
#inlineditbutton