How to create the get method for the call

193 views Asked by At

I am studying and implementing an api and while following the examples,

Here is the example 1 :

curl -X POST \
-H "Content-Type: application/json" \
-H "QuickBlox-REST-API-Version: 0.1.0" \
-d '{"application_id": "2", "auth_key": "DtF9cZPqTF8Wy9Q", "timestamp": "1333630580", "nonce": "1340569516", "signature": "13293a5bd2026b957ebbb36c89d9649aae9e5503", "user": {"login": "injoit", "password": "injoit"}}' \
https://api.quickblox.com/session.json

For the above example i consructed my get method as

https://api.quickblox.com/session.json?token=re8d22c6e617133ffeadd761193a6c57d87bfb1a0f&application_id=23995&auth_key=CbRasu4Wftu25Qw&nonce=8796&timestamp=1434446627&signature=667ee2b448a5d3dd57d112afef3f84dd6c67e165

and it is working good.

But for the below example

curl -X POST \
-H "QuickBlox-REST-API-Version: 0.1.0" \
-H "QB-Token: 17f6a337b0656c9c7e983f9705d79562fc694c0e" \
-H "Content-Type: application/json" \
-d '{"push_token": {"environment": "production", "client_identification_sequence": "aa557232bc237245ba67686484efab"},
"device": {" platform": "iOS", "udid": "5f5930e927660e6e7d8ff0548b3c404a4d16c04f"}}' \
http://api.quickblox.com/push_tokens.json

How can i create the get method. As this has two main arrays i am little confused.

Can anyone help in creating how can i use this call ?

1

There are 1 answers

13
Rubycon On BEST ANSWER

It should be something like this:

https://api.quickblox.com/push_tokens.json?push_token[environment]=production&push_token[client_identification_sequence]=aa557232bc237245ba67686484efab&device[platform]=iOS&device[udid]=5f5930e927660e6e7d8ff0548b3c404a4d16c04f