<commit_before># CURL Examples

# Index

* [CURL Examples](#curl-examples)
* [Index](#index)
* [Accounts](#accounts)
  * [Users](#users)
    * [Create User](#create-user)
    * [Get Me](#get-me)
    * [Update User](#update-user)

# Accounts

## Users

### Create User

Example request:

```
curl --compressed -v localhost:8080/v1/accounts/users \
	-H "Content-Type: application/json" \
	-u test_client:test_secret \
	-d '{
		"email": "<EMAIL>",
		"password": "<PASSWORD>"
	}'
```

Example response:

```json
{
	"_links": {
		"self": {
			"href": "/v1/accounts/users/1"
		}
	},
	"id": 1,
	"email": "<EMAIL>",
	"first_name": "",
	"last_name": "",
	"role": "user",
	"created_at": "2015-12-17T06:17:54Z",
	"updated_at": "2015-12-17T06:17:54Z"
}
```

### Get Me

Example request:

```
curl --compressed -v localhost:8080/v1/accounts/users/me \
	-H "Content-Type: application/json" \
	-H "Authorization: Bearer 00ccd40e-72ca-4e79-a4b6-67c95e2e3f1c"
```

Example response:

```json
{
	"_links": {
		"self": {
			"href": "/v1/accounts/users/1"
		}
	},
	"id": 1,
	"email": "<EMAIL>",
	"first_name": "",
	"last_name": "",
	"role": "user",
	"created_at": "2015-12-17T06:17:54Z",
	"updated_at": "2015-12-17T06:17:54Z"
}
```

### Update User

Example request:

```
curl -XPUT --compressed -v localhost:8080/v1/accounts/users/1 \
	-H "Content-Type: application/json" \
	-H "Authorization: Bearer 00ccd40e-72ca-4e79-a4b6-67c95e2e3f1c" \
	-d '{
		"email": "test@user_updated",
		"first_name": "test_first_name_updated",
		"last_name": "test_last_name_updated",
	}'
```

Example response:

```json
{
	"_links": {
		"self": {
			"href": "/v1/accounts/users/1"
		}
	},
	"id": 1,
	"email": "test@user_updated",
	"first_name": "test_first_name_updated",
	"last_name": "test_last_name_updated",
	"role": "user",
	"created_at": "2015-12-17T06:17:54Z",
	"updated_at": "2015-12-18T07:09:15Z"
}
```
<commit_msg>Updated docs.<commit_after># CURL Examples

# Index

* [CURL Examples](#curl-examples)
* [Index](#index)
* [Accounts](#accounts)
  * [Users](#users)
    * [Create User](#create-user)
    * [Get Me](#get-me)
    * [Update User](#update-user)

# Accounts

## Users

### Create User

Example request:

```
curl --compressed -v localhost:8080/v1/accounts/users \
	-H "Content-Type: application/json" \
	-u test_client:test_secret \
	-d '{
		"email": "<EMAIL>",
		"password": "<PASSWORD>"
	}'
```

Example response:

```json
{
	"_links": {
		"self": {
			"href": "/v1/accounts/users/1"
		}
	},
	"id": 1,
	"email": "<EMAIL>",
	"first_name": "",
	"last_name": "",
	"role": "user",
	"confirmed": false,
	"created_at": "2015-12-17T06:17:54Z",
	"updated_at": "2015-12-17T06:17:54Z"
}
```

### Get Me

Example request:

```
curl --compressed -v localhost:8080/v1/accounts/users/me \
	-H "Content-Type: application/json" \
	-H "Authorization: Bearer <PASSWORD>"
```

Example response:

```json
{
	"_links": {
		"self": {
			"href": "/v1/accounts/users/1"
		}
	},
	"id": 1,
	"email": "<EMAIL>",
	"first_name": "",
	"last_name": "",
	"role": "user",
	"confirmed": false,
	"created_at": "2015-12-17T06:17:54Z",
	"updated_at": "2015-12-17T06:17:54Z"
}
```

### Update User

Example request:

```
curl -XPUT --compressed -v localhost:8080/v1/accounts/users/1 \
	-H "Content-Type: application/json" \
	-H "Authorization: Bearer <PASSWORD>e2e3f1c" \
	-d '{
		"email": "<EMAIL>_<EMAIL>",
		"first_name": "test_first_name_updated",
		"last_name": "test_last_name_updated",
	}'
```

Example response:

```json
{
	"_links": {
		"self": {
			"href": "/v1/accounts/users/1"
		}
	},
	"id": 1,
	"email": "<EMAIL>_<EMAIL>",
	"first_name": "test_first_name_updated",
	"last_name": "test_last_name_updated",
	"role": "user",
	"confirmed": false,
	"created_at": "2015-12-17T06:17:54Z",
	"updated_at": "2015-12-18T07:09:15Z"
}
```

{'fraction_non_alphanumeric': 0.23070824524312897, 'fraction_numerical': 0.06791754756871037, 'mean_word_length': 4.114864864864865, 'pattern_counts': {'":': 73, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '757419', 'n_tokens_mistral': 1867, 'n_tokens_neox': 1636, 'n_words': 271}