Skip to content

Instantly share code, notes, and snippets.

@dbulgakov
Last active April 8, 2017 16:58
Show Gist options
  • Select an option

  • Save dbulgakov/9fc0906ab36ab8fcc9d321a14cf8039d to your computer and use it in GitHub Desktop.

Select an option

Save dbulgakov/9fc0906ab36ab8fcc9d321a14cf8039d to your computer and use it in GitHub Desktop.
JSON example
Request
POST api/registration
json body:
{
user_name : "Ivan",
user_email : "[email protected]",
user_password : "1234qwerQWER"
}
Response
json body:
{
status_code : 200,
message : "Registration success"
}
=================================================================
Request
POST api/login
json body:
{
user_email : "[email protected]",
user_password : "1234qwerQWER"
}
Response
json body:
{
status_code : 200,
message : "Login success",
"data" :
{
user_token : "ASMDLFMLKaksfmmkqmwkleOREOEORO2M340019MASDFWQEJRJQWRE19MADSKFMKADSFMK2"
}
}
=================================================================
Request
GET api/conferences?cityId=123page=1&lang=ru // 1 page = 20 conferences
+ user token in header
Response
json body:
{
status_code : 200,
message : "OK",
"data" :
{
conferences :
[
{
title : "Some conf title"
description : "Short description"
start_date : "12.05.2017"
end_date : "14.05.2017"
conference_id : 123456
attendees : "500-1000"
},
{
title : "Some conf title2"
description : "Short description2"
start_date : "13.05.2017"
end_date : "13.05.2017"
conference_id : 123457
attendees : "<100"
}
],
pages : 10
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment