Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Information Request: Format for Import Data #17

Closed
misilot opened this issue Apr 3, 2014 · 1 comment
Closed

Information Request: Format for Import Data #17

misilot opened this issue Apr 3, 2014 · 1 comment
Assignees

Comments

@misilot
Copy link

misilot commented Apr 3, 2014

Hi,

We have an excel file with past data, that I would be interesting in entering into Suma. I was just wondering if there is an example (I may have missed it), of what the data should look like, when being put into the "Direct JSON Import" link.

Thanks!

Tom

@cazzerson
Copy link
Collaborator

Hi Tom,

I'm sorry, but this isn't documented anywhere yet. Thanks for pointing that out. I'll be putting something together soon, but the format is the same as the one that is used by the Suma client. Here is an example:

{
  "device": "iPad",
  "version": "1.1.0",
  "sessions": [
    {
      "initiativeID": "4",
      "startTime": 1396875911,
      "endTime": 1396875975,
      "counts": [
        {
          "timestamp": 1396875922,
          "number": 1,
          "location": 8,
          "activities": [
            8,
            12,
            16,
            70,
            11
          ]
        },
        {
          "timestamp": 1396875940,
          "number": 1,
          "location": 8,
          "activities": [
            16,
            10,
            14
          ]
        },
        {
          "timestamp": 1396875961,
          "number": 1,
          "location": 12,
          "activities": [
            8,
            12,
            16
          ]
        },
        {
          "timestamp": 1396875973,
          "number": 1,
          "location": 12,
          "activities": [
            12,
            69,
            70,
            17,
            10
          ]
        }
      ]
    }
  ]
}

As you can see, the counts need to be wrapped in a session. You can choose the session startTime and endTime that you think is most appropriate for the imported data. Normally this corresponds to the start and end of data collection.

You could also try imitating the client and submitted the data to the server directly. Drop me a line if I can help.

http://www.lib.ncsu.edu/staff/jmcasden/

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants