--
You received this message because you are subscribed to the Google Groups "Hypermedia Web" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hypermedia-we...@googlegroups.com.
To post to this group, send email to hyperme...@googlegroups.com.
Visit this group at https://groups.google.com/group/hypermedia-web.
--
$ pip install coreapi
[...]
Successfully installed coreapi-1.11.4
$ coreapi get https://api-sandbox.foxycart.com
<Error>
errors: [
{
logref: "id-1453305072"
message: "The FOXY-API-VERSION request header is required in order to use the API. Please include the following header with all requests: FOXY-API-VERSION: 1"
}
]
total: 1
$ coreapi headers add FOXY-API-VERSION 1 # Add a custom header to all outgoing requests.
Added header
Foxy-Api-Version: 1
$ coreapi get https://api-sandbox.foxycart.com
<Your API starting point. "https://api-sandbox.foxycart.com/">
message: "Welcome to the FoxyCart API! Our hope is to be as self-documenting and RESTful as possible. Please let us know if you have any questions by posting in our forum http://forum.foxycart.com or emailing us at help...@foxycart.com. As a last resort, you could read the documentation at http://wiki.foxycart.com. Your first action should be to create an OAuth Client, then a user, followed by a store."
create_client()
property_helpers()
rels()
token()
$ coreapi bookmarks add foxycart # Let's add a bookmark so it's easier to get back to.
Added bookmark
foxycart
$ coreapi action create_client # Try to follow this link.
<Error>
errors: [
{
logref: "id-1453305175"
message: "No route found for \"GET /clients\": Method Not Allowed (Allow: OPTIONS, POST)"
}
]
total: 1
$ coreapi action create_client --action post # HAL doesn't include the action information, so we specify it explicitly.
<Error>
errors: [
{
logref: "id-1453305183"
message: "redirect_uri can't be blank, redirect_uri is too short (minimum is 1 characters)"
},
{
logref: "id-1453305183"
message: "project_name can't be blank, project_name is too short (minimum is 1 characters)"
},
{
logref: "id-1453305183"
message: "company_name can't be blank, company_name is too short (minimum is 1 characters)"
},
{
logref: "id-1453305183"
message: "contact_name can't be blank, contact_name is too short (minimum is 1 characters)"
},
{
logref: "id-1453305183"
message: "contact_email can't be blank, contact_email is too short (minimum is 1 characters), contact_email is not a valid email address."
},
{
logref: "id-1453305183"
message: "contact_phone can't be blank, contact_phone is too short (minimum is 1 characters)"
}
]
total: 6
$ coreapi action create_client -a post -p redirect_uri=http://example.com/redirect -p project_name=example -p company_name=example -p contact_name=tom -p contact_email=t...@example.com -p contact_phone=123 # Specify several parameters. Use --param for more verbose style.
<This Client "https://api-sandbox.foxycart.com/clients/3731">
message: "client 3731 created successfully."
token: {
access_token: "***"
expires_in: 7200
refresh_token: "***"
scope: "client_full_access"
token_type: "Bearer"
}
attributes()
$ coreapi credentials add api-sandbox.foxycart.com "Bearer ***" # Add an Authorization header, for all requests to this domain.
Added credentials
api-sandbox.foxycart.com "Bearer ***"
$ coreapi bookmarks get foxycart # Go back to our bookmarked URL.
<Your API starting point. "https://api-sandbox.foxycart.com/">
message: "Welcome to the FoxyCart API! Our hope is to be as self-documenting and RESTful as possible. Please let us know if you have any questions by posting in our forum http://forum.foxycart.com or emailing us at help...@foxycart.com. As a last resort, you could read the documentation at http://wiki.foxycart.com. Your first action should be to create an OAuth Client, then a user, followed by a store."
client()
create_user()
property_helpers()
rels()
reporting()
token()