Hoppa direkt till innehåll
Import to Marknadsdatabasen
FormatXML AuthLogin OriginStadsnät ConsumerMarknadsdatabasen
Endpoints
  • insert_posts
    ARRAY should be an array of arrays with PHP notation, as such: posts=MNCMSN&posts=Hallstahammar&posts=... where "post1" is the index of the post in the array.

    The array accepted can only contain a maximum of 100 arrays (posts) for each request. If you have 1000 posts to insert, you need to run this function 10 times. The API will return how many posts that validated and was thus entered to the database.

    Using "post###" (no spaces!) as the key for each array (post) in the request helps you understand possible error messages easier, if you have an internal ID for the data, it might be wise to use that (i.e. posts=MNCMSN)

    Each post is then handled the same way as via the insert_post() method, see further information in that method.

    Se example of using this method here
  • insert_post
    ARRAY should be an array with PHP notation, as such: data=MNCMSN&data=Hallstahammar...

    The array sent must follow the MdB2 specification
    All values is validated and an error will be returned if it doesn't validate and the post isn't accepted.
    All data is inserted into the DB as a new post or updates an already existing post depending on the data.

    Note that this method should NOT be used to update your entire database. It can be used for pushing up small changes to the database or to test the API, but never to update your entire database, it is a far too costly method to use, when uploading large amounts of data, always use insert_posts
  • empty_database
    Will empty the database connected to the site you execute the command on.