# Transifex API & metadata

**URL:** <https://community.transifex.com/t/transifex-api-metadata/88>\
**Category:** Developers\
**Tags:** api, metadata\
**Created:** [October 5, 2018, 6:01pm UTC](https://community.transifex.com/t/transifex-api-metadata/88 "2018-10-05T18:01:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nina](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.transifex.com/nina/32/13_2.png) [@nina](https://community.transifex.com/u/nina)\
**Post date:** [October 5, 2018, 6:01pm UTC](https://community.transifex.com/t/transifex-api-metadata/88/1 "2018-10-05T18:01:30Z")

</div>

If a resource is transferred from one project to another, will the metadata (tags, comment, etc) be lost?

---

<div class="post-metadata">

**Author:** ![nina](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.transifex.com/nina/32/13_2.png) [@nina](https://community.transifex.com/u/nina)\
**Post date:** [October 5, 2018, 6:23pm UTC](https://community.transifex.com/t/transifex-api-metadata/88/2 "2018-10-05T18:23:17Z")

</div>

Please let me further elaborate on this.

First of all, translators’ comments cannot be transferred from one project to another but tags, character limit, instructions can be transferred via API as it is described in our documentation guide [here](https://docs.transifex.com/api/resource-strings).

Such an example can be found below:

**#** You can retrieve the desired information (tags, character limits, instructions) from the existing entries using the following API call:

```
$curl -i -L --user your_username:your_password -X GET http://www.transifex.com/api/2/project/project_slug/resource/resource_slug/source/source_entity_hash

```

The source entity hash can be either retrieved via API as it is described [here](https://docs.transifex.com/api/translation-strings#identifying-strings-using-hashes) or you can calculate it on your own as follows:

from hashlib import md5  
keys = [“string’s\_key”, ‘’]  
print( md5(’:’.join(keys).encode(‘utf-8’)).hexdigest() );  
dea8455d879cf86c1feecea628b9e6f3

In case you are interested in this approach, then check our documentation guide [here](https://docs.transifex.com/api/translation-strings#more-information-about-how-hashes-are-calculated) for more details.

The information that is being returned looks like this:

{  
“comment”: “This is an instruction related to the string”,  
“character\_limit”: null,  
“tags”: [  
“tag\_0”,  
“tag\_1”  
]  
}

**#** After creating the new resource, you can send this information back to Transifex using the following API call:

```
curl -i -L --user api:token -X PUT -H "Content-Type: application/json" \ --data '{"comment": "These are instructions related to the string", "tags": ["tag_0", "tag_1"]}' \ http://www.transifex.com/api/2/project/project_slug/resource/resource_slug/source/source_entity_hash

```

The above works on a string level but in case you want to update the metadata of multiple strings in Transifex, then you can use the following API call instead:

e.g.

```
curl -i -L --user api:token -X PUT -H "Content-Type: application/json" \ --data '[{"source_entity_hash":"....", ...., "character_limit": 140}, {"source_entity_hash":"....", ...., "character_limit": 50}]' \ http://www.transifex.com/api/2/project/project_slug/resource/resource_slug/source/
```

---

<div class="post-metadata">

**Author:** ![immense055](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.transifex.com/immense055/32/1484_2.png) [@immense055](https://community.transifex.com/u/immense055)\
**Post date:** [April 22, 2020, 9:29am UTC](https://community.transifex.com/t/transifex-api-metadata/88/3 "2020-04-22T09:29:09Z")

</div>

Yes I’m source is tran  
resource is transferred from one project to another.
