# DeviceAtlas Device Detection API Upgrade #
This document is intended for users of APIs prior to version 2.2.0. It has two
main sections:
1. Why upgrade?
2. Upgrading from 2.1.2 to 2.2.0
## Why upgrade? ##
Version 2.2.0 of the API provides an new additional API to provide
Carrier Identification intelligence. In addition, this new version
provide a precise configuration to address particular use cases.
It is a recommended upgrade for all users.
## Upgrading from 2.1.2 to 2.2.0 ##
The 2.2.0 API is a drop-in replacement, with minimal changes, for the 2.1.2 APIs.
It should not cause any compatibility issues except for the cases described below.
To upgrade to version 2.1 replace the current folder containing the API files,
and extract the new version in a new folder with the name of the API files before renaming.
## API behavior changes ##
API changes between 2.1.2 and 2.2.0 APIs are as follows:
### Namespace change ###
From:
```go
import "deviceatlas" // version 2.1.2
```
To:
```go
import "deviceatlas/device" // version 2.2.0
```
### New function to provide DaGo configuration ###
Create a new `DaGo` instance with a custom
configuration using `NewWithConfig()` function.
Any change made to the config without called
`Config()` will no longer have any effect.
Please see the [Device Detection API Config readme file](README.DeviceApi-Config.html) for more
information.
### Free function ###
The `Free` method/function is to be called to clear all the api resources once.
The garbage collector, if triggered, will call it implicitly, however it is
greatly recommended to proceed explicitly in this fashion :
`
...
da := device.New()
da.LoadDataFromFile()
defer da.Free()
...
`
### Renamed JSONMeta function ###
From:
```go
// version 2.1.2
func JsonMeta(f *DaGo) (DaJsonMeta, error) {
...
}
```
To:
```go
// version 2.2.0
func (f *DaGo) JSONMeta() (DaJSONMeta, error) {
...
}
```
### Restructured DaJSONMeta type ###
From:
```go
// version 2.1.2
type DaJsonMeta struct {
Version string
Dcreation time.Time
Revision int
}
```
To:
```go
// version 2.2.0
type DaJSONMeta struct {
Version string
Dcreation time.Time
Revision int
}
```
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
_ Copyright (c) DeviceAtlas 2022. All Rights Reserved. _
https://deviceatlas.com