Last active
December 10, 2015 23:30
-
-
Save bithavoc/4509605 to your computer and use it in GitHub Desktop.
Command with Fauna Sub Requests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// POST /commands result | |
{ | |
"resource" : { | |
"ref" : "commands/reply_message", | |
"ts" : 1357900098422864, | |
"name" : "reply_message", | |
"comment" : "Reply a Message", | |
"actions" : [ { | |
"method" : "POST", | |
"path" : "/v0/instances", | |
"body" : { | |
"class" : "message", | |
"data" : { | |
"body" : "$body" | |
} | |
} | |
}, { | |
"method" : "POST", | |
"path" : "/v0/classes/message/timelines/chat/", | |
"body" : { | |
"resource" : "${$0.resource.ref}" | |
} | |
} ], | |
"deleted" : false | |
}, | |
"references" : { } | |
} | |
// result: | |
{ | |
"error" : "Bad Request", | |
"param_errors" : { | |
"resource" : "Invalid resource ref." | |
} | |
} |
Notice how it's actually creating the resource:
\"ref\" : \"instances/22692978309988352\"
but it seems it couldn't find element "resource".... so I change it to:
"resource" : "$0.ref"
then it returns:
{
"error" : "Not Found"
}
This one is a little hard to debug, there is no detail in the error. Why is the reference not valid?
This is our fault. Fixing.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If I change it to:
Then the results is:
Now check my next comment...