# Wat is het probleem met mijn cURL-verzoek?

**URL:** https://meta.discourse.org/t/whats-the-issue-with-my-curl-request/303708
**Category:** Development
**Tags:** rest-api
**Created:** [13 april 2024 om 22:38 UTC](https://meta.discourse.org/t/whats-the-issue-with-my-curl-request/303708 "2024-04-13T22:38:21Z")
**Posts on this page:** 1
**Showing post:** 11

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [14 april 2024 om 15:34 UTC](https://meta.discourse.org/t/whats-the-issue-with-my-curl-request/303708/11 "2024-04-14T15:34:43Z")

</div>

> [@Ben\_Sutton](#):
>
> It would be great if I could set the user Profile Picture and Bio if possible.

There’s a helper function in the `Utilities` file for this:

`DiscourseUtilities::sync_sso_record( $sso_params );`

Yesterday I posted an example of how to use it: [I cannot add user to the discouse forum from a wordpress website when user added in a membership - #10 by simon](https://meta.discourse.org/t/i-cannot-add-user-to-the-discouse-forum-from-a-wordpress-website-when-user-added-in-a-membership/300025/10). The tricky part is to create the array for the `sso_params` argument. That array must contain the `external_id` field. It is set to the user’s WordPress ID:

```php
	$sso_params = array(
		'external_id' => $user_id,
	);

```

You can include any fields from this list in the payload: [discourse/lib/discourse\_connect\_base.rb at 8f52fd1051e20fdff41321c5cff99fda05af86c1 · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/8f52fd1051e20fdff41321c5cff99fda05af86c1/lib/discourse_connect_base.rb#L13-L43). Note the `BOOLS` array that is shown just under the `ACCESSORS` list that I linked to. It indicates which of the possible options are `booleans` (true/false). When making requests from WordPress, any boolean fields must be set with the strings `'true'` or `'false'`, not with the PHP `true` or `false` values.

For updating the avatar, set the `avatar_url` field in the `$sso_params` array and also set the `avatar_force_update` field to `'true'`.

There’s a `bio` field that can be used for setting the bio.

The [WP Discourse](https://github.com/discourse/wp-discourse) plugin is already setting the `bio` and `avatar_url` fields. It also has a “Force Avatar Update” setting in its SSO settings. The problem might be that these settings are only updated when a user logs into Discourse via the WordPress site. The `sync_sso_record` function updates the fields immediately, without requiring the user to login to Discourse.

Also, if you’re finding that users bios are not getting set as on Discourse, it could be that they aren’t being set on your WordPress site where the plugin is expecting them to be: [wp-discourse/lib/plugin-utilities.php at 99325e15190f3a705284dbf582f1c4b2c0b21492 · discourse/wp-discourse · GitHub](https://github.com/discourse/wp-discourse/blob/99325e15190f3a705284dbf582f1c4b2c0b21492/lib/plugin-utilities.php#L631). If Woocommerce has a different field for bios, you could access that field and use it in a call to `sync_sso_record`.

---

_[View the full topic](https://meta.discourse.org/t/whats-the-issue-with-my-curl-request/303708)._
