Skip to content
bergie edited this page Mar 1, 2011 · 14 revisions

examples

Write request:

update: {
   '@': 'urn:uuid:GUID',
   a: 'mgd:midgard_article',
   title: 'Foo'
}
context: {
   login: 'admin',
   password: 'password',
   workspace: '/live/drafts'
}

##Response:

status: {
   code: 1,
   error: MGD_ERR_OK
}

Query request:

query: {
   'a': 'mgd:midgard_article',
   constraints: [
       {
           'title',
           'LIKE',
           'Fo%',
       }
   ],
   order: [
       {
           'metadata:created': 'desc'
       }
   ]
}
context: {
    workspace: '/live'
}

Response:

response: [
    {
       '@': 'urn:uuid:GUID',
       a: 'mgd:midgard_article',
       title: 'Foo'
   }
]

Connecting to a signal:

sub: {
   'a': 'midgard_article',
   'guid': null, // Any article object
   'signal': 'action-created'
}

In all these examples the protocol uses JSON-LD as the way to represent Midgard objects.

Clone this wiki locally