# \_getById

Gathers the data of one or more requested Skills, specific fields of data can be requested.

### Parameters

#### ids

An array of Skill IDs to have data retrieved from.

#### fields

An optional array of specific fields you wish to get back from returned Skills.

Valid fields which can be requested:&#x20;

* id
* name
* description
* cdate
* last\_edited

### Example

```
FM_api('Skills_getById',[
		'id'=>['60001','60002'],
		'fields'=>['name','cdate']
	]
);
```

### Results

#### On Success

Successful test with single ID and no fields parameter

```
[{"id":"60001","name":"test skill1","description":"This is a test\ndescription.","cdate":"1772446322","last_edited":"1772453260"}]
```

Successful test, with 2 Skill IDs while requesting name and cdate fields:

```
[{"name":"test skill1","cdate":"1772446322"},{"name":"test skill2","cdate":"1772447046"}]
```

#### On Failure

If the "ids" parameter is not set:

```
{"error":"missing or invalid parameter: ids"}
```

If the "ids" array has no IDs contained or is not an array:

```
{"error":"no ids in list"}
```

If the "fields" array parameter is included but does not have any valid fields:

```
{"error":"no fields selected"}
```
