# Using Device API for checking new update

**URL:** <https://hub.mender.io/t/using-device-api-for-checking-new-update/3219>\
**Category:** General Discussions\
**Created:** [February 14, 2021, 9:51am UTC](https://hub.mender.io/t/using-device-api-for-checking-new-update/3219 "2021-02-14T09:51:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![SamanRatna](https://avatars.discourse-cdn.com/v4/letter/s/6a8cbe/32.png) [@SamanRatna](https://hub.mender.io/u/SamanRatna)\
**Post date:** [February 14, 2021, 9:51am UTC](https://hub.mender.io/t/using-device-api-for-checking-new-update/3219/1 "2021-02-14T09:51:46Z")

</div>

Hi there,

I worked on the Check for update API for devices. It gives amazon AWS link for the latest pending update. How can the device explicitly download and install the update? I am guessing that the link should facilitate to accomplish it.

And, what is the difference between ‘Check Update API’ and ‘Check Update depends API’ ?

Thanks in advance.

Regards,  
Saman

---

<div class="post-metadata">

**Author:** ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)\
**Post date:** [February 14, 2021, 3:27pm UTC](https://hub.mender.io/t/using-device-api-for-checking-new-update/3219/2 "2021-02-14T15:27:49Z")

</div>

Once you have the URL you can use [standalone mode](https://docs.mender.io/artifact-creation/standalone-deployment) to install it.

As for the differences between the APIs, the “Check update depends” will provide an update match a specific set of ArtifactProvides. See [this link](https://docs.mender.io/artifact-creation/software-versioning) for full details on the versioning that is part of Mender.

Drew

---

<div class="post-metadata">

**Author:** ![SamanRatna](https://avatars.discourse-cdn.com/v4/letter/s/6a8cbe/32.png) [@SamanRatna](https://hub.mender.io/u/SamanRatna)\
**Post date:** [February 15, 2021, 7:38am UTC](https://hub.mender.io/t/using-device-api-for-checking-new-update/3219/3 "2021-02-15T07:38:20Z")

</div>

Can the standalone method be implemented for Application update?

## I get the following error…

```
pi@projectzero:/etc/mender $ sudo mender -install https://s3.amazonaws.com/hosted-mender-artifacts/5f9febf5f3379557fad08339/eebae7d6-53ca-4dd8-a8e8-b012ba6f3c59?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAQWI25QR6MOCESDWO%2F20210215%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20210215T073042Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&response-content-type=application%2Fvnd.mender-artifact&X-Amz-Signature=52f0c78f071a5742b6b9963ec2f242adb5d6f1f02a9c11830589df9299539626

    **[1] 17499**
    **[2] 17500**
    **[3] 17501**
    **-bash: X-Amz-Credential=AKIAQWI25QR6MOCESDWO%2F20210215%2Fus-east-1%2Fs3%2Faws4_request: command not found**
    **[4] 17502**
    **[5] 17503**
    **[6] 17504**
    **-bash: X-Amz-Expires=86400: command not found**
    **-bash: response-content-type=application%2Fvnd.mender-artifact: command not found**
    **-bash: X-Amz-SignedHeaders=host: command not found**
    **-bash: X-Amz-Signature=52f0c78f071a5742b6b9963ec2f242adb5d6f1f02a9c11830589df9299539626: command not found**
    **[2] Exit 127 X-Amz-Credential=AKIAQWI25QR6MOCESDWO%2F20210215%2Fus-east-1%2Fs3%2Faws4_request**
    **[4] Exit 127 X-Amz-Expires=86400**
    **[6]+ Exit 127 response-content-type=application%2Fvnd.mender-artifact**
    **[5]+ Exit 127 X-Amz-SignedHeaders=host**
    **pi@projectzero:/etc/mender $ -bash: X-Amz-Date=20210215T073042Z: command not found**
    **INFO[0000] Loaded configuration file: /etc/mender/mender.conf**
    **INFO[0000] No dual rootfs configuration present**
    **ERRO[0000] Failed to Load the Server certificate. Err SSL errors:**
    **WARN[0000] Failed to load the server TLS certificate settings: SSL errors:**
    **INFO[0000] Performing remote update from: [https://s3.amazonaws.com/hosted-mender-artifacts/5f9febf5f3379557fad08339/eebae7d6-53ca-4dd8-a8e8-b012ba6f3c59?X-Amz-Algorithm=AWS4-HMAC-SHA256].**
    **ERRO[0002] Error fetching scheduled update info: code (400)**
    **ERRO[0002] Error while installing Artifact from command line: (request_id: ): error receiving scheduled update information server error message: failed to parse server response: invalid character '<' looking for beginning of value**
 **--------------------------------------------------------------------------------------**

```

Saman

---

<div class="post-metadata">

**Author:** ![dellgreen](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/dellgreen/32/85_2.png) [@dellgreen](https://hub.mender.io/u/dellgreen)\
**Post date:** [February 15, 2021, 9:45am UTC](https://hub.mender.io/t/using-device-api-for-checking-new-update/3219/4 "2021-02-15T09:45:46Z")

</div>

Command line interpreter issue maybe, have you tried wrapping the URL in single quotes?

---

<div class="post-metadata">

**Author:** ![SamanRatna](https://avatars.discourse-cdn.com/v4/letter/s/6a8cbe/32.png) [@SamanRatna](https://hub.mender.io/u/SamanRatna)\
**Post date:** [February 15, 2021, 5:18pm UTC](https://hub.mender.io/t/using-device-api-for-checking-new-update/3219/5 "2021-02-15T17:18:06Z")

</div>

Yes, I have. It’s not helping sadly ☹

Could there be some kind of SSL certificate error. I am using hosted mender server as of now with the following hardware configuration:

Raspberry pi 4  
Raspberry pi Lite OS, Raspbian GNU/Linux 10 (buster), Kernel version 5.10.11-v7l+ #1399  
Mender client version 2.5.0  
openssl version 1.1.1d

- Saman

---

<div class="post-metadata">

**Author:** ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)\
**Post date:** [February 15, 2021, 5:34pm UTC](https://hub.mender.io/t/using-device-api-for-checking-new-update/3219/6 "2021-02-15T17:34:52Z")

</div>

It’s definitely an issue with the quoting. I can see that your shell is trying to run things in the background since using the ‘&’ string will do that. It’s definitely splitting your command on the ‘&’ characters.

Try running the following:

> pi@projectzero:/etc/mender $ sudo mender -install ‘[https://s3.amazonaws.com/hosted-mender-artifacts/5f9febf5f3379557fad08339/eebae7d6-53ca-4dd8-a8e8-b012ba6f3c59?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAQWI25QR6MOCESDWO%2F20210215%2Fus-east-1%2Fs3%2Faws4\_request&X-Amz-Date=20210215T073042Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&response-content-type=application%2Fvnd.mender-artifact&X-Amz-Signature=52f0c78f071a5742b6b9963ec2f242adb5d6f1f02a9c11830589df9299539626](https://s3.amazonaws.com/hosted-mender-artifacts/5f9febf5f3379557fad08339/eebae7d6-53ca-4dd8-a8e8-b012ba6f3c59?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAQWI25QR6MOCESDWO%2F20210215%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20210215T073042Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&response-content-type=application%2Fvnd.mender-artifact&X-Amz-Signature=52f0c78f071a5742b6b9963ec2f242adb5d6f1f02a9c11830589df9299539626)’

It should be all a single line in your shell prompt.
