<commit_before>Create Tag
=======================


----------------------------------------

1. [Purpose][purpose]
1. [Endpoint][endpoint]
1. [Parameters][parameters]
1. [Examples][examples]
  * [Command line][example-cli]
  * [PHP][example-php]
1. [Response][response]
  * [Sample][sample]

----------------------------------------

<a name="purpose"></a>
### Purpose of the Create Tag API

Use this API to create a tag.

----------------------------------------

<a name="endpoint"></a>
### Endpoint

_Authentication: required_

    POST /tag/create.json

<a name="parameters"></a>
### Parameters

1.  tag (required), The name of the tag to create
1.  count (optional), Number of photos which contain this tag
1.  email (optional), An email address that corresponds to this tag
1.  latitude (optional), _i.e. 34.76_ - A decimal representation of latitude.
1.  longitude (optional), _i.e. -87.45_ - A decimal representation of longitude.

----------------------------------------

<a name="examples"></a>
### Examples

<a name="example-cli"></a>
#### Command Line (using [openphoto-php][openphoto-php])

    ./openphoto -p -X POST -h current.openphoto.me -e /tag/create.json -F 'tag=sunnyvale' -F 'count=10'

<a name="example-php"></a>
#### PHP (using [openphoto-php][openphoto-php])

    $client = new OpenPhotoOAuth($host, $consumerKey, $consumerSecret, $oauthToken, $oauthTokenSecret);
    $response = $client->post("/tag/create.json", array('tag' => 'sunnyvale', 'count' => 10));

----------------------------------------

<a name="response"></a>
### Response

The response is in a standard [response envelope](http://theopenphotoproject.org/documentation/api/Envelope).

* _message_, A string describing the result. Don't use this for anything but reading.
* _code_, _200_ on success
* _result_, A [Tag][Tag] object or FALSE on error

<a name="sample"></a>
#### Sample

    {
      "message":"",
      "code":200,
      "result":
      {
        "id": "mountain",
        "count": 1
      }
    }


[Tag]: http://theopenphotoproject.org/documentation/schemas/Tag
[purpose]: #purpose
[endpoint]: #endpoint
[parameters]: #parameters
[examples]: #examples
[example-cli]: #example-cli
[example-php]: #example-php
[response]: #response
[sample]: #sample
[openphoto-php]: https://github.com/photo/openphoto-php
<commit_msg>Edited documentation for tag creation api<commit_after>Create Tag
=======================


----------------------------------------

1. [Purpose][purpose]
1. [Endpoint][endpoint]
1. [Parameters][parameters]
1. [Examples][examples]
  * [Command line][example-cli]
  * [PHP][example-php]
1. [Response][response]
  * [Sample][sample]

----------------------------------------

<a name="purpose"></a>
### Purpose of the Create Tag API

Use this API to create a tag.

----------------------------------------

<a name="endpoint"></a>
### Endpoint

_Authentication: required_

    POST /tag/create.json

<a name="parameters"></a>
### Parameters

1.  tag (required), The name of the tag to create
1.  count (optional), Number of photos which contain this tag
1.  email (optional), An email address that corresponds to this tag
1.  latitude (optional), _i.e. 34.76_ - A decimal representation of latitude.
1.  longitude (optional), _i.e. -87.45_ - A decimal representation of longitude.

----------------------------------------

<a name="examples"></a>
### Examples

<a name="example-cli"></a>
#### Command Line (using [openphoto-php][openphoto-php])

    ./openphoto -p -X POST -h current.openphoto.me -e /tag/create.json -F 'tag=sunnyvale' -F 'count=10'

<a name="example-php"></a>
#### PHP (using [openphoto-php][openphoto-php])

    $client = new OpenPhotoOAuth($host, $consumerKey, $consumerSecret, $oauthToken, $oauthTokenSecret);
    $response = $client->post("/tag/create.json", array('tag' => 'sunnyvale', 'count' => 10));

----------------------------------------

<a name="response"></a>
### Response

The response is in a standard [response envelope](http://theopenphotoproject.org/documentation/api/Envelope).

* _message_, A string describing the result. Don't use this for anything but reading.
* _code_, _201_ on success
* _result_, Boolean

<a name="sample"></a>
#### Sample

    {
      "message":"",
      "code":201,
      "result": true
    }


[Tag]: http://theopenphotoproject.org/documentation/schemas/Tag
[purpose]: #purpose
[endpoint]: #endpoint
[parameters]: #parameters
[examples]: #examples
[example-cli]: #example-cli
[example-php]: #example-php
[response]: #response
[sample]: #sample
[openphoto-php]: https://github.com/photo/openphoto-php

{'fraction_non_alphanumeric': 0.24989106753812637, 'fraction_numerical': 0.01241830065359477, 'mean_word_length': 2.8162926018287613, 'pattern_counts': {'":': 8, '<': 35, '<?xml version=': 0, '>': 41, 'https://': 2, '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': '2752462', 'n_tokens_mistral': 1444, 'n_tokens_neox': 1350, 'n_words': 390}