I have a Flask webapp, that, when called, returns the following JSON:


I need to construct an Oraclize query, so that it returns the Id string, and the 6 elements of the struct array.

when querrying json(http://QUERY_LINK).["id", "struct"] I am getting a string, since that's what I have specified in the callback function.

A callback function then needs to assign the values to global vars:

 function __callback(bytes32 myId, string result) {
        if (msg.sender != oraclize_cbAddress()) revert();

        id = RESULT_STRINGID

        one = RESULT_STRUCT_1
        two = RESULT_STRUCT_2
        three = RESULT_STRUCT_3
        four = RESULT_STRUCT_4
        five = RESULT_STRUCT_5
        six = RESULT_STRUCT_6

Can't figure out how to make this work. What would be the best way?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.